kuzzle-device-manager 2.0.0-rc10 → 2.0.0-rc14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -53,7 +53,12 @@ class MeasureService {
53
53
  }
54
54
  }
55
55
  const measures = this.buildMeasures(device, asset, decodedPayloads[device._source.reference], payloadUuids);
56
- const updatedMeasures = await this.app.trigger('device-manager:measures:receive', measures, { asset, device });
56
+ /**
57
+ * Event before starting to process new measures.
58
+ *
59
+ * Useful to enrich measures before they are saved.
60
+ */
61
+ const updatedMeasures = await this.app.trigger('device-manager:measures:process:before', measures, { asset, device });
57
62
  device.updateMeasures(updatedMeasures);
58
63
  await this.sdk.document.update(this.config.adminIndex, InternalCollection_1.InternalCollection.DEVICES, device._id, { measures: device._source.measures });
59
64
  if (device._source.engineId) {
@@ -65,6 +70,14 @@ class MeasureService {
65
70
  await this.sdk.document.update(device._source.engineId, InternalCollection_1.InternalCollection.ASSETS, asset._id, { measures: asset._source.measures });
66
71
  }
67
72
  }
73
+ /**
74
+ * Event at the end of the measure process pipeline.
75
+ *
76
+ * Useful to trigger alerts.
77
+ *
78
+ * @todo test this
79
+ */
80
+ await this.app.trigger('device-manager:measures:process:after', measures, { asset, device });
68
81
  }
69
82
  }
70
83
  buildMeasures(device, asset, measurements, payloadUuids) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-device-manager",
3
- "version": "2.0.0-rc10",
3
+ "version": "2.0.0-rc14",
4
4
  "description": "Manage your IoT devices and assets. Choose a provisioning strategy, receive and decode payload, handle your IoT business logic.",
5
5
  "author": "The Kuzzle Team (support@kuzzle.io)",
6
6
  "repository": {
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "csvtojson": "~2.0.10",
28
28
  "json-stable-stringify": "^1.0.1",
29
- "kuzzle-plugin-commons": "https://github.com/kuzzleio/kuzzle-plugin-commons/archive/refs/tags/1.0.4.tar.gz",
29
+ "kuzzle-plugin-commons": "https://github.com/kuzzleio/kuzzle-plugin-commons/archive/refs/tags/1.0.5.tar.gz",
30
30
  "uuid": "~8.3.2",
31
31
  "lodash": "^4.17.21"
32
32
  },