kuzzle-device-manager-types 2.5.0-dev.1 → 2.5.0-dev.3

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 (35) hide show
  1. package/dist/lib/modules/asset/types/AssetApi.d.ts +5 -1
  2. package/dist/lib/modules/asset/types/AssetContent.d.ts +6 -1
  3. package/dist/lib/modules/decoder/types/DecoderApi.d.ts +0 -1
  4. package/dist/lib/modules/device/types/DeviceApi.d.ts +0 -1
  5. package/dist/lib/modules/measure/collections/measuresMappings.d.ts +8 -0
  6. package/dist/lib/modules/shared/errors/index.d.ts +1 -0
  7. package/dist/lib/modules/shared/exports.d.ts +1 -5
  8. package/dist/lib/modules/shared/index.d.ts +3 -11
  9. package/dist/lib/modules/shared/types/Models.d.ts +17 -0
  10. package/dist/lib/modules/shared/types/exports.d.ts +6 -0
  11. package/dist/lib/modules/shared/types/index.d.ts +9 -0
  12. package/dist/lib/modules/shared/utils/index.d.ts +5 -0
  13. package/dist/tests/application/assets/Container.d.ts +5 -3
  14. package/dist/tests/application/assets/MagicHouse.d.ts +2 -2
  15. package/dist/tests/application/assets/Room.d.ts +2 -2
  16. package/dist/tests/application/assets/StreetLamp.d.ts +2 -2
  17. package/dist/tests/application/assets/Warehouse.d.ts +2 -2
  18. package/dist/tests/application/assets/index.d.ts +5 -0
  19. package/dist/tests/application/devices/DummyTemp.d.ts +2 -0
  20. package/dist/tests/application/devices/DummyTempPosition.d.ts +2 -0
  21. package/dist/tests/application/devices/index.d.ts +2 -0
  22. package/dist/tests/application/measures/{AccelerationMeasure.d.ts → Acceleration.d.ts} +2 -2
  23. package/dist/tests/application/measures/Brightness.d.ts +2 -0
  24. package/dist/tests/application/measures/CO2.d.ts +2 -0
  25. package/dist/tests/application/measures/Illuminance.d.ts +2 -0
  26. package/dist/tests/application/measures/Magicule.d.ts +2 -2
  27. package/dist/tests/application/measures/PowerConsumption.d.ts +2 -0
  28. package/dist/tests/application/measures/index.d.ts +6 -0
  29. package/dist/tests/application/models.d.ts +2 -0
  30. package/package.json +1 -1
  31. package/dist/tests/application/decoders/index.d.ts +0 -2
  32. package/dist/tests/application/measures/BrightnessMeasure.d.ts +0 -2
  33. package/dist/tests/application/measures/CO2Measure.d.ts +0 -2
  34. package/dist/tests/application/measures/IlluminanceMeasure.d.ts +0 -2
  35. package/dist/tests/application/measures/PowerConsumptionMeasure.d.ts +0 -2
@@ -7,6 +7,11 @@ import { ApiMeasureSource } from "../../measure/types/MeasureSources";
7
7
  interface AssetsControllerRequest {
8
8
  controller: AssetsControllerName;
9
9
  engineId: string;
10
+ /**
11
+ * ? Request parameter used by SoftTenant module
12
+ * ! Not used directly in this plugin
13
+ */
14
+ softTenantId?: string | string[] | null;
10
15
  }
11
16
  export interface ApiAssetGetRequest extends AssetsControllerRequest {
12
17
  action: "get";
@@ -33,7 +38,6 @@ export interface ApiAssetMetadataReplaceRequest extends AssetsControllerRequest
33
38
  export type ApiAssetMetadataReplaceResult = KDocument<AssetContent>;
34
39
  export interface ApiAssetUpsertRequest extends AssetsControllerRequest {
35
40
  action: "upsert";
36
- _id: string;
37
41
  refresh?: string;
38
42
  body: {
39
43
  model: string;
@@ -36,6 +36,11 @@ export interface AssetContent<TMeasures extends JSONObject = any, TMetadata exte
36
36
  id: string;
37
37
  date: number;
38
38
  }>;
39
+ /**
40
+ * Id's of soft tenants
41
+ * ! Not used directly in this plugin
42
+ */
43
+ softTenant?: Array<string>;
39
44
  }
40
45
  /**
41
46
  * Asset description used to contextualize each measure data point
@@ -49,4 +54,4 @@ export type AssetMeasureContext<TMetadata extends Metadata = Metadata> = {
49
54
  * Name of the measure for the Asset
50
55
  */
51
56
  measureName: string;
52
- } & Pick<AssetContent<JSONObject, TMetadata>, "model" | "reference" | "metadata" | "groups">;
57
+ } & Pick<AssetContent<JSONObject, TMetadata>, "model" | "reference" | "metadata" | "groups" | "softTenant">;
@@ -4,7 +4,6 @@ interface DecodersControllerRequest {
4
4
  }
