@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
241 lines • 7.81 kB
TypeScript
import { AggregationOption } from '@c8y/ngx-components';
import { Measurement } from './datapoints-export-selector-modal/datapoints-export-selector-file-exporter/utils.service';
import { SupportedIconsSuggestions } from '@c8y/ngx-components/icon-selector/icons';
export declare const HAS_ERROR = "has-error";
export declare const MEASUREMENTS_PREVIEW_ITEMS_LIMIT = 5;
export declare const SERIES_DATA_MERGED_FILE_NAME = "seriesDataMergedFileName";
/**
* Represents counts of datapoints data categorized by their availability and delivery method.
*/
export interface DatapointCounts {
/**
* The number of datapoints whose data can be directly downloaded
* through a web browser.
*/
browserDownloadableCount: number;
/**
* The number of datapoints whose data will be sent via email because its record count exceeded 50_000.
*/
emailDeliverableCount: number;
/**
* The number of datapoints whose data cannot be retrieved at all,
* neither through direct download nor via email because its record count exceeded 1_000_000 API limit.
*/
nonRetrievableCount: number;
}
/**
* Represents a datapoints which number of records exceed a threshold where data will be precessed by a backend.
*/
export interface DatapointsExceedingLimit {
datapointDetail: DatapointDetails;
totalElements: number;
}
export interface DateFetchConfig {
date: string;
shouldFetchData: boolean;
}
export interface IDataTransformer {
transformToMergedFormat(data: ExportData[]): TimeSeriesColumnData;
}
export interface FileGenerator {
generateMerged?: (exportData: ExportData[], mergedExportDetails: MergedExportDetails) => BlobPart;
getFileExtension(): string;
getMimeType(): string;
getLabel(): string;
getIcon(): string;
getType(): string;
getTitle(): string;
getZipName(): string;
getAcceptType(): string;
}
export interface FileTypeMetadata {
extension: string;
icon: SupportedIconsSuggestions;
label: string;
title: string;
type: string;
zipName: string;
}
/**
* Represents the data structure, which is used to be transformed into a file (series) or used for a preview (series and measurements).
*/
export interface ExportData {
time?: string | null;
source: string | number;
device_name: string;
fragment_series: string;
/**
* Represents the value of a measurement for /measurement data API.
*/
value?: number | null;
/**
* Represents the min value of a measurement for /series data API.
*/
value_min?: number | null;
/**
* Represents the value of a measurement for /series data API.
* Measurement API data does not contain max value.
*/
value_max?: number | null;
unit?: string | null;
}
export interface DatapointDetails {
deviceName?: string;
source: string | number;
valueFragmentSeries: string;
valueFragmentType: string;
}
/**
* Represents the data structure, which is used to be
* transformed into an ExportData.
*/
export interface DataToExport extends DatapointDetails {
unit: string | undefined;
timeValueMap: {
[timestamp: string]: Measurement;
} | undefined;
}
/**
* Represents the data to be exported along with the backend-created file.
* Only measurements API generates a file on the backend.
*/
export interface DataToExportWithBackendCreatedFile {
source: string | number;
valueFragmentSeries: string;
valueFragmentType: string;
fetchedMeasurementsBlobFile: Blob;
}
/**
* Base configuration for the export process.
*/
export interface ExportConfig {
aggregation?: AggregationOption;
datapointDetails: DatapointDetails[];
dateFrom: string;
dateTo: string;
}
/**
* Represents the configuration on the basis of which the zip file is created.
*/
export interface FileExportConfig {
fileType: string;
zipName: string;
}
/**
* Represents a required config properties used in a process of generating a measurements based export file.
*/
export interface MeasurementFileConfig {
exportConfig: ExportConfig;
acceptFileType: string;
}
/**
* Represents a required config properties along with transformed data structures,
* used in a process of generating a series based export file.
*/
export interface SeriesExportParams {
flattenedAndSortedExportData: ExportData[];
fileType: string;
mergedExportDetails: MergedExportDetails;
}
export interface TimeSeriesColumnData {
timeSeries: Map<TimeStamp, ColumnValueMap>;
uniqueColumnIdentifiers: string[];
}
/**
* Represents a mapping of datapoints series values.
* The key of the map is a source, and the value is the value data from requested series.
*/
export type DatapointsValuesDataMap = Map<SourceId | number, string[]>;
export type SourceId = string | number;
export type FileCompressionTypes = 'STORE' | 'DEFLATE';
export type TimeSeriesData = {
[timestamp: string]: Measurement;
};
export interface FileTypeConfig {
extension: string;
mimeType: string;
acceptType: string;
}
/**
* Represents the details unique for a merged file.
*/
export type MergedExportDetails = {
aggregation: AggregationOption;
dateFrom: string;
dateTo: string;
};
export type ExportedFile = {
fileName: string;
fileData: Blob;
};
export type TimeStamp = string;
export type ReadingValue = number;
/**
* Represents the min and max values for a specific timestamp.
* Both min and max values are available only when using series API.
*/
export type MinMaxValues = {
min: number;
max: number;
};
/**
* Represents a merged export column header,
* e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)'
*/
type ColumnHeader = string;
/**
* Represents a mapping of column headers and their corresponding values.
* e.g. 'Temperature - 5 -> c8y_Temperature.T [ºC] (max)': 25
*/
export type ColumnValueMap = {
[key: ColumnHeader]: ReadingValue;
};
export declare const EXPORT_MODE_LABELS: {
readonly FULL: "Full";
readonly COMPACT: "Compact";
};
/**
* Each export type is based on a different API:
* - COMPACT - series
* - FULL - measurements
* All differences between export modes:
* Compact:
* Processes up to 5,000 records per data point, or up to the data retention limit (API limit)
* Creates a single merged file containing all the data
* Provides minimum and maximum values (API feature)
* Preview is not available
* Supports optional data aggregation (API feature)
* Full:
* Processes up to 1,000,000 records per data point, or up to the data retention limit (API limit)
* For exports exceeding 50,000 records, data will be sent via email
* Creates a compressed ZIP file containing separate data files for each selected data point
* Preview is available
* Does not support data aggregation
*/
export declare const EXPORT_MODE_VALUES: {
readonly full: "FULL";
readonly compact: "COMPACT";
};
export declare const FILE_COMPRESSION_TYPES_VALUES: {
readonly store: "STORE";
readonly deflate: "DEFLATE";
};
export declare const PRODUCT_EXPERIENCE_DATAPOINTS_EXPORT_SELECTOR: {
readonly EVENTS: {
readonly EXPORT_SELECTOR: "exportSelector";
};
readonly COMPONENTS: {
readonly DATAPOINTS_EXPORT_SELECTOR: "datapoints-export-selector";
readonly DATAPOINTS_EXPORT_SELECTOR_FILE_EXPORTER: "datapoints-export-selector-file-exporter";
};
readonly ACTIONS: {
readonly OPEN_MODAL: "openModal";
readonly DOWNLOAD_STARTED: "downloadStarted";
};
readonly EXPORT_CONFIG: {
readonly FULL_EXPORT_TYPE: "fullExportType";
readonly COMPACT_EXPORT_TYPE: "compactExportType";
};
};
export {};
//# sourceMappingURL=datapoints-export-selector.model.d.ts.map