cozy-client / models / timeseries
Namespace: timeseries¶
models.timeseries
Interfaces¶
Functions¶
fetchTimeSeriesByIntervalAndSource¶
▸ fetchTimeSeriesByIntervalAndSource(client
, params
): Promise
<TimeSeriesJSONAPI
>
Helper to retrieve time series by their date interval and source.
property
data {Array
Parameters
Name | Type | Description |
---|---|---|
client |
any |
The CozyClient instance |
params |
Object |
The query params |
params.dataType |
string |
The type of time series, e.g. ‘electricity’ |
params.endDate |
Date |
The end date of the series |
params.limit |
number |
Number of serie items to retrieve |
params.source |
string |
The data source, e.g. ‘enedis.fr’ |
params.startDate |
Date |
The starting date of the series |
Returns
Promise
<TimeSeriesJSONAPI
>
The TimeSeries found by the query in JSON-API format
Defined in
packages/cozy-client/src/models/timeseries.js:77
saveTimeSeries¶
▸ saveTimeSeries(client
, timeseriesOption
): Promise
<any
>
Helper to save a time series document.
Parameters
Name | Type | Description |
---|---|---|
client |
any |
The CozyClient instance |
timeseriesOption |
TimeSeries |
The time series to save |
Returns
Promise
<any
>
Defined in