kuzzle-device-manager-types 2.1.2 → 2.1.4

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 (49) hide show
  1. package/dist/lib/modules/decoder/Decoder.d.ts +3 -0
  2. package/dist/lib/modules/measure/collections/getEmbeddedMeasureMappings.d.ts +2 -0
  3. package/dist/lib/modules/measure/index.d.ts +1 -0
  4. package/dist/lib/modules/shared/types/EmbeddedMeasure.d.ts +4 -0
  5. package/dist/{features/fixtures → tests}/application/assets/Container.d.ts +1 -1
  6. package/dist/{features/fixtures → tests}/application/assets/Warehouse.d.ts +1 -1
  7. package/dist/{features/fixtures → tests}/application/decoders/DummyTempDecoder.d.ts +4 -1
  8. package/dist/{features/fixtures → tests}/application/decoders/DummyTempPositionDecoder.d.ts +1 -1
  9. package/dist/tests/fixtures/fixtures.d.ts +42 -0
  10. package/dist/tests/helpers/document.d.ts +5 -0
  11. package/dist/tests/helpers/index.d.ts +4 -0
  12. package/dist/tests/helpers/payloads.d.ts +18 -0
  13. package/dist/tests/helpers/sdk.d.ts +2 -0
  14. package/dist/tests/helpers/setup.d.ts +1 -0
  15. package/dist/tests/hooks/collections.d.ts +3 -0
  16. package/dist/tests/hooks/engines.d.ts +2 -0
  17. package/dist/tests/hooks/fixtures.d.ts +2 -0
  18. package/dist/tests/scenario/migrated/asset-controller.test.d.ts +1 -0
  19. package/dist/tests/scenario/migrated/asset-history.test.d.ts +1 -0
  20. package/dist/tests/scenario/migrated/asset-roles.test.d.ts +1 -0
  21. package/dist/tests/scenario/migrated/decoder-decoders-controller.test.d.ts +1 -0
  22. package/dist/tests/scenario/migrated/decoder-default-rights.test.d.ts +1 -0
  23. package/dist/tests/scenario/migrated/decoder-payload-controller.test.d.ts +1 -0
  24. package/dist/tests/scenario/migrated/decoder-payloads-mappings.test.d.ts +1 -0
  25. package/dist/tests/scenario/migrated/decoder-roles.test.d.ts +1 -0
  26. package/dist/tests/scenario/migrated/device-controller-attach-engine.test.d.ts +1 -0
  27. package/dist/tests/scenario/migrated/device-controller-detach-engine.test.d.ts +1 -0
  28. package/dist/tests/scenario/migrated/device-controller-get-measures.test.d.ts +1 -0
  29. package/dist/tests/scenario/migrated/device-controller-unlink-asset.test.d.ts +1 -0
  30. package/dist/tests/scenario/migrated/device-metadata.test.d.ts +1 -0
  31. package/dist/tests/scenario/migrated/device-roles.test.d.ts +1 -0
  32. package/dist/tests/scenario/migrated/measure-ingestion-pipeline.test.d.ts +1 -0
  33. package/dist/tests/scenario/migrated/measure-provisionning.test.d.ts +1 -0
  34. package/dist/tests/scenario/migrated/measure-roles.test.d.ts +1 -0
  35. package/dist/tests/scenario/migrated/model-controller.test.d.ts +1 -0
  36. package/dist/tests/scenario/modules/assets/action-get-measures.test.d.ts +1 -0
  37. package/dist/tests/scenario/modules/assets/asset-history.test.d.ts +1 -0
  38. package/dist/tests/scenario/modules/devices/action-attach-engine.test.d.ts +1 -0
  39. package/dist/tests/scenario/modules/devices/action-link-asset.test.d.ts +1 -0
  40. package/dist/tests/scenario/modules/devices/action-receive-measure.test.d.ts +1 -0
  41. package/dist/tests/scenario/modules/devices/action-scrud.test.d.ts +1 -0
  42. package/dist/tests/scenario/modules/ingestion-pipeline/before-ingestion.test.d.ts +1 -0
  43. package/dist/tests/scenario/modules/ingestion-pipeline/propagation.test.d.ts +1 -0
  44. package/dist/tests/scenario/usecase/dynamicaly-register-device-model.test.d.ts +1 -0
  45. package/package.json +1 -1
  46. /package/dist/{features/fixtures → tests}/application/app.d.ts +0 -0
  47. /package/dist/{features/fixtures → tests}/application/decoders/index.d.ts +0 -0
  48. /package/dist/{features/fixtures → tests}/application/tests/controller.d.ts +0 -0
  49. /package/dist/{features/fixtures → tests}/application/tests/pipes.d.ts +0 -0
@@ -4,6 +4,9 @@ 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
11
  export type NamedMeasures = ReadonlyArray<{
9
12
  name: string;
@@ -0,0 +1,2 @@
1
+ import { JSONObject } from "kuzzle-sdk";
2
+ export declare const getEmbeddedMeasureMappings: (values: JSONObject) => JSONObject;
@@ -6,3 +6,4 @@ export * from "./measures";
6
6
  export * from "./MeasureModule";
7
7
  export * from "./roles/RoleMeasuresAdmin";
8
8
  export * from "./roles/RoleMeasuresReader";
9
+ export * from "./collections/getEmbeddedMeasureMappings";
@@ -21,4 +21,8 @@ export type EmbeddedMeasure<TMeasureValue extends JSONObject = JSONObject> = {
21
21
  * Name of the measure for the digital twin
22
22
  */
23
23
  name: string;
24
+ /**
25
+ * Origin ID of the measure (deviceId in most cases)
26
+ */
27
+ originId: string;
24
28
  };
@@ -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 { Kuzzle } from "kuzzle-sdk";
2
+ /**
3
+ * Returns directly the document content
4
+ */
5
+ export declare function documentGet(sdk: Kuzzle, index: string, collection: string, id: string): Promise<import("kuzzle-sdk").KDocumentContentGeneric>;
@@ -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.2",
3
+ "version": "2.1.4",
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",