kuzzle-device-manager 2.0.0-rc16 → 2.0.0-rc20
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.
|
@@ -170,7 +170,13 @@ class AssetController extends RelationalController_1.RelationalController {
|
|
|
170
170
|
const body = request.getBody();
|
|
171
171
|
const asset = await this.sdk.document.get(engineId, this.collection, id);
|
|
172
172
|
let assetMetadata = request.input.body.metadata;
|
|
173
|
-
|
|
173
|
+
if (assetMetadata) {
|
|
174
|
+
const previousMetadata = asset._source.metadata
|
|
175
|
+
? asset._source.metadata.filter(m => !Object.keys(assetMetadata).includes(m.key))
|
|
176
|
+
: [];
|
|
177
|
+
const updatedMetadata = this.assetCategoryService.formatMetadataForES(assetMetadata);
|
|
178
|
+
request.input.body.metadata = [...updatedMetadata, ...previousMetadata];
|
|
179
|
+
}
|
|
174
180
|
const response = await global.app.trigger('device-manager:asset:update:before', {
|
|
175
181
|
asset,
|
|
176
182
|
updates: body
|
|
@@ -123,7 +123,7 @@ class RelationalController extends kuzzle_plugin_commons_1.CRUDController {
|
|
|
123
123
|
request.input.args.index = request.getString('engineId');
|
|
124
124
|
const promises = [];
|
|
125
125
|
promises.push(this.deleteNested(request, nestedFields));
|
|
126
|
-
if (manyToManyLinkedFields
|
|
126
|
+
if (manyToManyLinkedFields.length > 0 || oneToManyLinkedFields.length > 0) {
|
|
127
127
|
const document = await this.sdk.document.get(request.getString('engineId'), this.collection, request.getId());
|
|
128
128
|
for (const childrenField of manyToManyLinkedFields) {
|
|
129
129
|
promises.push(this.propagateDelete(document._source[childrenField], childrenField, true, request));
|
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-rc20",
|
|
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": {
|
|
@@ -31,18 +31,18 @@
|
|
|
31
31
|
"lodash": "^4.17.21"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/node": "^
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
36
|
-
"@typescript-eslint/parser": "^5.
|
|
34
|
+
"@types/node": "^18.7.14",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^5.36.1",
|
|
36
|
+
"@typescript-eslint/parser": "^5.36.1",
|
|
37
37
|
"axios": "^0.27.2",
|
|
38
38
|
"cucumber": "^6.0.5",
|
|
39
39
|
"ergol": "^1.0.2",
|
|
40
|
-
"eslint": "^8.
|
|
41
|
-
"kuzzle": "^2.
|
|
42
|
-
"kuzzle-sdk": "^7.
|
|
40
|
+
"eslint": "^8.23.0",
|
|
41
|
+
"kuzzle": "^2.19.3",
|
|
42
|
+
"kuzzle-sdk": "^7.10.0",
|
|
43
43
|
"should": "^13.2.3",
|
|
44
|
-
"ts-node": "^10.
|
|
45
|
-
"typescript": "^4.
|
|
44
|
+
"ts-node": "^10.9.1",
|
|
45
|
+
"typescript": "^4.8.2"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"kuzzle": "^2.17.3"
|