kuzzle-device-manager 2.0.0-rc14 → 2.0.0-rc15
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.
|
@@ -58,7 +58,7 @@ class MeasureService {
|
|
|
58
58
|
*
|
|
59
59
|
* Useful to enrich measures before they are saved.
|
|
60
60
|
*/
|
|
61
|
-
const updatedMeasures = await this.app.trigger('device-manager:measures:process:before',
|
|
61
|
+
const { measures: updatedMeasures } = await this.app.trigger('device-manager:measures:process:before', { asset, device, measures });
|
|
62
62
|
device.updateMeasures(updatedMeasures);
|
|
63
63
|
await this.sdk.document.update(this.config.adminIndex, InternalCollection_1.InternalCollection.DEVICES, device._id, { measures: device._source.measures });
|
|
64
64
|
if (device._source.engineId) {
|
|
@@ -77,7 +77,7 @@ class MeasureService {
|
|
|
77
77
|
*
|
|
78
78
|
* @todo test this
|
|
79
79
|
*/
|
|
80
|
-
await this.app.trigger('device-manager:measures:process:after',
|
|
80
|
+
await this.app.trigger('device-manager:measures:process:after', { asset, device, measures });
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
buildMeasures(device, asset, measurements, payloadUuids) {
|
|
@@ -143,7 +143,10 @@ class MeasureService {
|
|
|
143
143
|
};
|
|
144
144
|
});
|
|
145
145
|
// @todo replace with batch.mCreate when available
|
|
146
|
-
const { successes } = await this.sdk.document.mCreate(this.config.adminIndex, InternalCollection_1.InternalCollection.DEVICES, newDevices, { refresh
|
|
146
|
+
const { successes, errors } = await this.sdk.document.mCreate(this.config.adminIndex, InternalCollection_1.InternalCollection.DEVICES, newDevices, { refresh });
|
|
147
|
+
for (const error of errors) {
|
|
148
|
+
this.app.log.error(`Cannot create device "${error.document._id}": ${error.reason}`);
|
|
149
|
+
}
|
|
147
150
|
return successes.map(({ _source, _id }) => new models_1.Device(_source, _id));
|
|
148
151
|
}
|
|
149
152
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle-device-manager",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-rc15",
|
|
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": {
|