From f99e8dd998b9629b35b3504028d19e10b5172727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rodriguez?= Date: Thu, 11 Jul 2024 12:46:34 +0200 Subject: [PATCH 1/2] fix(device): correct device HTTP API --- doc/2/controllers/assets/delete/index.md | 2 +- doc/2/controllers/devices/delete/index.md | 2 +- lib/modules/device/DevicesController.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/2/controllers/assets/delete/index.md b/doc/2/controllers/assets/delete/index.md index 8801ff4b..e676879b 100644 --- a/doc/2/controllers/assets/delete/index.md +++ b/doc/2/controllers/assets/delete/index.md @@ -14,7 +14,7 @@ Deletes an asset. ### HTTP ```http -URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:assetId +URL: http://kuzzle:7512/_/device-manager/:engineId/assets/:_id Method: DELETE ``` diff --git a/doc/2/controllers/devices/delete/index.md b/doc/2/controllers/devices/delete/index.md index 1f4f548f..49cc042a 100644 --- a/doc/2/controllers/devices/delete/index.md +++ b/doc/2/controllers/devices/delete/index.md @@ -14,7 +14,7 @@ Deletes a device. ### HTTP ```http -URL: http://kuzzle:7512/_/device-manager/:engineId/devices/:deviceId +URL: http://kuzzle:7512/_/device-manager/:engineId/devices/:_id Method: DELETE ``` diff --git a/lib/modules/device/DevicesController.ts b/lib/modules/device/DevicesController.ts index d41df03b..269440ef 100644 --- a/lib/modules/device/DevicesController.ts +++ b/lib/modules/device/DevicesController.ts @@ -53,7 +53,7 @@ export class DevicesController { update: { handler: this.update.bind(this), http: [ - { path: "device-manager/:engineId/device/:deviceId", verb: "post" }, + { path: "device-manager/:engineId/devices/:_id", verb: "put" }, ], }, search: { @@ -66,7 +66,7 @@ export class DevicesController { handler: this.delete.bind(this), http: [ { - path: "device-manager/:engineId/device/:deviceId", + path: "device-manager/:engineId/devices/:_id", verb: "delete", }, ], From ea96f33c86cca3add29fb6f842c748a3b21a39bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rodriguez?= Date: Thu, 11 Jul 2024 15:11:47 +0200 Subject: [PATCH 2/2] fix(lint): correct eslint config --- package.json | 4 ++-- tsconfig.test.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 597fd0d4..1a7507e6 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "test": "npm run test:functional && npm run test:types", "test:functional": "jest --runInBand", "test:types": "tsc --noEmit", - "lint": "eslint ./lib ./tests --ext .ts --config .eslintrc.json", - "lint:fix": "eslint ./lib ./tests --ext .ts --config .eslintrc.json --fix", + "lint": "eslint ./lib ./tests --ext .ts", + "lint:fix": "eslint ./lib ./tests --ext .ts --fix", "prettier": "prettier lib/ tests/ --write", "build": "tsc --build tsconfig.json", "prepack": "npm run build" diff --git a/tsconfig.test.json b/tsconfig.test.json index 35657b07..aebfd35a 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -7,7 +7,7 @@ "include": [ "lib/**/*.ts", "scripts/**/*.mjs", - "tests/application/**/*.ts", + "tests/**/*.ts", ".eslintrc.cjs", "index.ts", "releaseTypes.mjs"