datapoints-export-selector/datapoints-export-selector-modal/datapoints-export-selector-file-exporter/data-fetching.service.ts
constructor(alertService: AlertService, measurementService: MeasurementService, translateService: TranslateService, utilsService: UtilsService)
|
|||||||||||||||
Parameters :
|
adjustDate | ||||||||||||||||||||
adjustDate(date: string | Date, minutes: number, roundSeconds)
|
||||||||||||||||||||
Adjusts the given date by adding the specified number of minutes and setting seconds to 0. Example :
Parameters :
Returns :
string
The adjusted date in ISO string format. |
Async fetchAndPrepareDataToExport | |||||||||
fetchAndPrepareDataToExport(exportConfig: ExportConfig, isMeasurement: boolean)
|
|||||||||
Parameters :
Returns :
Promise<DataToExport[]>
|
Async fetchAndProcessMeasurementFile | ||||||||||||||||
fetchAndProcessMeasurementFile(details: DatapointDetails, measurementFileConfig: MeasurementFileConfig, roundSeconds)
|
||||||||||||||||
Parameters :
Returns :
Promise<DataToExportWithBackendCreatedFile | undefined>
|
Async fetchMeasurementDataFilesAndPairWithSourceDetails | |||||||||
fetchMeasurementDataFilesAndPairWithSourceDetails(acceptFileType: string, exportConfig: ExportConfig)
|
|||||||||
Parameters :
Returns :
Promise<DataToExportWithBackendCreatedFile[]>
|
Async fetchSeriesData | |||||||||||||||
fetchSeriesData(rawFilter: ISeriesFilter, roundSeconds)
|
|||||||||||||||
Asynchronously loads series data based on the provided parameters. This method constructs a filter for retrieving series data within a specified date range, from a specific source, and optionally applying an aggregation type.
Parameters :
Returns :
Promise | undefined
A promise that resolves to series data wrapped in result object. |
Async getDatapointsExceedingLimit | ||||||||
getDatapointsExceedingLimit(exportConfig: ExportConfig)
|
||||||||
Checks if any of measurements requests may exceeded the limit, after which the export data is processed by the backend and the generated CSV/Excel file is sent by email. The threshold is set to 50_000 records in application's core properties (export.data.synchronous.limit).
Parameters :
Returns :
Promise<DatapointsExceedingLimit[]>
A promise that returns an array of objects representing datapoints files that will be sent by email. |
getLimitExceededMessage | ||||||||||||||||||||||||
getLimitExceededMessage(hasNoExportableData: boolean, emailDeliverableCount?: number, browserDownloadableCount?: number, nonRetrievableCount?: number, totalDatapointsSelectedForExportCount?: number)
|
||||||||||||||||||||||||
Retrieves the message to be displayed when the limit of datapoints is exceeded during file export.
Parameters :
Returns :
string
The message that can be injected. |
Async getSourcesWithPermissionsToRead | ||||||
getSourcesWithPermissionsToRead(datapointDetails: DatapointDetails[])
|
||||||
Parameters :
Returns :
Promise<string[]>
|
groupSeriesByDeviceId | ||||||||
groupSeriesByDeviceId(datapointDetails: DatapointDetails[])
|
||||||||
Returns a map of active data points device IDs with their corresponding series. Example output: Example :
Parameters :
Returns :
DatapointsValuesDataMap
A map where the key is the data point ID and the value is an array of data point series. |
Async mergeMeasurementsWithItsSourceDetails | |||||||||
mergeMeasurementsWithItsSourceDetails(details: DatapointDetails, measurementFile: IFetchResponse)
|
|||||||||
Parameters :
Returns :
Promise<DataToExportWithBackendCreatedFile>
|
prepareMeasurementsFilter | |||||||||||||||
prepareMeasurementsFilter(details: DatapointDetails, exportConfig: ExportConfig, roundSeconds: boolean, pageSize?: number)
|
|||||||||||||||
Parameters :
Returns :
IMeasurementFilter
|
processMeasurementDataForPreview | |||||||||
processMeasurementDataForPreview(details: DatapointDetails, data: IMeasurement[])
|
|||||||||
Parameters :
Returns :
DataToExport
|
processSeriesData | ||||||||||||
processSeriesData(datapointDetails: DatapointDetails[], fetchedDataMap: SourceItem[])
|
||||||||||||
Processes the fetched series data and prepares it for export.
Parameters :
Returns :
DataToExport[]
An array of DataToExport objects. |
removeZeroCountListItems | ||||||||||||||||||||
removeZeroCountListItems(message: string, counts: number[], countToTrim: number)
|
||||||||||||||||||||
Trims the given HTML message by removing list items that correspond to zero counts. Example: Example :
Parameters :
Returns :
string
A trimmed HTML string with list items removed where the corresponding count is zero. Example: Example :
|
showSendViaEmailInfoAlert | ||||||||||||
showSendViaEmailInfoAlert(fileType: string, datapointsExceedingLimit: DatapointsExceedingLimit[])
|
||||||||||||
Displays an information alert about sending data via email. Only measurements API can send files via email.
Parameters :
Returns :
void
|