kuzzleio / kuzzle-device-manager

IoT Devices & Assets Management providing digital twins, payload decoding, normalized measures, provisioning. Multi-Tenant ready for white labelled and B2B2C applications.
https://docs.kuzzle.io/official-plugins/device-manager/1
Apache License 2.0
14 stars 7 forks source link

feat!: stop using measures from assets and devices in exporter #369

Open Kuruyia opened 2 months ago

Kuruyia commented 2 months ago

What does this PR do ?

This modifies the digital twin exporter to use the recently introduced ask:device-manager:${type}:get-last-measures ask to retrieve the measures of a digital twin, instead of relying on the measures embedded in their documents.

This is in preparation for the removal of the measures and lastMeasuredAt fields in the documents of the assets and devices collections.

Other changes

A new mechanism has been introduced in the abstract exporter, the export stream augmenters, that are used to modify the exporter search results right before they get written to the export stream.

Digital twin exporter tests were also updated to check the exact values of the export results, and to sort the export client-side (because sorting by measure in the request is no longer supported).

Breaking changes

This deprecates the use of the measures and lastMeasuredAt fields in the query and sort parameters of the export request.

In the IoT Platform, the following places were identified that will be affected by this deprecation:

Part of KZLPRD-438.