kuzzle-device-manager-types 2.0.4 → 2.0.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.
|
@@ -2,7 +2,7 @@ import { JSONObject, KDocument, KHit, Plugin, SearchResult, User } from "kuzzle"
|
|
|
2
2
|
import { AssetContent } from "./../asset";
|
|
3
3
|
import { Metadata } from "../shared";
|
|
4
4
|
import { DeviceContent } from "./types/DeviceContent";
|
|
5
|
-
import { ApiDeviceLinkAssetRequest } from "./
|
|
5
|
+
import { ApiDeviceLinkAssetRequest, ApiDeviceGetMeasuresResult } from "./types/DeviceApi";
|
|
6
6
|
export declare class DeviceService {
|
|
7
7
|
private config;
|
|
8
8
|
private context;
|
|
@@ -80,6 +80,15 @@ export declare class DeviceService {
|
|
|
80
80
|
asset: KDocument<AssetContent>;
|
|
81
81
|
device: KDocument<DeviceContent>;
|
|
82
82
|
}>;
|
|
83
|
+
getMeasureHistory(engineId: string, deviceId: string, { size, from, endAt, startAt, query, sort, type, }: {
|
|
84
|
+
sort?: JSONObject;
|
|
85
|
+
query?: JSONObject;
|
|
86
|
+
from?: number;
|
|
87
|
+
size?: number;
|
|
88
|
+
startAt?: string;
|
|
89
|
+
endAt?: string;
|
|
90
|
+
type?: string;
|
|
91
|
+
}): Promise<ApiDeviceGetMeasuresResult>;
|
|
83
92
|
private checkEngineExists;
|
|
84
93
|
private checkAttachedToEngine;
|
|
85
94
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ControllerDefinition, KuzzleRequest } from "kuzzle";
|
|
2
2
|
import { DeviceService } from "./DeviceService";
|
|
3
|
-
import { ApiDeviceAttachEngineResult, ApiDeviceCreateResult, ApiDeviceDeleteResult, ApiDeviceDetachEngineResult, ApiDeviceGetResult, ApiDeviceLinkAssetResult, ApiDeviceSearchResult, ApiDeviceUnlinkAssetResult, ApiDeviceUpdateResult } from "./types/DeviceApi";
|
|
3
|
+
import { ApiDeviceAttachEngineResult, ApiDeviceCreateResult, ApiDeviceDeleteResult, ApiDeviceDetachEngineResult, ApiDeviceGetResult, ApiDeviceLinkAssetResult, ApiDeviceSearchResult, ApiDeviceUnlinkAssetResult, ApiDeviceUpdateResult, ApiDeviceGetMeasuresResult } from "./types/DeviceApi";
|
|
4
4
|
export declare class DevicesController {
|
|
5
5
|
definition: ControllerDefinition;
|
|
6
6
|
private deviceService;
|
|
@@ -29,4 +29,5 @@ export declare class DevicesController {
|
|
|
29
29
|
* Unlink a device from an asset.
|
|
30
30
|
*/
|
|
31
31
|
unlinkAsset(request: KuzzleRequest): Promise<ApiDeviceUnlinkAssetResult>;
|
|
32
|
+
getMeasures(request: KuzzleRequest): Promise<ApiDeviceGetMeasuresResult>;
|
|
32
33
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle";
|
|
2
|
+
import { MeasureContent } from "../../measure";
|
|
2
3
|
import { AssetContent } from "../../asset";
|
|
3
4
|
import { Metadata } from "../../shared";
|
|
4
5
|
import { DeviceContent } from "./DeviceContent";
|
|
@@ -94,4 +95,21 @@ export type ApiDeviceLinkAssetResult = {
|
|
|
94
95
|
asset: KDocument<AssetContent>;
|
|
95
96
|
device: KDocument<DeviceContent>;
|
|
96
97
|
};
|
|
98
|
+
export interface ApiDeviceGetMeasuresRequest extends DevicesControllerRequest {
|
|
99
|
+
action: "getMeasures";
|
|
100
|
+
_id: string;
|
|
101
|
+
size?: number;
|
|
102
|
+
from?: number;
|
|
103
|
+
startAt?: string;
|
|
104
|
+
endAt?: string;
|
|
105
|
+
type?: string;
|
|
106
|
+
body?: {
|
|
107
|
+
query?: JSONObject;
|
|
108
|
+
sort?: JSONObject;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export type ApiDeviceGetMeasuresResult = {
|
|
112
|
+
measures: Array<KDocument<MeasureContent<JSONObject>>>;
|
|
113
|
+
total: number;
|
|
114
|
+
};
|
|
97
115
|
export {};
|