From 7af109c6e184a3ad04479f4d6626ddeb84d18cfe Mon Sep 17 00:00:00 2001 From: Allan Merland Date: Fri, 25 Oct 2024 11:33:52 +0200 Subject: [PATCH 1/2] fix(device): create apply default metadata (#378) --- lib/modules/device/DeviceService.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/modules/device/DeviceService.ts b/lib/modules/device/DeviceService.ts index 6b13a676..3a71d968 100644 --- a/lib/modules/device/DeviceService.ts +++ b/lib/modules/device/DeviceService.ts @@ -30,6 +30,7 @@ import { EventDeviceUpdateAfter, EventDeviceUpdateBefore, } from "./types/DeviceEvents"; +import _ from "lodash"; type MeasureName = { asset: string; device: string; type: string }; @@ -116,6 +117,11 @@ export class DeviceService extends DigitalTwinService { )) { device._source.metadata[metadataName] ||= null; } + for (const [metadataName, metadataValue] of Object.entries( + deviceModel.device.defaultMetadata, + )) { + _.set(device._source.metadata, metadataName, metadataValue); + } const refreshableCollections: Array<{ index: string; From 4be18d619669b73436551821806c252698796ff7 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 25 Oct 2024 09:44:26 +0000 Subject: [PATCH 2/2] chore(release): 2.4.3-dev.1 [skip ci] ## [2.4.3-dev.1](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.2...v2.4.3-dev.1) (2024-10-25) ### Bug Fixes * **device:** create apply default metadata ([#378](https://github.com/kuzzleio/kuzzle-device-manager/issues/378)) ([7af109c](https://github.com/kuzzleio/kuzzle-device-manager/commit/7af109c6e184a3ad04479f4d6626ddeb84d18cfe)) --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- types/package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1bed756..317abbc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.4.3-dev.1](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.2...v2.4.3-dev.1) (2024-10-25) + + +### Bug Fixes + +* **device:** create apply default metadata ([#378](https://github.com/kuzzleio/kuzzle-device-manager/issues/378)) ([7af109c](https://github.com/kuzzleio/kuzzle-device-manager/commit/7af109c6e184a3ad04479f4d6626ddeb84d18cfe)) + ## [2.4.2](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.1...v2.4.2) (2024-10-08) diff --git a/package-lock.json b/package-lock.json index b5297066..ae45d69f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kuzzle-device-manager", - "version": "2.4.2", + "version": "2.4.3-dev.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kuzzle-device-manager", - "version": "2.4.2", + "version": "2.4.3-dev.1", "license": "Apache-2.0", "dependencies": { "csv-stringify": "^6.4.5", diff --git a/package.json b/package.json index 48f2b059..1a2cfe14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager", - "version": "2.4.2", + "version": "2.4.3-dev.1", "description": "Manage your IoT devices and assets. Choose a provisioning strategy, receive and decode payload, handle your IoT business logic.", "author": "The Kuzzle Team (support@kuzzle.io)", "repository": { diff --git a/types/package.json b/types/package.json index 8f3e6132..01c4995f 100644 --- a/types/package.json +++ b/types/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager-types", - "version": "2.4.2", + "version": "2.4.3-dev.1", "description": "Shared types for Kuzzle Device Manager", "author": "The Kuzzle Team (support@kuzzle.io)", "main": "index.js",