kuzzle-device-manager-types 2.5.0-dev.1 → 2.5.0-next.1
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.
- package/dist/lib/modules/device/DeviceService.d.ts +1 -0
- package/dist/lib/modules/device/types/DeviceEvents.d.ts +8 -0
- package/dist/lib/modules/shared/services/AbstractExporter.d.ts +3 -1
- package/dist/lib/modules/shared/services/DigitalTwinExporter.d.ts +6 -1
- package/dist/lib/modules/shared/types/DigitalTwinContent.d.ts +2 -0
- package/dist/tests/application/assets/index.d.ts +4 -0
- package/dist/tests/application/decoders/DummyTempDecoder.d.ts +10 -0
- package/dist/tests/application/decoders/DummyTempPositionDecoder.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { User } from "kuzzle";
|
|
2
2
|
import { KDocument } from "kuzzle-sdk";
|
|
3
|
+
import { DeviceModelContent } from "../../../modules/model";
|
|
3
4
|
import { Metadata } from "../../../modules/shared";
|
|
4
5
|
import { DeviceContent } from "./DeviceContent";
|
|
5
6
|
import { ApiDeviceLinkAssetRequest } from "./DeviceApi";
|
|
@@ -56,3 +57,10 @@ export type AskDeviceAttachEngine = {
|
|
|
56
57
|
};
|
|
57
58
|
result: void;
|
|
58
59
|
};
|
|
60
|
+
export type AskDeviceRefreshModel = {
|
|
61
|
+
name: "ask:device-manager:device:refresh-model";
|
|
62
|
+
payload: {
|
|
63
|
+
deviceModel: DeviceModelContent;
|
|
64
|
+
};
|
|
65
|
+
result: void;
|
|
66
|
+
};
|
|
@@ -20,10 +20,12 @@ export interface Column {
|
|
|
20
20
|
isMeasure?: boolean;
|
|
21
21
|
isIsoDate?: boolean;
|
|
22
22
|
}
|
|
23
|
+
export type ExportStreamAugmenter = (result: SearchResult<KHit<KDocumentContentGeneric>>, columns: Column[], engineId: string) => Promise<void>;
|
|
23
24
|
export declare abstract class AbstractExporter<P extends ExportParams = ExportParams> {
|
|
24
25
|
protected plugin: DeviceManagerPlugin;
|
|
25
26
|
protected target: InternalCollection;
|
|
26
27
|
protected config: ExporterOption;
|
|
28
|
+
protected exportStreamAugmenters: ExportStreamAugmenter[];
|
|
27
29
|
constructor(plugin: DeviceManagerPlugin, target: InternalCollection, config?: Partial<ExporterOption>);
|
|
28
30
|
protected get sdk(): import("kuzzle").EmbeddedSDK;
|
|
29
31
|
protected get ms(): any;
|
|
@@ -48,5 +50,5 @@ export declare abstract class AbstractExporter<P extends ExportParams = ExportPa
|
|
|
48
50
|
prepareExport(engineId: string, user: User, params: P): Promise<string>;
|
|
49
51
|
protected formatHit(columns: Column[], hit: KHit<KDocumentContentGeneric>): string[];
|
|
50
52
|
getExport(engineId: string, exportId: string): Promise<P>;
|
|
51
|
-
getExportStream(request: SearchResult<KHit<KDocumentContentGeneric>>, columns: Column[]): Promise<PassThrough>;
|
|
53
|
+
getExportStream(request: SearchResult<KHit<KDocumentContentGeneric>>, columns: Column[], engineId: string): Promise<PassThrough>;
|
|
52
54
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { UUID } from "node:crypto";
|
|
2
|
-
import {
|
|
2
|
+
import { DeviceManagerPlugin, InternalCollection } from "../../plugin";
|
|
3
|
+
import { AbstractExporter, ExporterOption } from "./AbstractExporter";
|
|
3
4
|
export declare class DigitalTwinExporter extends AbstractExporter {
|
|
5
|
+
protected plugin: DeviceManagerPlugin;
|
|
6
|
+
protected target: InternalCollection;
|
|
7
|
+
constructor(plugin: DeviceManagerPlugin, target: InternalCollection, config?: Partial<ExporterOption>);
|
|
4
8
|
protected exportRedisKey(engineId: string, exportId: string): string;
|
|
5
9
|
protected getLink(engineId: string, exportId: UUID): string;
|
|
6
10
|
sendExport(engineId: string, exportId: string): Promise<import("stream").PassThrough>;
|
|
@@ -9,4 +13,5 @@ export declare class DigitalTwinExporter extends AbstractExporter {
|
|
|
9
13
|
*/
|
|
10
14
|
private getNamedMeasures;
|
|
11
15
|
private generateMeasureColumns;
|
|
16
|
+
private addMeasuresToExportStream;
|
|
12
17
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSONObject, KDocumentContent } from "kuzzle-sdk";
|
|
2
|
+
import { NamedMeasures } from "../../decoder";
|
|
2
3
|
import { Metadata } from "./Metadata";
|
|
3
4
|
import { DigitalTwinMeasures } from "./DigitalTwinMeasures";
|
|
4
5
|
export interface DigitalTwinContent<TMeasures extends JSONObject = JSONObject, TMetadata extends Metadata = Metadata> extends KDocumentContent {
|
|
@@ -7,4 +8,5 @@ export interface DigitalTwinContent<TMeasures extends JSONObject = JSONObject, T
|
|
|
7
8
|
metadata: TMetadata;
|
|
8
9
|
measures: DigitalTwinMeasures<TMeasures>;
|
|
9
10
|
lastMeasuredAt: number;
|
|
11
|
+
measureSlots: NamedMeasures;
|
|
10
12
|
}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { JSONObject } from "kuzzle-sdk";
|
|
2
2
|
import { Decoder, DecodedPayload } from "../../../index";
|
|
3
|
+
export declare const dummyTempDeviceMeasures: readonly [{
|
|
4
|
+
readonly name: "temperature";
|
|
5
|
+
readonly type: "temperature";
|
|
6
|
+
}, {
|
|
7
|
+
readonly name: "accelerationSensor";
|
|
8
|
+
readonly type: "acceleration";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "battery";
|
|
11
|
+
readonly type: "battery";
|
|
12
|
+
}];
|
|
3
13
|
export declare class DummyTempDecoder extends Decoder {
|
|
4
14
|
measures: readonly [{
|
|
5
15
|
readonly name: "temperature";
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { JSONObject } from "kuzzle-sdk";
|
|
2
2
|
import { Decoder, DecodedPayload } from "../../../index";
|
|
3
|
+
export declare const dummyTempPositionDeviceMeasures: readonly [{
|
|
4
|
+
readonly name: "temperature";
|
|
5
|
+
readonly type: "temperature";
|
|
6
|
+
}, {
|
|
7
|
+
readonly name: "battery";
|
|
8
|
+
readonly type: "battery";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "position";
|
|
11
|
+
readonly type: "position";
|
|
12
|
+
}];
|
|
3
13
|
export declare class DummyTempPositionDecoder extends Decoder {
|
|
4
14
|
measures: readonly [{
|
|
5
15
|
readonly name: "temperature";
|