kuzzle-device-manager-types 2.1.3 → 2.1.5

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.
Files changed (50) hide show
  1. package/dist/lib/modules/asset/roles/RoleAssetsAdmin.d.ts +1 -0
  2. package/dist/lib/modules/asset/roles/RoleAssetsReader.d.ts +1 -0
  3. package/dist/lib/modules/decoder/Decoder.d.ts +5 -2
  4. package/dist/lib/modules/device/roles/RoleDevicesAdmin.d.ts +2 -0
  5. package/dist/lib/modules/device/roles/RoleDevicesReader.d.ts +2 -0
  6. package/dist/{features/fixtures → tests}/application/assets/Container.d.ts +1 -1
  7. package/dist/{features/fixtures → tests}/application/assets/Warehouse.d.ts +1 -1
  8. package/dist/{features/fixtures → tests}/application/decoders/DummyTempDecoder.d.ts +4 -1
  9. package/dist/{features/fixtures → tests}/application/decoders/DummyTempPositionDecoder.d.ts +1 -1
  10. package/dist/tests/fixtures/fixtures.d.ts +42 -0
  11. package/dist/tests/helpers/document.d.ts +5 -0
  12. package/dist/tests/helpers/index.d.ts +4 -0
  13. package/dist/tests/helpers/payloads.d.ts +18 -0
  14. package/dist/tests/helpers/sdk.d.ts +2 -0
  15. package/dist/tests/helpers/setup.d.ts +1 -0
  16. package/dist/tests/hooks/collections.d.ts +3 -0
  17. package/dist/tests/hooks/engines.d.ts +2 -0
  18. package/dist/tests/hooks/fixtures.d.ts +2 -0
  19. package/dist/tests/scenario/migrated/asset-controller.test.d.ts +1 -0
  20. package/dist/tests/scenario/migrated/asset-history.test.d.ts +1 -0
  21. package/dist/tests/scenario/migrated/asset-roles.test.d.ts +1 -0
  22. package/dist/tests/scenario/migrated/decoder-decoders-controller.test.d.ts +1 -0
  23. package/dist/tests/scenario/migrated/decoder-default-rights.test.d.ts +1 -0
  24. package/dist/tests/scenario/migrated/decoder-payload-controller.test.d.ts +1 -0
  25. package/dist/tests/scenario/migrated/decoder-payloads-mappings.test.d.ts +1 -0
  26. package/dist/tests/scenario/migrated/decoder-roles.test.d.ts +1 -0
  27. package/dist/tests/scenario/migrated/device-controller-attach-engine.test.d.ts +1 -0
  28. package/dist/tests/scenario/migrated/device-controller-detach-engine.test.d.ts +1 -0
  29. package/dist/tests/scenario/migrated/device-controller-get-measures.test.d.ts +1 -0
  30. package/dist/tests/scenario/migrated/device-controller-unlink-asset.test.d.ts +1 -0
  31. package/dist/tests/scenario/migrated/device-metadata.test.d.ts +1 -0
  32. package/dist/tests/scenario/migrated/device-roles.test.d.ts +1 -0
  33. package/dist/tests/scenario/migrated/measure-ingestion-pipeline.test.d.ts +1 -0
  34. package/dist/tests/scenario/migrated/measure-provisionning.test.d.ts +1 -0
  35. package/dist/tests/scenario/migrated/measure-roles.test.d.ts +1 -0
  36. package/dist/tests/scenario/migrated/model-controller.test.d.ts +1 -0
  37. package/dist/tests/scenario/modules/assets/action-get-measures.test.d.ts +1 -0
  38. package/dist/tests/scenario/modules/assets/asset-history.test.d.ts +1 -0
  39. package/dist/tests/scenario/modules/devices/action-attach-engine.test.d.ts +1 -0
  40. package/dist/tests/scenario/modules/devices/action-link-asset.test.d.ts +1 -0
  41. package/dist/tests/scenario/modules/devices/action-receive-measure.test.d.ts +1 -0
  42. package/dist/tests/scenario/modules/devices/action-scrud.test.d.ts +1 -0
  43. package/dist/tests/scenario/modules/ingestion-pipeline/before-ingestion.test.d.ts +1 -0
  44. package/dist/tests/scenario/modules/ingestion-pipeline/propagation.test.d.ts +1 -0
  45. package/dist/tests/scenario/usecase/dynamicaly-register-device-model.test.d.ts +1 -0
  46. package/package.json +1 -1
  47. /package/dist/{features/fixtures → tests}/application/app.d.ts +0 -0
  48. /package/dist/{features/fixtures → tests}/application/decoders/index.d.ts +0 -0
  49. /package/dist/{features/fixtures → tests}/application/tests/controller.d.ts +0 -0
  50. /package/dist/{features/fixtures → tests}/application/tests/pipes.d.ts +0 -0
