kuzzle-device-manager-types 2.1.0 → 2.1.2

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 (37) hide show
  1. package/dist/features/fixtures/application/assets/Container.d.ts +2 -0
  2. package/dist/features/fixtures/application/decoders/DummyTempDecoder.d.ts +1 -1
  3. package/dist/features/fixtures/application/decoders/DummyTempPositionDecoder.d.ts +1 -1
  4. package/dist/lib/core/DeviceManagerConfiguration.d.ts +1 -1
  5. package/dist/lib/core/DeviceManagerPlugin.d.ts +2 -1
  6. package/dist/lib/core/registers/ModelsRegister.d.ts +1 -1
  7. package/dist/lib/modules/asset/AssetHistoryService.d.ts +1 -1
  8. package/dist/lib/modules/asset/AssetService.d.ts +2 -1
  9. package/dist/lib/modules/asset/model/AssetSerializer.d.ts +1 -1
  10. package/dist/lib/modules/asset/types/AssetApi.d.ts +2 -1
  11. package/dist/lib/modules/asset/types/AssetContent.d.ts +1 -1
  12. package/dist/lib/modules/asset/types/AssetEvents.d.ts +1 -1
  13. package/dist/lib/modules/asset/types/AssetHistoryContent.d.ts +1 -1
  14. package/dist/lib/modules/decoder/DecodedPayload.d.ts +1 -1
  15. package/dist/lib/modules/decoder/Decoder.d.ts +2 -1
  16. package/dist/lib/modules/decoder/PayloadService.d.ts +2 -1
  17. package/dist/lib/modules/decoder/types/PayloadApi.d.ts +1 -1
  18. package/dist/lib/modules/device/DeviceService.d.ts +2 -1
  19. package/dist/lib/modules/device/model/DeviceSerializer.d.ts +1 -1
  20. package/dist/lib/modules/device/types/DeviceApi.d.ts +1 -1
  21. package/dist/lib/modules/device/types/DeviceContent.d.ts +3 -3
  22. package/dist/lib/modules/device/types/DeviceEvents.d.ts +2 -1
  23. package/dist/lib/modules/measure/MeasureService.d.ts +0 -1
  24. package/dist/lib/modules/measure/types/MeasureContent.d.ts +5 -1
  25. package/dist/lib/modules/measure/types/MeasureDefinition.d.ts +1 -1
  26. package/dist/lib/modules/measure/types/MeasureEvents.d.ts +1 -1
  27. package/dist/lib/modules/model/ModelService.d.ts +1 -1
  28. package/dist/lib/modules/model/types/ModelApi.d.ts +1 -1
  29. package/dist/lib/modules/model/types/ModelContent.d.ts +1 -1
  30. package/dist/lib/modules/model/types/ModelDefinition.d.ts +1 -1
  31. package/dist/lib/modules/shared/index.d.ts +3 -1
  32. package/dist/lib/modules/shared/types/DigitalTwinContent.d.ts +1 -1
  33. package/dist/lib/modules/shared/types/EmbeddedMeasure.d.ts +1 -1
  34. package/dist/lib/modules/shared/utils/flattenObject.d.ts +1 -1
  35. package/dist/lib/modules/shared/utils/keepStack.d.ts +2 -0
  36. package/dist/lib/modules/shared/utils/objectDiff.d.ts +2 -0
  37. package/package.json +1 -1
@@ -9,7 +9,9 @@ export interface ContainerMetadata extends Metadata {
9
9
  }
10
10
  export type ContainerMeasurements = {
11
11
  temperatureExt: TemperatureMeasurement;
12
+ temperatureInt: TemperatureMeasurement;
12
13
  position: PositionMeasurement;
14
+ temperatureWeather: TemperatureMeasurement;
13
15
  };
