Upgrade JavaScript SDK 2.x to 3.x
How to upgrade from SDK version 2.x to 3.x.Renamed interfaces
Some TypeScript interfaces have been renamed to have consistency between different resource types. The most used ones are:- GetTimeSeriesMetadataDTO -> Timeseries
- PostTimeSeriesMetadataDTO -> ExternalTimeseries
- DatapointsGetAggregateDatapoint -> DatapointAggregates
- FilesMetadata -> FileInfo
Events aggregate endpoints moved to a sub-API
client.events.aggregate(...)->client.events.aggregate.count()client.events.uniqueValuesAggregate(...)->client.events.aggregate.uniqueValues(...)
Timestamp-to-Date auto-conversion
The JavaScript SDK automatically converts response timestamp values to date objects. This caused a bug in the Raw API. The fix can introduce a breaking change if you use the Raw API, and possibly in other places.Helper classes removed
AssetClass, TimeSeriesClass, TimeSeriesList, and AssetList contained some helper methods that have been removed. Most of these helpers can be re-implemented using other SDK calls. Some examples: Asset.delete()Removed client.assets.retrieveSubtree(…)
Copies the functionality ofAsset.subtree() (read above).
Change filter passing to client.timeseries.list
The function previously took aTimeseriesFilter as input and now takes a TimeseriesFilterQuery, which
corresponds to the API spec. All filter-related fields should now be in the filter object.