@@ -17,6 +17,7 @@ import { KuzzleRole } from "../../shared/types/KuzzleRole";
17
17
  listAssets: true,
18
18
  getAsset: true,
19
19
  writeAsset: true,
20
+ listMeasures: true,
20
21
  },
21
22
  },
22
23
  */
@@ -15,6 +15,7 @@ import { KuzzleRole } from "../../shared/types/KuzzleRole";
15
15
  "device-manager/models": {
16
16
  actions: {
17
17
  listAssets: true,
18
+ listMeasures: true,
18
19
  getAsset: true,
19
20
  },
20
21
  },
@@ -4,8 +4,11 @@ import { DecodedPayload } from "./DecodedPayload";
4
4
  import { DecoderContent } from "./types/DecoderContent";
5
5
  /**
6
6
  * Array of measures declaration
7
+ *
8
+ * This need to be read only so we can provide strong typing when decoding measures
9
+ * with the DecodedPayload
7
10
  */
8
- export type NamedMeasures = ReadonlyArray<{
11
+ export type NamedMeasures = Array<{
9
12
  name: string;
10
13
  type: string;
11
14
  }>;
@@ -34,7 +37,7 @@ export declare abstract class Decoder {
34
37
  * { type: 'temperature', name: 'temperatureExterior' },
35
38
  * ];
36
39
  */
37
- measures: NamedMeasures;
40
+ measures: ReadonlyArray<NamedMeasures[0]>;
38
41
  /**
39
42
  * Custom name for the associated API action in the "payload" controller
40
43
  */
@@ -14,6 +14,7 @@ import { KuzzleRole } from "../../shared/types/KuzzleRole";
14
14
  search: true,
15
15
  unlinkAsset: true,
16
16
  update: true,
17
+ getMeasures: true,
17
18
  },
18
19
  },
19
20
  "device-manager/models": {
@@ -22,6 +23,7 @@ import { KuzzleRole } from "../../shared/types/KuzzleRole";
22
23
  listDevices: true,
23
24
  getDevice: true,
24
25
  writeDevice: true,
26
+ listMeasures: true,
25
27
  },
26
28
  },
27
29
  */
@@ -9,12 +9,14 @@ import { KuzzleRole } from "../../shared/types/KuzzleRole";
9
9
  actions: {
10
10
  get: true,
11
11
  search: true,
12
+ getMeasures: true,
12
13
  },
13
14
  },
14
15
  "device-manager/models": {
15
16
  actions: {
16
17
  listDevices: true,
17
18
  getDevice: true,
19
+ listMeasures: true,
18
20
  },
19
21
  },
20
22
  }