14
16
  export interface ContainerAssetContent extends AssetContent<ContainerMeasurements, ContainerMetadata> {
15
17
  model: "Container";
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { Decoder, DecodedPayload } from "../../../../index";
3
3
  export declare class DummyTempDecoder extends Decoder {
4
4
  measures: readonly [{
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { Decoder, DecodedPayload } from "../../../../index";
3
3
  export declare class DummyTempPositionDecoder extends Decoder {
4
4
  measures: readonly [{
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  export type DeviceManagerConfiguration = {
3
3
  /**
4
4
  * Ignore errors at startup such as wrong mappings update.
@@ -1,4 +1,5 @@
1
- import { Plugin, PluginContext, JSONObject } from "kuzzle";
1
+ import { Plugin, PluginContext } from "kuzzle";
2
+ import { JSONObject } from "kuzzle-sdk";
2
3
  import { MeasureDefinition } from "../modules/measure";
3
4
  import { AssetModelDefinition, DeviceModelDefinition } from "../modules/model";
4
5
  import { DeviceManagerConfiguration } from "./DeviceManagerConfiguration";
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { NamedMeasures } from "../../modules/decoder";
3
3
  import { MeasureDefinition } from "../../modules/measure";
4
4
  import { DeviceManagerPlugin } from "../DeviceManagerPlugin";
@@ -1,4 +1,4 @@
1
- import { KDocument } from "kuzzle";
1
+ import { KDocument } from "kuzzle-sdk";
2
2
  import { DeviceManagerPlugin } from "../../core";
3
3
  import { AssetHistoryEvent } from "./types/AssetHistoryContent";
4
4
  import { AssetContent } from "./types/AssetContent";
@@ -1,4 +1,5 @@
1
- import { JSONObject, KDocument, KHit, SearchResult, User } from "kuzzle";
1
+ import { User } from "kuzzle";
2
+ import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle-sdk";
2
3
  import { Metadata } from "../shared";
3
4
  import { DeviceManagerPlugin } from "../../core";
4
5
  import { AssetContent } from "./types/AssetContent";
@@ -1,4 +1,4 @@
1
- import { KDocument } from "kuzzle";
1
+ import { KDocument } from "kuzzle-sdk";
2
2
  import { AssetContent, AssetMeasureContext } from "../types/AssetContent";
3
3
  export declare class AssetSerializer {
4
4
  static id(model: string, reference: string): string;
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle";
1
+ import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle-sdk";
2
2
  import { MeasureContent } from "../../../modules/measure";
3
3
  import { Metadata } from "../../shared";
4
4
  import { AssetContent } from "./AssetContent";
@@ -42,6 +42,7 @@ export interface ApiAssetSearchRequest extends AssetsControllerRequest {
42
42
  from?: number;
43
43
  size?: number;
44
44
  scrollTTL?: string;
45
+ lang?: "koncorde" | "elasticsearch";
45
46
  body: JSONObject;
46
47
  }
47
48
  export type ApiAssetSearchResult = SearchResult<KHit<AssetContent>>;
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { DigitalTwinContent, Metadata } from "../../shared";
3
3
  /**
4
4
  * Asset document content
@@ -1,4 +1,4 @@
1
- import { KDocument } from "kuzzle";
1
+ import { KDocument } from "kuzzle-sdk";
2
2
  import { Metadata } from "../../../modules/shared";
3
3
  import { AssetContent } from "./AssetContent";
4
4
  import { AssetHistoryEvent } from "./AssetHistoryContent";
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocumentContent } from "kuzzle";
1
+ import { JSONObject, KDocumentContent } from "kuzzle-sdk";
2
2
  import { Metadata } from "../../shared";
3
3
  import { AssetContent } from "./AssetContent";
4
4
  export type AssetHistoryEventMeasure = {
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { DecodedMeasurement } from "../measure";
3
3
  import { Decoder } from "./Decoder";
4
4
  /**
@@ -1,4 +1,5 @@
1
- import { HttpRoute, JSONObject, KuzzleRequest } from "kuzzle";
1
+ import { HttpRoute, KuzzleRequest } from "kuzzle";
2
+ import { JSONObject } from "kuzzle-sdk";
2
3
  import { DecodedPayload } from "./DecodedPayload";
3
4
  import { DecoderContent } from "./types/DecoderContent";
4
5
  /**
@@ -1,4 +1,5 @@
1
- import { JSONObject, KDocument, KuzzleRequest } from "kuzzle";
1
+ import { KuzzleRequest } from "kuzzle";
2
+ import { JSONObject, KDocument } from "kuzzle-sdk";
2
3
  import { DeviceManagerPlugin } from "../../core";
3
4
  import { DeviceContent } from "../device";
4
5
  import { DecodedMeasurement } from "../measure";
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  interface PayloadsControllerRequest {
3
3
  controller: "device-manager/payloads";
4
4
  }
@@ -1,4 +1,5 @@
1
- import { JSONObject, KDocument, KHit, Plugin, SearchResult, User } from "kuzzle";
1
+ import { Plugin, User } from "kuzzle";
2
+ import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle-sdk";
2
3
  import { AssetContent } from "./../asset";
3
4
  import { Metadata } from "../shared";
4
5
  import { DecodedMeasurement } from "../measure";
@@ -1,4 +1,4 @@
1
- import { KDocument } from "kuzzle";
1
+ import { KDocument } from "kuzzle-sdk";
2
2
  import { DeviceContent } from "../types/DeviceContent";
3
3
  export declare class DeviceSerializer {
4
4
  static id(model: string, reference: string): string;
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle";
1
+ import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle-sdk";
2
2
  import { DecodedMeasurement, MeasureContent } from "../../measure";
3
3
  import { AssetContent } from "../../asset";
4
4
  import { Metadata } from "../../shared";
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { DigitalTwinContent, Metadata } from "../../shared";
3
3
  /**
4
4
  * Device document content
@@ -7,8 +7,8 @@ export interface DeviceContent<TMeasures extends JSONObject = any, TMetadata ext
7
7
  /**
8
8
  * Linked asset unique identifier
9
9
  */
10
- assetId?: string;
10
+ assetId: string | null;
11
11
  /**
12
12
  */
13
- engineId?: string;
13
+ engineId: string;
14
14
  }
@@ -1,4 +1,5 @@
1
- import { KDocument, User } from "kuzzle";
1
+ import { User } from "kuzzle";
2
+ import { KDocument } from "kuzzle-sdk";
2
3
  import { Metadata } from "../../../modules/shared";
3
4
  import { DeviceContent } from "./DeviceContent";
4
5
  export type EventDeviceUpdateBefore = {
@@ -25,7 +25,6 @@ export declare class MeasureService {
25
25
  * - trigger events to trigger business rules
26
26
  */
27
27
  ingest(device: KDocument<DeviceContent>, measurements: DecodedMeasurement<JSONObject>[], metadata: Metadata, payloadUuids: string[]): Promise<void>;
28
- private compareMetadata;
29
28
  private updateDeviceMeasures;
30
29
  private updateAssetMeasures;
31
30
  /**
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocumentContent } from "kuzzle";
1
+ import { JSONObject, KDocumentContent } from "kuzzle-sdk";
2
2
  import { Metadata } from "../../../modules/shared";
3
3
  import { AssetMeasureContext } from "../../../modules/asset";
4
4
  export type MeasureOriginDevice = {
@@ -30,6 +30,10 @@ export type MeasureOriginDevice = {
30
30
  _id: string;
31
31
  };
32
32
  export type MeasureOriginComputed = {
33
+ /**
34
+ * Computed measures are not automatically added into the asset and device
35
+ * documents at the end of the ingestion pipeline.
36
+ */
33
37
  type: "computed";
34
38
  /**
35
39
  * String that identify the rule used to compute the measure
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  /**
3
3
  * Represents a measure definition registered by the Device Manager
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocument } from "kuzzle";
1
+ import { JSONObject, KDocument } from "kuzzle-sdk";
2
2
  import { DeviceContent } from "../../../modules/device";
3
3
  import { AssetContent } from "../../../modules/asset";
4
4
  import { Metadata } from "../../../modules/shared";
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocument } from "kuzzle";
1
+ import { JSONObject, KDocument } from "kuzzle-sdk";
2
2
  import { DeviceManagerPlugin } from "../../core";
3
3
  import { AssetModelContent, DeviceModelContent, MeasureModelContent } from "./types/ModelContent";
4
4
  export declare class ModelService {
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocument } from "kuzzle";
1
+ import { JSONObject, KDocument } from "kuzzle-sdk";
2
2
  import { AssetModelContent, DeviceModelContent, MeasureModelContent } from "./ModelContent";
3
3
  interface ModelsControllerRequest {
4
4
  controller: "device-manager/models";
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocumentContent } from "kuzzle";
1
+ import { JSONObject, KDocumentContent } from "kuzzle-sdk";
2
2
  import { NamedMeasures } from "../../../modules/decoder";
3
3
  import { MeasureDefinition } from "../../measure";
4
4
  export interface MeasureModelContent extends KDocumentContent {
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  import { Decoder, NamedMeasures } from "../../../modules/decoder";
3
3
  /**
4
4
  * Define an asset model
@@ -1,3 +1,4 @@
1
+ export * from "./Module";
1
2
  export * from "./types/DigitalTwinContent";
2
3
  export * from "./types/Metadata";
3
4
  export * from "./types/EmbeddedMeasure";
@@ -5,4 +6,5 @@ export * from "./types/KuzzleRole";
5
6
  export * from "./utils/lock";
6
7
  export * from "./utils/flattenObject";
7
8
  export * from "./utils/ask";
8
- export * from "./Module";
9
+ export * from "./utils/keepStack";
10
+ export * from "./utils/objectDiff";
@@ -1,4 +1,4 @@
1
- import { JSONObject, KDocumentContent } from "kuzzle";
1
+ import { JSONObject, KDocumentContent } from "kuzzle-sdk";
2
2
  import { EmbeddedMeasure } from "./EmbeddedMeasure";
3
3
  import { Metadata } from "./Metadata";
4
4
  export interface DigitalTwinContent<TMeasures extends JSONObject = JSONObject, TMetadata extends Metadata = Metadata> extends KDocumentContent {
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  export type EmbeddedMeasure<TMeasureValue extends JSONObject = JSONObject> = {
3
3
  /**
4
4
  * Payloads that created this measure.
@@ -1,4 +1,4 @@
1
- import { JSONObject } from "kuzzle";
1
+ import { JSONObject } from "kuzzle-sdk";
2
2
  /**
3
3
  * Flatten an object transform:
4
4
  *
@@ -0,0 +1,2 @@
1
+ import { KuzzleError } from "kuzzle";
2
+ export declare function keepStack(original: Error, error: KuzzleError): KuzzleError;
@@ -0,0 +1,2 @@
1
+ import { JSONObject } from "kuzzle-sdk";
2
+ export declare function objectDiff(base: JSONObject, object: JSONObject): string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-device-manager-types",
3
- "version": "2.1.0",
3
+ "version": "2.1.2",
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",