kuzzle-device-manager-types 2.0.0 → 2.0.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.
|
@@ -1 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
import { Metadata, AssetContent, TemperatureMeasurement, PositionMeasurement, AssetModelDefinition } from "../../../../index";
|
|
2
|
+
export interface ContainerMetadata extends Metadata {
|
|
3
|
+
height: number;
|
|
4
|
+
width: number;
|
|
5
|
+
trailer: {
|
|
6
|
+
weight: number;
|
|
7
|
+
capacity: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export type ContainerMeasurements = {
|
|
11
|
+
temperatureExt: TemperatureMeasurement;
|
|
12
|
+
position: PositionMeasurement;
|
|
13
|
+
};
|
|
14
|
+
export interface ContainerAssetContent extends AssetContent<ContainerMeasurements, ContainerMetadata> {
|
|
15
|
+
model: "Container";
|
|
16
|
+
}
|
|
17
|
+
export declare const containerAssetDefinition: AssetModelDefinition;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { JSONObject, KDocument, KHit, SearchResult, User } from "kuzzle";
|
|
2
|
-
import { MeasureContent } from "../measure/";
|
|
3
2
|
import { Metadata } from "../shared";
|
|
4
3
|
import { DeviceManagerPlugin } from "../../core";
|
|
5
4
|
import { AssetContent } from "./types/AssetContent";
|
|
6
5
|
import { AssetHistoryService } from "./AssetHistoryService";
|
|
6
|
+
import { ApiAssetGetMeasuresResult } from "./types/AssetApi";
|
|
7
7
|
export declare class AssetService {
|
|
8
8
|
private context;
|
|
9
9
|
private config;
|
|
@@ -21,11 +21,15 @@ export declare class AssetService {
|
|
|
21
21
|
* @param options.startAt Returns measures starting from this date (ISO8601)
|
|
22
22
|
* @param options.endAt Returns measures until this date (ISO8601)
|
|
23
23
|
*/
|
|
24
|
-
getMeasureHistory(engineId: string, assetId: string, { size,
|
|
24
|
+
getMeasureHistory(engineId: string, assetId: string, { size, from, endAt, startAt, query, sort, type, }: {
|
|
25
|
+
sort?: JSONObject;
|
|
26
|
+
query?: JSONObject;
|
|
27
|
+
from?: number;
|
|
25
28
|
size?: number;
|
|
26
29
|
startAt?: string;
|
|
27
30
|
endAt?: string;
|
|
28
|
-
|
|
31
|
+
type?: string;
|
|
32
|
+
}): Promise<ApiAssetGetMeasuresResult>;
|
|
29
33
|
get(engineId: string, assetId: string): Promise<KDocument<AssetContent>>;
|
|
30
34
|
/**
|
|
31
35
|
* Updates an asset metadata
|
|
@@ -49,10 +49,17 @@ export interface ApiAssetGetMeasuresRequest extends AssetsControllerRequest {
|
|
|
49
49
|
action: "getMeasures";
|
|
50
50
|
_id: string;
|
|
51
51
|
size?: number;
|
|
52
|
+
from?: number;
|
|
52
53
|
startAt?: string;
|
|
53
54
|
endAt?: string;
|
|
55
|
+
type?: string;
|
|
56
|
+
body?: {
|
|
57
|
+
query?: JSONObject;
|
|
58
|
+
sort?: JSONObject;
|
|
59
|
+
};
|
|
54
60
|
}
|
|
55
61
|
export type ApiAssetGetMeasuresResult = {
|
|
56
62
|
measures: Array<KDocument<MeasureContent<JSONObject>>>;
|
|
63
|
+
total: number;
|
|
57
64
|
};
|
|
58
65
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kuzzle-device-manager-types",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
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",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/kuzzleio/kuzzle-plugin-device-manager"
|
|
10
10
|
},
|
|
11
11
|
"scripts": {
|
|
12
|
+
"prepack": "npm run build",
|
|
12
13
|
"build": "npm --prefix ../ run build && cp -r ../dist/ . && node scripts/copy-version.js"
|
|
13
14
|
},
|
|
14
15
|
"license": "Apache-2.0",
|