From d588a93b0dd5b270199083cfb0856e34b57afa66 Mon Sep 17 00:00:00 2001 From: Thomas Mauran <78204354+thomas-mauran@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:09:36 +0100 Subject: [PATCH 1/3] fix: getAsset should search in commons assets too (#380) --- lib/modules/model/ModelService.ts | 7 ++++++- tests/scenario/modules/models/asset-model.test.ts | 9 --------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/modules/model/ModelService.ts b/lib/modules/model/ModelService.ts index d5dc9800..92788c1d 100644 --- a/lib/modules/model/ModelService.ts +++ b/lib/modules/model/ModelService.ts @@ -572,7 +572,12 @@ export class ModelService extends BaseService { ): Promise> { const query = { and: [ - { equals: { engineGroup } }, + { + or: [ + { equals: { engineGroup } }, + { equals: { engineGroup: "commons" } }, + ], + }, { equals: { type: "asset" } }, { equals: { "asset.model": model } }, ], diff --git a/tests/scenario/modules/models/asset-model.test.ts b/tests/scenario/modules/models/asset-model.test.ts index 38d47885..7d475397 100644 --- a/tests/scenario/modules/models/asset-model.test.ts +++ b/tests/scenario/modules/models/asset-model.test.ts @@ -111,15 +111,6 @@ describe("ModelsController:assets", () => { _id: "model-asset-Plane", _source: { asset: { model: "Plane" } }, }); - - const getAssetNotExist = sdk.query({ - controller: "device-manager/models", - action: "getAsset", - engineGroup: "other_engine", - model: "Plane", - }); - - await expect(getAssetNotExist).rejects.toMatchObject({ status: 404 }); }); it("List asset models only from the requested engine group and the common ones", async () => { From 8818ba3c85e83d7309fd766369f60b4c8bc2878b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 18 Nov 2024 10:21:22 +0000 Subject: [PATCH 2/3] chore(release): 2.4.4 [skip ci] ## [2.4.4](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.4.4) (2024-11-18) ### Bug Fixes * getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) --- 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 8322f06c..60fe66bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [2.4.4](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.4.4) (2024-11-18) + + +### Bug Fixes + +* getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) + ## [2.4.3](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.2...v2.4.3) (2024-10-25) diff --git a/package-lock.json b/package-lock.json index 92044755..fb116d99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kuzzle-device-manager", - "version": "2.4.3", + "version": "2.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kuzzle-device-manager", - "version": "2.4.3", + "version": "2.4.4", "license": "Apache-2.0", "dependencies": { "csv-stringify": "^6.4.5", diff --git a/package.json b/package.json index 982d517a..0b616f74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager", - "version": "2.4.3", + "version": "2.4.4", "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 409b6775..f7de61d4 100644 --- a/types/package.json +++ b/types/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager-types", - "version": "2.4.3", + "version": "2.4.4", "description": "Shared types for Kuzzle Device Manager", "author": "The Kuzzle Team (support@kuzzle.io)", "main": "index.js", From f69c0a7fe40e38c131052077d694365d87bcebfa Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 18 Nov 2024 11:25:36 +0000 Subject: [PATCH 3/3] chore(release): 2.5.0-dev.2 [skip ci] # [2.5.0-dev.2](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.5.0-dev.1...v2.5.0-dev.2) (2024-11-18) ### Bug Fixes * backport fix ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([5392b56](https://github.com/kuzzleio/kuzzle-device-manager/commit/5392b56a9478b1c1932845ee44965d5978197350)) * getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) --- CHANGELOG.md | 8 ++++++++ package-lock.json | 4 ++-- package.json | 2 +- types/package.json | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd3188aa..d03d20e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# [2.5.0-dev.2](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.5.0-dev.1...v2.5.0-dev.2) (2024-11-18) + + +### Bug Fixes + +* backport fix ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([5392b56](https://github.com/kuzzleio/kuzzle-device-manager/commit/5392b56a9478b1c1932845ee44965d5978197350)) +* getAsset should search in commons assets too ([#380](https://github.com/kuzzleio/kuzzle-device-manager/issues/380)) ([d588a93](https://github.com/kuzzleio/kuzzle-device-manager/commit/d588a93b0dd5b270199083cfb0856e34b57afa66)) + # [2.5.0-beta.1](https://github.com/kuzzleio/kuzzle-device-manager/compare/v2.4.3...v2.5.0-beta.1) (2024-11-12) diff --git a/package-lock.json b/package-lock.json index d23d9f9a..30b56179 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "kuzzle-device-manager", - "version": "2.5.0-beta.1", + "version": "2.5.0-dev.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "kuzzle-device-manager", - "version": "2.5.0-beta.1", + "version": "2.5.0-dev.2", "license": "Apache-2.0", "dependencies": { "ajv": "^8.13.0", diff --git a/package.json b/package.json index 0bced866..3483f776 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager", - "version": "2.5.0-beta.1", + "version": "2.5.0-dev.2", "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 5c127fd1..5d29bee9 100644 --- a/types/package.json +++ b/types/package.json @@ -1,6 +1,6 @@ { "name": "kuzzle-device-manager-types", - "version": "2.5.0-beta.1", + "version": "2.5.0-dev.2", "description": "Shared types for Kuzzle Device Manager", "author": "The Kuzzle Team (support@kuzzle.io)", "main": "index.js",