5
5
  export interface ApiDecoderListRequest extends DecodersControllerRequest {
6
6
  action: "list";
7
- _id: string;
8
7
  }
9
8
  export type ApiDecoderListResult = {
10
9
  decoders: DecoderContent[];
@@ -25,7 +25,6 @@ export type ApiDeviceUpdateResult = KDocument<DeviceContent>;
25
25
  export type ApiDeviceMetadataReplaceResult = KDocument<DeviceContent>;
26
26
  export interface ApiDeviceUpsertRequest extends DevicesControllerRequest {
27
27
  action: "upsert";
28
- _id: string;
29
28
  refresh?: string;
30
29
  body: {
31
30
  model: string;
@@ -50,6 +50,14 @@ export declare const measuresMappings: {
50
50
  };
51
51
  };
52
52
  };
53
+ softTenant: {
54
+ type: string;
55
+ fields: {
56
+ text: {
57
+ type: string;
58
+ };
59
+ };
60
+ };
53
61
  };
54
62
  };
55
63
  /**
@@ -0,0 +1 @@
1
+ export * from "./SchemaValidationError";
@@ -1,5 +1 @@
1
- export * from "./types/DigitalTwinContent";
2
- export * from "./types/DigitalTwinEvents";
3
- export * from "./types/DigitalTwinMeasures";
4
- export * from "./types/Metadata";
5
- export * from "./types/EmbeddedMeasure";
1
+ export * from "./types/exports";
@@ -1,13 +1,5 @@
1
1
  export * from "./Module";
2
+ export * from "./errors";
2
3
  export * from "./services";
3
- export * from "./types/DigitalTwinApi";
4
- export * from "./types/DigitalTwinContent";
5
- export * from "./types/DigitalTwinEvents";
6
- export * from "./types/DigitalTwinMeasures";
7
- export * from "./types/EmbeddedMeasure";
8
- export * from "./types/KuzzleRole";
9
- export * from "./types/Metadata";
10
- export * from "./utils/flattenObject";
11
- export * from "./utils/keepStack";
12
- export * from "./utils/lock";
13
- export * from "./utils/objectDiff";
4
+ export * from "./types";
5
+ export * from "./utils";
@@ -0,0 +1,17 @@
1
+ import { MeasureDefinition } from "../../measure";
2
+ import { AssetModelDefinition, DeviceModelDefinition } from "../../model";
3
+ interface ModelDefinition<Definition> {
4
+ /**
5
+ * Name of model
6
+ */
7
+ modelName: string;
8
+ /**
9
+ * Model definition used by the plugin to create associated ressources
10
+ * and updates mappings.
11
+ */
12
+ definition: Definition;
13
+ }
14
+ export type AssetModel = ModelDefinition<AssetModelDefinition>;
15
+ export type DeviceModel = ModelDefinition<DeviceModelDefinition>;
16
+ export type MeasureModel = ModelDefinition<MeasureDefinition>;
17
+ export {};
@@ -0,0 +1,6 @@
1
+ export * from "./DigitalTwinContent";
2
+ export * from "./DigitalTwinEvents";
3
+ export * from "./DigitalTwinMeasures";
4
+ export * from "./EmbeddedMeasure";
5
+ export * from "./Metadata";
6
+ export * from "./Models";
@@ -0,0 +1,9 @@
1
+ export * from "./DigitalTwinApi";
2
+ export * from "./DigitalTwinContent";
3
+ export * from "./DigitalTwinEvents";
4
+ export * from "./DigitalTwinMeasures";
5
+ export * from "./EmbeddedMeasure";
6
+ export * from "./KuzzleRole";
7
+ export * from "./Metadata";
8
+ export * from "./Models";
9
+ export * from "./exports";
@@ -0,0 +1,5 @@
1
+ export * from "./AJValidator";
2
+ export * from "./flattenObject";
3
+ export * from "./keepStack";
4
+ export * from "./lock";
5
+ export * from "./objectDiff";
@@ -1,4 +1,5 @@
1
- import { Metadata, AssetContent, TemperatureMeasurement, PositionMeasurement, AssetModelDefinition } from "../../../index";
1
+ import { Metadata, AssetContent, TemperatureMeasurement, PositionMeasurement, AssetModel } from "../../../index";
2
+ declare const modelName = "Container";
2
3
  export interface ContainerMetadata extends Metadata {
3
4
  height: number;
4
5
  width: number;
@@ -17,6 +18,7 @@ export type ContainerMeasurements = {
17
18
  temperatureWeather: TemperatureMeasurement;
18
19
  };
19
20
  export interface ContainerAssetContent extends AssetContent<ContainerMeasurements, ContainerMetadata> {
20
- model: "Container";
21
+ model: typeof modelName;
21
22
  }
22
- export declare const containerAssetDefinition: AssetModelDefinition;
23
+ export declare const Container: AssetModel;
24
+ export {};
@@ -1,2 +1,2 @@
1
- import { AssetModelDefinition } from "../../../index";
2
- export declare const magicHouseAssetDefinition: AssetModelDefinition;
1
+ import { AssetModel } from "../../../index";
2
+ export declare const MagicHouse: AssetModel;
@@ -1,2 +1,2 @@
1
- import { AssetModelDefinition } from "../../../index";
2
- export declare const roomAssetDefinition: AssetModelDefinition;
1
+ import { AssetModel } from "../../../index";
2
+ export declare const Room: AssetModel;
@@ -1,2 +1,2 @@
1
- import { AssetModelDefinition } from "../../../index";
2
- export declare const streetLampAssetDefinition: AssetModelDefinition;
1
+ import { AssetModel } from "../../../index";
2
+ export declare const StreetLamp: AssetModel;
@@ -1,2 +1,2 @@
1
- import { AssetModelDefinition } from "../../../index";
2
- export declare const warehouseAssetDefinition: AssetModelDefinition;
1
+ import { AssetModel } from "../../../index";
2
+ export declare const Warehouse: AssetModel;
@@ -0,0 +1,5 @@
1
+ export * from "./Container";
2
+ export * from "./MagicHouse";
3
+ export * from "./Room";
4
+ export * from "./StreetLamp";
5
+ export * from "./Warehouse";
@@ -0,0 +1,2 @@
1
+ import { DeviceModel } from "../../../index";
2
+ export declare const DummyTemp: DeviceModel;
@@ -0,0 +1,2 @@
1
+ import { DeviceModel } from "../../../index";
2
+ export declare const DummyTempPosition: DeviceModel;
@@ -0,0 +1,2 @@
1
+ export * from "./DummyTemp";
2
+ export * from "./DummyTempPosition";
@@ -1,4 +1,4 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
1
+ import { MeasureModel } from "../../../index";
2
2
  export type AccelerationMeasurement = {
3
3
  acceleration: {
4
4
  x: number;
@@ -7,4 +7,4 @@ export type AccelerationMeasurement = {
7
7
  };
8
8
  accuracy: number;
9
9
  };
10
- export declare const accelerationMeasureDefinition: MeasureDefinition;
10
+ export declare const Acceleration: MeasureModel;
@@ -0,0 +1,2 @@
1
+ import { MeasureModel } from "../../../index";
2
+ export declare const Brightness: MeasureModel;
@@ -0,0 +1,2 @@
1
+ import { MeasureModel } from "../../../index";
2
+ export declare const CO2: MeasureModel;
@@ -0,0 +1,2 @@
1
+ import { MeasureModel } from "../../../index";
2
+ export declare const Illuminance: MeasureModel;
@@ -1,5 +1,5 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
1
+ import { MeasureModel } from "../../../index";
2
2
  export type MagiculeMeasurement = {
3
3
  magicule: number;
4
4
  };
5
- export declare const magiculeMeasureDefinition: MeasureDefinition;
5
+ export declare const Magicule: MeasureModel;
@@ -0,0 +1,2 @@
1
+ import { MeasureModel } from "../../../index";
2
+ export declare const PowerConsumption: MeasureModel;
@@ -0,0 +1,6 @@
1
+ export * from "./Acceleration";
2
+ export * from "./Brightness";
3
+ export * from "./CO2";
4
+ export * from "./Illuminance";
5
+ export * from "./Magicule";
6
+ export * from "./PowerConsumption";
@@ -0,0 +1,2 @@
1
+ import { DeviceManagerPlugin } from "../../index";
2
+ export declare function registerModels(deviceManager: DeviceManagerPlugin): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-device-manager-types",
3
- "version": "2.5.0-dev.1",
3
+ "version": "2.5.0-dev.3",
4
4
  "description": "Shared types for Kuzzle Device Manager",
5
5
  "author": "The Kuzzle Team (support@kuzzle.io)",
6
6
  "main": "index.js",
@@ -1,2 +0,0 @@
1
- export * from "./DummyTempDecoder";
2
- export * from "./DummyTempPositionDecoder";
@@ -1,2 +0,0 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
2
- export declare const brightnessMeasureDefinition: MeasureDefinition;
@@ -1,2 +0,0 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
2
- export declare const co2MeasureDefinition: MeasureDefinition;
@@ -1,2 +0,0 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
2
- export declare const illuminanceMeasureDefinition: MeasureDefinition;
@@ -1,2 +0,0 @@
1
- import { MeasureDefinition } from "lib/modules/measure";
2
- export declare const powerConsumptionMeasureDefinition: MeasureDefinition;