@@ -1,4 +1,4 @@
1
- import { Metadata, AssetContent, TemperatureMeasurement, PositionMeasurement, AssetModelDefinition } from "../../../../index";
1
+ import { Metadata, AssetContent, TemperatureMeasurement, PositionMeasurement, AssetModelDefinition } from "../../../index";
2
2
  export interface ContainerMetadata extends Metadata {
3
3
  height: number;
4
4
  width: number;
@@ -1,2 +1,2 @@
1
- import { AssetModelDefinition } from "../../../../index";
1
+ import { AssetModelDefinition } from "../../../index";
2
2
  export declare const warehouseAssetDefinition: AssetModelDefinition;
@@ -1,9 +1,12 @@
1
1
  import { JSONObject } from "kuzzle-sdk";
2
- import { Decoder, DecodedPayload } from "../../../../index";
2
+ import { Decoder, DecodedPayload } from "../../../index";
3
3
  export declare class DummyTempDecoder extends Decoder {
4
4
  measures: readonly [{
5
5
  readonly name: "temperature";
6
6
  readonly type: "temperature";
7
+ }, {
8
+ readonly name: "battery";
9
+ readonly type: "battery";
7
10
  }];
8
11
  constructor();
9
12
  validate(payload: JSONObject): Promise<boolean>;
@@ -1,5 +1,5 @@
1
1
  import { JSONObject } from "kuzzle-sdk";
2
- import { Decoder, DecodedPayload } from "../../../../index";
2
+ import { Decoder, DecodedPayload } from "../../../index";
3
3
  export declare class DummyTempPositionDecoder extends Decoder {
4
4
  measures: readonly [{
5
5
  readonly name: "temperature";
@@ -0,0 +1,42 @@
1
+ declare const _default: {
2
+ "device-manager": {
3
+ devices: ({
4
+ model: string;
5
+ reference: string;
6
+ metadata: {};
7
+ measures: {};
8
+ } | {
9
+ index: {
10
+ _id: string;
11
+ };
12
+ })[];
13
+ };
14
+ "engine-ayse": {
15
+ devices: ({
16
+ model: string;
17
+ reference: string;
18
+ metadata: {};
19
+ measures: {};
20
+ engineId: string;
21
+ assetId: any;
22
+ } | {
23
+ index: {
24
+ _id: string;
25
+ };
26
+ })[];
27
+ assets: ({
28
+ model: string;
29
+ reference: string;
30
+ metadata: {
31
+ weight: number;
32
+ height: number;
33
+ };
34
+ linkedDevices: any[];
35
+ } | {
36
+ index: {
37
+ _id: string;
38
+ };
39
+ })[];
40
+ };
41
+ };
42
+ export default _default;
@@ -0,0 +1,5 @@
1
+ import { JSONObject, Kuzzle } from "kuzzle-sdk";
2
+ /**
3
+ * Returns directly the document content
4
+ */
5
+ export declare function documentGet<TContent = JSONObject>(sdk: Kuzzle, index: string, collection: string, id: string): Promise<TContent>;
@@ -0,0 +1,4 @@
1
+ export * from "./sdk";
2
+ export * from "./payloads";
3
+ export * from "./document";
4
+ export * from "./setup";
@@ -0,0 +1,18 @@
1
+ import { JSONObject, Kuzzle } from "kuzzle-sdk";
2
+ export type DummyTempPayload = {
3
+ deviceEUI: string;
4
+ temperature: number;
5
+ measuredAt?: number;
6
+ battery?: number;
7
+ metadata?: JSONObject;
8
+ };
9
+ export type DummyTempPositionPayload = DummyTempPayload & {
10
+ location: {
11
+ lat: number;
12
+ lon: number;
13
+ accuracy?: number;
14
+ };
15
+ };
16
+ export declare function sendDummyTempPayloads(sdk: Kuzzle, payloads: DummyTempPayload[]): Promise<void>;
17
+ export declare function sendDummyTempPositionPayloads(sdk: Kuzzle, payloads: DummyTempPositionPayload[]): Promise<void>;
18
+ export declare function sendPayloads(sdk: Kuzzle, action: string, payloads: JSONObject[]): Promise<any>;
@@ -0,0 +1,2 @@
1
+ import { Kuzzle } from "kuzzle-sdk";
2
+ export declare function useSdk(): Kuzzle;
@@ -0,0 +1 @@
1
+ export declare function setupHooks(): import("kuzzle-sdk").Kuzzle;
@@ -0,0 +1,3 @@
1
+ import { Kuzzle } from "kuzzle-sdk";
2
+ export declare function truncateCollection(sdk: Kuzzle, index: string, collection: string): Promise<void>;
3
+ export declare function beforeEachTruncateCollections(sdk: Kuzzle): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Kuzzle } from "kuzzle-sdk";
2
+ export declare function beforeAllCreateEngines(sdk: Kuzzle): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import { Kuzzle } from "kuzzle-sdk";
2
+ export declare function beforeEachLoadFixtures(sdk: Kuzzle): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-device-manager-types",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Shared types for Kuzzle Device Manager",
5
5
  "author": "The Kuzzle Team (support@kuzzle.io)",
6
6
  "types": "dist/index.d.ts",