kuzzle-device-manager-types 2.4.0-beta.8 → 2.4.0-dev.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/asset/AssetService.d.ts +18 -4
- package/dist/lib/modules/asset/AssetsController.d.ts +7 -1
- package/dist/lib/modules/asset/roles/RoleAssetsReader.d.ts +4 -0
- package/dist/lib/modules/asset/roles/specificRoles/RoleAssetsConfiguration.d.ts +8 -0
- package/dist/lib/modules/asset/roles/specificRoles/RoleAssetsCreation.d.ts +8 -0
- package/dist/lib/modules/asset/roles/specificRoles/index.d.ts +2 -0
- package/dist/lib/modules/asset/types/AssetApi.d.ts +31 -2
- package/dist/lib/modules/decoder/Decoder.d.ts +11 -0
- package/dist/lib/modules/decoder/PayloadService.d.ts +1 -1
- package/dist/lib/modules/decoder/types/DecoderContent.d.ts +1 -0
- package/dist/lib/modules/device/DeviceService.d.ts +14 -5
- package/dist/lib/modules/device/DevicesController.d.ts +7 -1
- package/dist/lib/modules/device/roles/RoleDevicesReader.d.ts +4 -0
- package/dist/lib/modules/device/roles/specificRoles/RoleDevicesAssetAssociation.d.ts +8 -0
- package/dist/lib/modules/device/roles/specificRoles/RoleDevicesConfiguration.d.ts +8 -0
- package/dist/lib/modules/device/roles/specificRoles/RoleDevicesCreation.d.ts +8 -0
- package/dist/lib/modules/device/roles/specificRoles/index.d.ts +3 -0
- package/dist/lib/modules/device/types/DeviceApi.d.ts +23 -2
- package/dist/lib/modules/measure/MeasureExporter.d.ts +5 -4
- package/dist/lib/modules/measure/collections/measuresMappings.d.ts +3 -0
- package/dist/lib/modules/measure/types/MeasureContent.d.ts +4 -0
- package/dist/lib/modules/measure/types/MeasureDefinition.d.ts +28 -3
- package/dist/lib/modules/model/MappingsConflictsError.d.ts +7 -0
- package/dist/lib/modules/model/ModelService.d.ts +16 -6
- package/dist/lib/modules/model/ModelsConflicts.d.ts +30 -0
- package/dist/lib/modules/model/ModelsController.d.ts +5 -1
- package/dist/lib/modules/model/ModelsRegister.d.ts +28 -3
- package/dist/lib/modules/model/types/ModelApi.d.ts +50 -4
- package/dist/lib/modules/model/types/ModelContent.d.ts +263 -2
- package/dist/lib/modules/model/types/ModelDefinition.d.ts +141 -5
- package/dist/lib/modules/plugin/DeviceManagerEngine.d.ts +141 -5
- package/dist/lib/modules/plugin/DeviceManagerPlugin.d.ts +113 -8
- package/dist/lib/modules/plugin/types/DeviceManagerConfiguration.d.ts +18 -4
- package/dist/lib/modules/shared/exports.d.ts +2 -0
- package/dist/lib/modules/shared/index.d.ts +6 -4
- package/dist/lib/modules/shared/services/AbstractExporter.d.ts +1 -2
- package/dist/lib/modules/shared/services/DigitalTwinExporter.d.ts +0 -2
- package/dist/lib/modules/shared/services/DigitalTwinService.d.ts +21 -0
- package/dist/lib/modules/shared/services/index.d.ts +1 -0
- package/dist/lib/modules/shared/types/DigitalTwinApi.d.ts +34 -0
- package/dist/lib/modules/shared/types/DigitalTwinContent.d.ts +2 -4
- package/dist/lib/modules/shared/types/DigitalTwinEvents.d.ts +9 -0
- package/dist/lib/modules/shared/types/DigitalTwinMeasures.d.ts +5 -0
- package/dist/tests/application/assets/Container.d.ts +3 -0
- package/dist/tests/application/assets/Room.d.ts +2 -0
- package/dist/tests/application/assets/StreetLamp.d.ts +2 -0
- package/dist/tests/application/decoders/DummyTempPositionDecoder.d.ts +1 -0
- package/dist/tests/application/measures/BrightnessMeasure.d.ts +2 -0
- package/dist/tests/application/measures/CO2Measure.d.ts +2 -0
- package/dist/tests/application/measures/IlluminanceMeasure.d.ts +2 -0
- package/dist/tests/application/measures/PowerConsumptionMeasure.d.ts +2 -0
- package/package.json +4 -3
- package/dist/lib/modules/shared/utils/ask.d.ts +0 -8
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { JSONObject, KDocument } from "kuzzle-sdk";
|
|
2
|
-
import { AssetModelContent, DeviceModelContent, MeasureModelContent } from "./ModelContent";
|
|
1
|
+
import { JSONObject, KDocument, KHit, SearchResult } from "kuzzle-sdk";
|
|
2
|
+
import { AssetModelContent, DeviceModelContent, MeasureModelContent, MetadataDetails, MetadataGroups, MetadataMappings, TooltipModels } from "./ModelContent";
|
|
3
|
+
import { MeasureValuesDetails } from "../../measure/types/MeasureDefinition";
|
|
3
4
|
interface ModelsControllerRequest {
|
|
4
5
|
controller: "device-manager/models";
|
|
5
6
|
}
|
|
@@ -24,9 +25,12 @@ export interface ApiModelWriteAssetRequest extends ModelsControllerRequest {
|
|
|
24
25
|
body: {
|
|
25
26
|
engineGroup: string;
|
|
26
27
|
model: string;
|
|
27
|
-
|
|
28
|
+
metadataDetails?: MetadataDetails;
|
|
29
|
+
metadataGroups?: MetadataGroups;
|
|
30
|
+
metadataMappings?: MetadataMappings;
|
|
28
31
|
defaultValues?: JSONObject;
|
|
29
32
|
measures?: AssetModelContent["asset"]["measures"];
|
|
33
|
+
tooltipModels?: TooltipModels;
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
36
|
export type ApiModelWriteAssetResult = KDocument<AssetModelContent>;
|
|
@@ -34,7 +38,9 @@ export interface ApiModelWriteDeviceRequest extends ModelsControllerRequest {
|
|
|
34
38
|
action: "writeDevice";
|
|
35
39
|
body: {
|
|
36
40
|
model: string;
|
|
37
|
-
|
|
41
|
+
metadataDetails?: MetadataDetails;
|
|
42
|
+
metadataGroups?: MetadataGroups;
|
|
43
|
+
metadataMappings?: MetadataMappings;
|
|
38
44
|
defaultValues?: JSONObject;
|
|
39
45
|
measures: DeviceModelContent["device"]["measures"];
|
|
40
46
|
};
|
|
@@ -45,9 +51,24 @@ export interface ApiModelWriteMeasureRequest extends ModelsControllerRequest {
|
|
|
45
51
|
body: {
|
|
46
52
|
type: string;
|
|
47
53
|
valuesMappings: JSONObject;
|
|
54
|
+
valuesDetails?: MeasureValuesDetails;
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
57
|
export type ApiModelWriteMeasureResult = KDocument<MeasureModelContent>;
|
|
58
|
+
export interface ApiModelUpdateAssetRequest extends ModelsControllerRequest {
|
|
59
|
+
action: "updateAsset";
|
|
60
|
+
engineGroup: string;
|
|
61
|
+
model: string;
|
|
62
|
+
body: {
|
|
63
|
+
metadataDetails?: MetadataDetails;
|
|
64
|
+
metadataGroups?: MetadataGroups;
|
|
65
|
+
metadataMappings?: MetadataMappings;
|
|
66
|
+
defaultValues?: JSONObject;
|
|
67
|
+
measures?: AssetModelContent["asset"]["measures"];
|
|
68
|
+
tooltipModels?: TooltipModels;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export type ApiModelUpdateAssetResult = KDocument<AssetModelContent>;
|
|
51
72
|
export interface ApiModelDeleteAssetRequest extends ModelsControllerRequest {
|
|
52
73
|
action: "deleteAsset";
|
|
53
74
|
_id: string;
|
|
@@ -85,4 +106,29 @@ export type ApiModelListMeasuresResult = {
|
|
|
85
106
|
models: KDocument<MeasureModelContent>[];
|
|
86
107
|
total: number;
|
|
87
108
|
};
|
|
109
|
+
export interface ApiModelSearchAssetsRequest extends ModelsControllerRequest {
|
|
110
|
+
action: "searchAssets";
|
|
111
|
+
engineGroup: string;
|
|
112
|
+
from?: number;
|
|
113
|
+
size?: number;
|
|
114
|
+
scrollTTL?: string;
|
|
115
|
+
body?: JSONObject;
|
|
116
|
+
}
|
|
117
|
+
export type ApiModelSearchAssetsResult = SearchResult<KHit<AssetModelContent>>;
|
|
118
|
+
export interface ApiModelSearchDevicesRequest extends ModelsControllerRequest {
|
|
119
|
+
action: "searchDevices";
|
|
120
|
+
from?: number;
|
|
121
|
+
size?: number;
|
|
122
|
+
scrollTTL?: string;
|
|
123
|
+
body?: JSONObject;
|
|
124
|
+
}
|
|
125
|
+
export type ApiModelSearchDevicesResult = SearchResult<KHit<DeviceModelContent>>;
|
|
126
|
+
export interface ApiModelSearchMeasuresRequest extends ModelsControllerRequest {
|
|
127
|
+
action: "searchMeasures";
|
|
128
|
+
from?: number;
|
|
129
|
+
size?: number;
|
|
130
|
+
scrollTTL?: string;
|
|
131
|
+
body?: JSONObject;
|
|
132
|
+
}
|
|
133
|
+
export type ApiModelSearchMeasuresResult = SearchResult<KHit<MeasureModelContent>>;
|
|
88
134
|
export {};
|
|
@@ -7,6 +7,129 @@ export interface MeasureModelContent extends KDocumentContent {
|
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
+
export interface MetadataProperty {
|
|
11
|
+
type: string;
|
|
12
|
+
strategy?: string;
|
|
13
|
+
format?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MetadataObject {
|
|
16
|
+
properties: {
|
|
17
|
+
[key: string]: MetadataProperty | MetadataObject;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface MetadataMappings {
|
|
21
|
+
[key: string]: MetadataProperty | MetadataObject;
|
|
22
|
+
}
|
|
23
|
+
export interface LocaleDetails {
|
|
24
|
+
friendlyName: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BaseEditorHint {
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
type: EditorHintEnum;
|
|
30
|
+
}
|
|
31
|
+
export declare enum EditorHintEnum {
|
|
32
|
+
BASE = "base",
|
|
33
|
+
OPTION_SELECTOR = "optionSelector",
|
|
34
|
+
DATETIME = "datetime"
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Allows to display a list of values to choose in a dropdown, it has to be defined in the the editorHint property of the asset/device's metadataDetails.
|
|
38
|
+
*/
|
|
39
|
+
export interface OptionsSelectorEditorHint extends BaseEditorHint {
|
|
40
|
+
type: EditorHintEnum.OPTION_SELECTOR;
|
|
41
|
+
/**
|
|
42
|
+
* A list that contains all the values displayed in the dropdown.
|
|
43
|
+
*/
|
|
44
|
+
values: string[] | number[] | boolean[];
|
|
45
|
+
/**
|
|
46
|
+
* Allow the user to add custom values.
|
|
47
|
+
*/
|
|
48
|
+
customValueAllowed?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Allows to display either a date picker with or without a time picker, or a clock picker, it has to be defined in the editorHint property of the asset/device's metadataDetails.
|
|
52
|
+
*/
|
|
53
|
+
export interface DatetimeEditorHint extends BaseEditorHint {
|
|
54
|
+
type: EditorHintEnum.DATETIME;
|
|
55
|
+
/**
|
|
56
|
+
* If true, displays a date picker, otherwise displays a clock picker.
|
|
57
|
+
*/
|
|
58
|
+
date: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* If `date` is true, setting this to true will add time picking to the date picker.
|
|
61
|
+
*/
|
|
62
|
+
time?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface MetadataDetails {
|
|
65
|
+
[key: string]: {
|
|
66
|
+
group?: string;
|
|
67
|
+
locales: {
|
|
68
|
+
[locale: string]: LocaleDetails;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* To add new editor hint, create an interface with the properties that extends BaseEditorHint.
|
|
72
|
+
* Then add a new field in EditorHintEnum to define the type of your hint.
|
|
73
|
+
* Finally add the new editor hint interface with a pipe to take in account the new type.
|
|
74
|
+
*/
|
|
75
|
+
editorHint?: BaseEditorHint | OptionsSelectorEditorHint | DatetimeEditorHint;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface MetadataGroupLocale {
|
|
79
|
+
groupFriendlyName: string;
|
|
80
|
+
description: string;
|
|
81
|
+
}
|
|
82
|
+
export interface MetadataGroups {
|
|
83
|
+
[groupName: string]: {
|
|
84
|
+
locales: {
|
|
85
|
+
[locale: string]: MetadataGroupLocale;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface MetadataTooltipContent {
|
|
90
|
+
category: "metadata";
|
|
91
|
+
label?: {
|
|
92
|
+
locales: {
|
|
93
|
+
[locale: string]: LocaleDetails;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
metadataPath: string;
|
|
97
|
+
suffix?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface MeasureTooltipContent {
|
|
100
|
+
category: "measure";
|
|
101
|
+
label?: {
|
|
102
|
+
locales: {
|
|
103
|
+
[locale: string]: LocaleDetails;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
measureSlot: string;
|
|
107
|
+
measureValuePath: string;
|
|
108
|
+
suffix?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface StaticTooltipContent {
|
|
111
|
+
category: "static";
|
|
112
|
+
label?: {
|
|
113
|
+
locales: {
|
|
114
|
+
[locale: string]: LocaleDetails;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
type: StaticTooltipContentType;
|
|
118
|
+
value: string;
|
|
119
|
+
}
|
|
120
|
+
export declare enum StaticTooltipContentType {
|
|
121
|
+
link = "link",
|
|
122
|
+
image = "image",
|
|
123
|
+
text = "text",
|
|
124
|
+
title = "title",
|
|
125
|
+
separator = "separator"
|
|
126
|
+
}
|
|
127
|
+
export interface TooltipModels {
|
|
128
|
+
[key: string]: {
|
|
129
|
+
tooltipLabel: string;
|
|
130
|
+
content: (MetadataTooltipContent | MeasureTooltipContent | StaticTooltipContent)[];
|
|
131
|
+
};
|
|
132
|
+
}
|
|
10
133
|
export interface AssetModelContent extends KDocumentContent {
|
|
11
134
|
type: "asset";
|
|
12
135
|
engineGroup: string;
|
|
@@ -27,7 +150,7 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
27
150
|
* }
|
|
28
151
|
* }
|
|
29
152
|
*/
|
|
30
|
-
metadataMappings:
|
|
153
|
+
metadataMappings: MetadataMappings;
|
|
31
154
|
/**
|
|
32
155
|
* Default values for metadata.
|
|
33
156
|
*
|
|
@@ -37,6 +160,51 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
37
160
|
* }
|
|
38
161
|
*/
|
|
39
162
|
defaultMetadata: JSONObject;
|
|
163
|
+
/**
|
|
164
|
+
* Metadata details
|
|
165
|
+
* @example
|
|
166
|
+
* {
|
|
167
|
+
* "extTemp": {
|
|
168
|
+
* "group": "buildingEnv",
|
|
169
|
+
* "locales": {
|
|
170
|
+
* "en": {
|
|
171
|
+
* "friendlyName": "External temperature",
|
|
172
|
+
* "description": "Building external temperature"
|
|
173
|
+
* },
|
|
174
|
+
* "fr": {
|
|
175
|
+
* "friendlyName": "Température extérieure",
|
|
176
|
+
* "description": "Température à l'exterieur du bâtiment"
|
|
177
|
+
* },
|
|
178
|
+
* },
|
|
179
|
+
* "editorHint": {
|
|
180
|
+
* "readOnly": true,
|
|
181
|
+
* "type": EditorHintEnum.OPTION_SELECTOR,
|
|
182
|
+
* "values": ["red", "blue"],
|
|
183
|
+
* "customValueAllowed": true,
|
|
184
|
+
* },
|
|
185
|
+
* },
|
|
186
|
+
* }
|
|
187
|
+
*/
|
|
188
|
+
metadataDetails?: MetadataDetails;
|
|
189
|
+
/**
|
|
190
|
+
* Metadata groups list
|
|
191
|
+
* @example
|
|
192
|
+
* {
|
|
193
|
+
* "buildingEnv": {
|
|
194
|
+
* "locales": {
|
|
195
|
+
* "en": {
|
|
196
|
+
* "groupFriendlyName": "Building environment",
|
|
197
|
+
* "description": "The building environment"
|
|
198
|
+
* },
|
|
199
|
+
* "fr": {
|
|
200
|
+
* "groupFriendlyName": "Environnement du bâtiment",
|
|
201
|
+
* "description": "L'environnement du bâtiment"
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
* }
|
|
205
|
+
* }
|
|
206
|
+
*/
|
|
207
|
+
metadataGroups?: MetadataGroups;
|
|
40
208
|
/**
|
|
41
209
|
* List of accepted measures for this model
|
|
42
210
|
*
|
|
@@ -49,6 +217,53 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
49
217
|
* ]
|
|
50
218
|
*/
|
|
51
219
|
measures: NamedMeasures;
|
|
220
|
+
/**
|
|
221
|
+
* List of tooltip models for this asset model
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* [
|
|
225
|
+
* "defaultTooltipKey": {
|
|
226
|
+
* "tooltipLabel": "Default tooltip model",
|
|
227
|
+
* "content": [
|
|
228
|
+
* {
|
|
229
|
+
* "metadataPath": "geolocation",
|
|
230
|
+
* "label": {
|
|
231
|
+
* "locales": {
|
|
232
|
+
* "en": {
|
|
233
|
+
* "description": "",
|
|
234
|
+
* "friendlyName": "Container position"
|
|
235
|
+
* },
|
|
236
|
+
* "fr": {
|
|
237
|
+
* "description": "",
|
|
238
|
+
* "friendlyName": "Position du conteneur"
|
|
239
|
+
* }
|
|
240
|
+
* }
|
|
241
|
+
* },
|
|
242
|
+
* "category": "metadata"
|
|
243
|
+
* },
|
|
244
|
+
* {
|
|
245
|
+
* "measureValuePath": "externalTemperature",
|
|
246
|
+
* "measureSlot": "externalTemperature",
|
|
247
|
+
* "label": {
|
|
248
|
+
* "locales": {
|
|
249
|
+
* "en": {
|
|
250
|
+
* "description": "",
|
|
251
|
+
* "friendlyName": "External temperature"
|
|
252
|
+
* },
|
|
253
|
+
* "fr": {
|
|
254
|
+
* "description": "",
|
|
255
|
+
* "friendlyName": "Température extérieure"
|
|
256
|
+
* }
|
|
257
|
+
* }
|
|
258
|
+
* },
|
|
259
|
+
* "category": "measure",
|
|
260
|
+
* "suffix": "°C"
|
|
261
|
+
* }
|
|
262
|
+
* ]
|
|
263
|
+
* }
|
|
264
|
+
* ]
|
|
265
|
+
*/
|
|
266
|
+
tooltipModels?: TooltipModels;
|
|
52
267
|
};
|
|
53
268
|
}
|
|
54
269
|
export interface DeviceModelContent extends KDocumentContent {
|
|
@@ -70,7 +285,7 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
70
285
|
* }
|
|
71
286
|
* }
|
|
72
287
|
*/
|
|
73
|
-
metadataMappings:
|
|
288
|
+
metadataMappings: MetadataMappings;
|
|
74
289
|
/**
|
|
75
290
|
* Default values for metadata.
|
|
76
291
|
*
|
|
@@ -80,6 +295,52 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
80
295
|
* }
|
|
81
296
|
*/
|
|
82
297
|
defaultMetadata: JSONObject;
|
|
298
|
+
/**
|
|
299
|
+
* Metadata details
|
|
300
|
+
* @example
|
|
301
|
+
* {
|
|
302
|
+
* "sensorVersion": {
|
|
303
|
+
* "group": "sensorSpecs",
|
|
304
|
+
* "locales": {
|
|
305
|
+
* "en": {
|
|
306
|
+
* "friendlyName": "Sensor version",
|
|
307
|
+
* "description": "Firmware version of the sensor"
|
|
308
|
+
* },
|
|
309
|
+
* "fr": {
|
|
310
|
+
* "friendlyName": "Version du capteur",
|
|
311
|
+
* "description": "Version du micrologiciel du capteur"
|
|
312
|
+
* },
|
|
313
|
+
* },
|
|
314
|
+
* "editorHint": {
|
|
315
|
+
* "readOnly": false,
|
|
316
|
+
* "type": EditorHintEnum.DATETIME,
|
|
317
|
+
* "date": true,
|
|
318
|
+
* "time": true,
|
|
319
|
+
* "customTimeZoneAllowed": true,
|
|
320
|
+
* },
|
|
321
|
+
* },
|
|
322
|
+
* }
|
|
323
|
+
*/
|
|
324
|
+
metadataDetails?: MetadataDetails;
|
|
325
|
+
/**
|
|
326
|
+
* Metadata groups list
|
|
327
|
+
* @example
|
|
328
|
+
* {
|
|
329
|
+
* "sensorSpecs": {
|
|
330
|
+
* "locales": {
|
|
331
|
+
* "en": {
|
|
332
|
+
* "groupFriendlyName": "Sensor specifications",
|
|
333
|
+
* "description" : "All sensors specifications"
|
|
334
|
+
* },
|
|
335
|
+
* "fr": {
|
|
336
|
+
* "groupFriendlyName": "Spécifications techniques",
|
|
337
|
+
* "description": "Toutes les spécifications techniques"
|
|
338
|
+
* },
|
|
339
|
+
* }
|
|
340
|
+
* }
|
|
341
|
+
* }
|
|
342
|
+
*/
|
|
343
|
+
metadataGroups?: MetadataGroups;
|
|
83
344
|
/**
|
|
84
345
|
* List of decoded measures for this model
|
|
85
346
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSONObject } from "kuzzle-sdk";
|
|
2
2
|
import { Decoder, NamedMeasures } from "../../../modules/decoder";
|
|
3
|
+
import { MetadataDetails, MetadataGroups, MetadataMappings, TooltipModels } from "./ModelContent";
|
|
3
4
|
/**
|
|
4
5
|
* Define an asset model
|
|
5
6
|
*
|
|
@@ -16,6 +17,83 @@ import { Decoder, NamedMeasures } from "../../../modules/decoder";
|
|
|
16
17
|
* },
|
|
17
18
|
* defaultMetadata: {
|
|
18
19
|
* height: 20
|
|
20
|
+
* },
|
|
21
|
+
* metadataDetails: {
|
|
22
|
+
* "extTemp": {
|
|
23
|
+
* "group": "buildingEnv",
|
|
24
|
+
* "locales": {
|
|
25
|
+
* "en": {
|
|
26
|
+
* "friendlyName": "External temperature",
|
|
27
|
+
* "description": "Container external temperature"
|
|
28
|
+
* },
|
|
29
|
+
* "fr": {
|
|
30
|
+
* "friendlyName": "Température externe",
|
|
31
|
+
* "description": "Température externe du conteneur"
|
|
32
|
+
* }
|
|
33
|
+
* },
|
|
34
|
+
* "definition": {
|
|
35
|
+
* "readOnly": false,
|
|
36
|
+
* "type": MetadataDetailsEnum.DATETIME,
|
|
37
|
+
* "date": true,
|
|
38
|
+
* "time": true,
|
|
39
|
+
* "customTimeZoneAllowed": true,
|
|
40
|
+
* },
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* metadataGroups: {
|
|
44
|
+
* buildingEnv: {
|
|
45
|
+
* locales: {
|
|
46
|
+
* en: {
|
|
47
|
+
* groupFriendlyName: "Building environment",
|
|
48
|
+
* description: "The building environment"
|
|
49
|
+
* },
|
|
50
|
+
* fr: {
|
|
51
|
+
* groupFriendlyName: "Environnement du bâtiment",
|
|
52
|
+
* description: "L'environnement du bâtiment"
|
|
53
|
+
* }
|
|
54
|
+
* }
|
|
55
|
+
* }
|
|
56
|
+
* },
|
|
57
|
+
* tooltipModels: {
|
|
58
|
+
* "defaultTooltipKey": {
|
|
59
|
+
* "tooltipLabel": "Default Tooltip Model",
|
|
60
|
+
* "content": [
|
|
61
|
+
* {
|
|
62
|
+
* "category": "metadata",
|
|
63
|
+
* "label": {
|
|
64
|
+
* "locales": {
|
|
65
|
+
* "en": {
|
|
66
|
+
* "friendlyName": "Container position",
|
|
67
|
+
* "description": ""
|
|
68
|
+
* },
|
|
69
|
+
* "fr": {
|
|
70
|
+
* "friendlyName": "Position du conteneur",
|
|
71
|
+
* "description": ""
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
74
|
+
* },
|
|
75
|
+
* "metadataPath": "geolocation"
|
|
76
|
+
* },
|
|
77
|
+
* {
|
|
78
|
+
* "category": "measure",
|
|
79
|
+
* "label": {
|
|
80
|
+
* "locales": {
|
|
81
|
+
* "en": {
|
|
82
|
+
* "friendlyName": "External temperature",
|
|
83
|
+
* "description": ""
|
|
84
|
+
* },
|
|
85
|
+
* "fr": {
|
|
86
|
+
* "friendlyName": "Température extérieure",
|
|
87
|
+
* "description": ""
|
|
88
|
+
* }
|
|
89
|
+
* }
|
|
90
|
+
* },
|
|
91
|
+
* "measureSlot": "externalTemperature",
|
|
92
|
+
* "measureValuePath": "externalTemperature",
|
|
93
|
+
* "suffix": "°C"
|
|
94
|
+
* }
|
|
95
|
+
* ]
|
|
96
|
+
* }
|
|
19
97
|
* }
|
|
20
98
|
* }
|
|
21
99
|
*
|
|
@@ -28,11 +106,23 @@ export type AssetModelDefinition = {
|
|
|
28
106
|
/**
|
|
29
107
|
* Metadata mappings definition
|
|
30
108
|
*/
|
|
31
|
-
metadataMappings?:
|
|
109
|
+
metadataMappings?: MetadataMappings;
|
|
32
110
|
/**
|
|
33
111
|
* Default metadata values
|
|
34
112
|
*/
|
|
35
113
|
defaultMetadata?: JSONObject;
|
|
114
|
+
/**
|
|
115
|
+
* Metadata details including tanslations and group.
|
|
116
|
+
*/
|
|
117
|
+
metadataDetails?: MetadataDetails;
|
|
118
|
+
/**
|
|
119
|
+
* Metadata groups
|
|
120
|
+
*/
|
|
121
|
+
metadataGroups?: MetadataGroups;
|
|
122
|
+
/**
|
|
123
|
+
* Tooltip models
|
|
124
|
+
*/
|
|
125
|
+
tooltipModels?: TooltipModels;
|
|
36
126
|
};
|
|
37
127
|
/**
|
|
38
128
|
* Define a device model
|
|
@@ -42,9 +132,47 @@ export type AssetModelDefinition = {
|
|
|
42
132
|
* decoder: new DummyTempPositionDecoder(),
|
|
43
133
|
* metadataMappings: {
|
|
44
134
|
* serial: { type: "keyword" },
|
|
45
|
-
* }
|
|
46
|
-
*
|
|
47
|
-
*
|
|
135
|
+
* },
|
|
136
|
+
* defaultMetadata: {
|
|
137
|
+
* company: "Firebird"
|
|
138
|
+
* },
|
|
139
|
+
* metadataDetails: {
|
|
140
|
+
* sensorType: {
|
|
141
|
+
* group: "sensorSpecs",
|
|
142
|
+
* locales: {
|
|
143
|
+
* en: {
|
|
144
|
+
* friendlyName: "Sensor type",
|
|
145
|
+
* description: "Type of the sensor"
|
|
146
|
+
* },
|
|
147
|
+
* fr: {
|
|
148
|
+
* friendlyName: "Type de traceur",
|
|
149
|
+
* description: "Type du traceur"
|
|
150
|
+
* }
|
|
151
|
+
* },
|
|
152
|
+
* definition: {
|
|
153
|
+
* readOnly: false,
|
|
154
|
+
* type: MetadataDetailsEnum.DATETIME,
|
|
155
|
+
* date: true,
|
|
156
|
+
* time: true,
|
|
157
|
+
* customTimeZoneAllowed: true,
|
|
158
|
+
* },
|
|
159
|
+
* },
|
|
160
|
+
* },
|
|
161
|
+
* metadataGroups: {
|
|
162
|
+
* sensorSpecs: {
|
|
163
|
+
* locales: {
|
|
164
|
+
* en: {
|
|
165
|
+
* groupFriendlyName: "Sensor specifications",
|
|
166
|
+
* description : "All sensors specifications"
|
|
167
|
+
* },
|
|
168
|
+
* fr: {
|
|
169
|
+
* groupFriendlyName: "Spécifications techniques",
|
|
170
|
+
* description: "Toutes les spécifications techniques"
|
|
171
|
+
* }
|
|
172
|
+
* }
|
|
173
|
+
* }
|
|
174
|
+
* }
|
|
175
|
+
* }
|
|
48
176
|
*/
|
|
49
177
|
export type DeviceModelDefinition = {
|
|
50
178
|
/**
|
|
@@ -54,9 +182,17 @@ export type DeviceModelDefinition = {
|
|
|
54
182
|
/**
|
|
55
183
|
* Metadata mappings definition
|
|
56
184
|
*/
|
|
57
|
-
metadataMappings?:
|
|
185
|
+
metadataMappings?: MetadataMappings;
|
|
58
186
|
/**
|
|
59
187
|
* Default metadata values
|
|
60
188
|
*/
|
|
61
189
|
defaultMetadata?: JSONObject;
|
|
190
|
+
/**
|
|
191
|
+
* Metadata details including tanslations and group.
|
|
192
|
+
*/
|
|
193
|
+
metadataDetails?: MetadataDetails;
|
|
194
|
+
/**
|
|
195
|
+
* Metadata groups list and details.
|
|
196
|
+
*/
|
|
197
|
+
metadataGroups?: MetadataGroups;
|
|
62
198
|
};
|