kuzzle-device-manager-types 2.4.0-beta.2 → 2.4.0-beta.20
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/AssetHistoryService.d.ts +2 -4
- package/dist/lib/modules/asset/AssetService.d.ts +25 -26
- package/dist/lib/modules/asset/AssetsController.d.ts +4 -1
- package/dist/lib/modules/asset/types/AssetApi.d.ts +32 -0
- package/dist/lib/modules/asset/types/AssetContent.d.ts +1 -1
- package/dist/lib/modules/decoder/Decoder.d.ts +11 -0
- package/dist/lib/modules/decoder/PayloadService.d.ts +3 -6
- package/dist/lib/modules/decoder/types/DecoderContent.d.ts +1 -0
- package/dist/lib/modules/device/DeviceService.d.ts +27 -46
- package/dist/lib/modules/device/DevicesController.d.ts +2 -1
- package/dist/lib/modules/device/collections/deviceMappings.d.ts +2 -46
- package/dist/lib/modules/device/types/DeviceApi.d.ts +11 -0
- package/dist/lib/modules/device/types/DeviceEvents.d.ts +29 -0
- package/dist/lib/modules/measure/MeasureExporter.d.ts +5 -2
- package/dist/lib/modules/measure/MeasureService.d.ts +2 -6
- package/dist/lib/modules/measure/collections/measuresMappings.d.ts +18 -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 +13 -8
- package/dist/lib/modules/model/ModelsConflicts.d.ts +30 -0
- package/dist/lib/modules/model/ModelsController.d.ts +2 -1
- package/dist/lib/modules/model/ModelsRegister.d.ts +28 -3
- package/dist/lib/modules/model/types/ModelApi.d.ts +24 -3
- package/dist/lib/modules/model/types/ModelContent.d.ts +207 -2
- package/dist/lib/modules/model/types/ModelDefinition.d.ts +129 -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/exports.d.ts +1 -1
- package/dist/lib/modules/plugin/index.d.ts +1 -2
- package/dist/lib/modules/plugin/types/DeviceManagerConfiguration.d.ts +27 -5
- package/dist/lib/modules/plugin/types/Pipes.d.ts +17 -0
- package/dist/lib/modules/plugin/types/exports.d.ts +1 -0
- package/dist/lib/modules/plugin/types/index.d.ts +3 -0
- package/dist/lib/modules/shared/index.d.ts +3 -4
- package/dist/lib/modules/shared/services/AbstractExporter.d.ts +1 -0
- package/dist/lib/modules/shared/services/BaseService.d.ts +69 -0
- package/dist/lib/modules/shared/services/index.d.ts +1 -0
- package/dist/tests/application/assets/Container.d.ts +3 -0
- package/dist/tests/application/decoders/DummyTempPositionDecoder.d.ts +1 -0
- package/package.json +4 -3
- package/dist/lib/modules/shared/utils/ask.d.ts +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ControllerDefinition, KuzzleRequest } from "kuzzle";
|
|
2
2
|
import { ModelService } from "./ModelService";
|
|
3
|
-
import { ApiModelWriteAssetResult, ApiModelWriteDeviceResult, ApiModelWriteMeasureResult, ApiModelDeleteAssetResult, ApiModelDeleteDeviceResult, ApiModelDeleteMeasureResult, ApiModelListAssetsResult, ApiModelListDevicesResult, ApiModelListMeasuresResult, ApiModelGetAssetResult, ApiModelGetDeviceResult, ApiModelGetMeasureResult } from "./types/ModelApi";
|
|
3
|
+
import { ApiModelWriteAssetResult, ApiModelWriteDeviceResult, ApiModelWriteMeasureResult, ApiModelUpdateAssetResult, ApiModelDeleteAssetResult, ApiModelDeleteDeviceResult, ApiModelDeleteMeasureResult, ApiModelListAssetsResult, ApiModelListDevicesResult, ApiModelListMeasuresResult, ApiModelGetAssetResult, ApiModelGetDeviceResult, ApiModelGetMeasureResult } from "./types/ModelApi";
|
|
4
4
|
export declare class ModelsController {
|
|
5
5
|
private modelService;
|
|
6
6
|
definition: ControllerDefinition;
|
|
@@ -17,4 +17,5 @@ export declare class ModelsController {
|
|
|
17
17
|
listAssets(request: KuzzleRequest): Promise<ApiModelListAssetsResult>;
|
|
18
18
|
listDevices(): Promise<ApiModelListDevicesResult>;
|
|
19
19
|
listMeasures(): Promise<ApiModelListMeasuresResult>;
|
|
20
|
+
updateAsset(request: KuzzleRequest): Promise<ApiModelUpdateAssetResult>;
|
|
20
21
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { JSONObject } from "kuzzle-sdk";
|
|
2
1
|
import { DeviceManagerPlugin } from "../plugin";
|
|
3
2
|
import { NamedMeasures } from "../decoder";
|
|
4
3
|
import { MeasureDefinition } from "../measure";
|
|
4
|
+
import { MetadataDetails, MetadataGroups, MetadataMappings, TooltipModels } from "./types/ModelContent";
|
|
5
|
+
import { JSONObject } from "kuzzle-sdk";
|
|
5
6
|
export declare class ModelsRegister {
|
|
6
7
|
private config;
|
|
7
8
|
private context;
|
|
@@ -11,8 +12,32 @@ export declare class ModelsRegister {
|
|
|
11
12
|
private get sdk();
|
|
12
13
|
init(plugin: DeviceManagerPlugin): void;
|
|
13
14
|
loadModels(): Promise<void>;
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Registers an asset model.
|
|
17
|
+
*
|
|
18
|
+
* @param engineGroup - The engine group name.
|
|
19
|
+
* @param model - The name of the asset model, which must be in PascalCase.
|
|
20
|
+
* @param measures - The measures associated with this asset model.
|
|
21
|
+
* @param metadataMappings - The metadata mappings for the model, defaults to an empty object.
|
|
22
|
+
* @param defaultMetadata - The default metadata values for the model, defaults to an empty object.
|
|
23
|
+
* @param metadataDetails - Optional detailed metadata descriptions and localizations.
|
|
24
|
+
* @param metadataGroups - Optional groups for organizing metadata, with localizations.
|
|
25
|
+
* @param tooltipModels - Optional model list for tooltip, containing labels and tooltip content.
|
|
26
|
+
* @throws PluginImplementationError if the model name is not in PascalCase.
|
|
27
|
+
*/
|
|
28
|
+
registerAsset(engineGroup: string, model: string, measures: NamedMeasures, metadataMappings?: MetadataMappings, defaultMetadata?: JSONObject, metadataDetails?: MetadataDetails, metadataGroups?: MetadataGroups, tooltipModels?: TooltipModels): void;
|
|
29
|
+
/**
|
|
30
|
+
* Registers a device model.
|
|
31
|
+
*
|
|
32
|
+
* @param model - The name of the device model, which must be in PascalCase.
|
|
33
|
+
* @param measures - The measures associated with this device model.
|
|
34
|
+
* @param metadataMappings - The metadata mappings for the model, defaults to an empty object.
|
|
35
|
+
* @param defaultMetadata - The default metadata values for the model, defaults to an empty object.
|
|
36
|
+
* @param metadataDetails - Optional detailed metadata descriptions and localizations.
|
|
37
|
+
* @param metadataGroups - Optional groups for organizing metadata, with localizations.
|
|
38
|
+
* @throws PluginImplementationError if the model name is not in PascalCase.
|
|
39
|
+
*/
|
|
40
|
+
registerDevice(model: string, measures: NamedMeasures, metadataMappings?: MetadataMappings, defaultMetadata?: JSONObject, metadataDetails?: MetadataDetails, metadataGroups?: MetadataGroups): void;
|
|
16
41
|
registerMeasure(type: string, measureDefinition: MeasureDefinition): void;
|
|
17
42
|
private load;
|
|
18
43
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { JSONObject, KDocument } from "kuzzle-sdk";
|
|
2
|
-
import { AssetModelContent, DeviceModelContent, MeasureModelContent } from "./ModelContent";
|
|
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;
|
|
@@ -7,6 +7,87 @@ export interface MeasureModelContent extends KDocumentContent {
|
|
|
7
7
|
type: string;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
+
interface MetadataProperty {
|
|
11
|
+
type: string;
|
|
12
|
+
strategy?: string;
|
|
13
|
+
format?: string;
|
|
14
|
+
}
|
|
15
|
+
interface MetadataObject {
|
|
16
|
+
properties: {
|
|
17
|
+
[key: string]: MetadataProperty | MetadataObject;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface MetadataMappings {
|
|
21
|
+
[key: string]: MetadataProperty | MetadataObject;
|
|
22
|
+
}
|
|
23
|
+
interface LocaleDetails {
|
|
24
|
+
friendlyName: string;
|
|
25
|
+
description: string;
|
|
26
|
+
}
|
|
27
|
+
export interface MetadataDetails {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
group?: string;
|
|
30
|
+
locales: {
|
|
31
|
+
[locale: string]: LocaleDetails;
|
|
32
|
+
};
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
interface MetadataGroupLocale {
|
|
37
|
+
groupFriendlyName: string;
|
|
38
|
+
description: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MetadataGroups {
|
|
41
|
+
[groupName: string]: {
|
|
42
|
+
locales: {
|
|
43
|
+
[locale: string]: MetadataGroupLocale;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface MetadataTooltipContent {
|
|
48
|
+
category: "metadata";
|
|
49
|
+
label?: {
|
|
50
|
+
locales: {
|
|
51
|
+
[locale: string]: LocaleDetails;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
metadataPath: string;
|
|
55
|
+
suffix?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface MeasureTooltipContent {
|
|
58
|
+
category: "measure";
|
|
59
|
+
label?: {
|
|
60
|
+
locales: {
|
|
61
|
+
[locale: string]: LocaleDetails;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
measureSlot: string;
|
|
65
|
+
measureValuePath: string;
|
|
66
|
+
suffix?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface StaticTooltipContent {
|
|
69
|
+
category: "static";
|
|
70
|
+
label?: {
|
|
71
|
+
locales: {
|
|
72
|
+
[locale: string]: LocaleDetails;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
type: StaticTooltipContentType;
|
|
76
|
+
value: string;
|
|
77
|
+
}
|
|
78
|
+
export declare enum StaticTooltipContentType {
|
|
79
|
+
link = "link",
|
|
80
|
+
image = "image",
|
|
81
|
+
text = "text",
|
|
82
|
+
title = "title",
|
|
83
|
+
separator = "separator"
|
|
84
|
+
}
|
|
85
|
+
export interface TooltipModels {
|
|
86
|
+
[key: string]: {
|
|
87
|
+
tooltipLabel: string;
|
|
88
|
+
content: (MetadataTooltipContent | MeasureTooltipContent | StaticTooltipContent)[];
|
|
89
|
+
};
|
|
90
|
+
}
|
|
10
91
|
export interface AssetModelContent extends KDocumentContent {
|
|
11
92
|
type: "asset";
|
|
12
93
|
engineGroup: string;
|
|
@@ -27,7 +108,7 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
27
108
|
* }
|
|
28
109
|
* }
|
|
29
110
|
*/
|
|
30
|
-
metadataMappings:
|
|
111
|
+
metadataMappings: MetadataMappings;
|
|
31
112
|
/**
|
|
32
113
|
* Default values for metadata.
|
|
33
114
|
*
|
|
@@ -37,6 +118,44 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
37
118
|
* }
|
|
38
119
|
*/
|
|
39
120
|
defaultMetadata: JSONObject;
|
|
121
|
+
/**
|
|
122
|
+
* Metadata details
|
|
123
|
+
* @example
|
|
124
|
+
* {
|
|
125
|
+
* "extTemp": {
|
|
126
|
+
* "group": "buildingEnv",
|
|
127
|
+
* "locales": {
|
|
128
|
+
* "en": {
|
|
129
|
+
* "friendlyName": "External temperature",
|
|
130
|
+
* "description": "Building external temperature"
|
|
131
|
+
* },
|
|
132
|
+
* "fr": {
|
|
133
|
+
* "friendlyName": "Température extérieure",
|
|
134
|
+
* "description": "Température à l'exterieur du bâtiment"
|
|
135
|
+
* },
|
|
136
|
+
* "readOnly": true,
|
|
137
|
+
* }
|
|
138
|
+
*/
|
|
139
|
+
metadataDetails?: MetadataDetails;
|
|
140
|
+
/**
|
|
141
|
+
* Metadata groups list
|
|
142
|
+
* @example
|
|
143
|
+
* {
|
|
144
|
+
* "buildingEnv": {
|
|
145
|
+
* "locales": {
|
|
146
|
+
* "en": {
|
|
147
|
+
* "groupFriendlyName": "Building environment",
|
|
148
|
+
* "description": "The building environment"
|
|
149
|
+
* },
|
|
150
|
+
* "fr": {
|
|
151
|
+
* "groupFriendlyName": "Environnement du bâtiment",
|
|
152
|
+
* "description": "L'environnement du bâtiment"
|
|
153
|
+
* }
|
|
154
|
+
* }
|
|
155
|
+
* }
|
|
156
|
+
* }
|
|
157
|
+
*/
|
|
158
|
+
metadataGroups?: MetadataGroups;
|
|
40
159
|
/**
|
|
41
160
|
* List of accepted measures for this model
|
|
42
161
|
*
|
|
@@ -49,6 +168,53 @@ export interface AssetModelContent extends KDocumentContent {
|
|
|
49
168
|
* ]
|
|
50
169
|
*/
|
|
51
170
|
measures: NamedMeasures;
|
|
171
|
+
/**
|
|
172
|
+
* List of tooltip models for this asset model
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* [
|
|
176
|
+
* "defaultTooltipKey": {
|
|
177
|
+
* "tooltipLabel": "Default tooltip model",
|
|
178
|
+
* "content": [
|
|
179
|
+
* {
|
|
180
|
+
* "metadataPath": "geolocation",
|
|
181
|
+
* "label": {
|
|
182
|
+
* "locales": {
|
|
183
|
+
* "en": {
|
|
184
|
+
* "description": "",
|
|
185
|
+
* "friendlyName": "Container position"
|
|
186
|
+
* },
|
|
187
|
+
* "fr": {
|
|
188
|
+
* "description": "",
|
|
189
|
+
* "friendlyName": "Position du conteneur"
|
|
190
|
+
* }
|
|
191
|
+
* }
|
|
192
|
+
* },
|
|
193
|
+
* "category": "metadata"
|
|
194
|
+
* },
|
|
195
|
+
* {
|
|
196
|
+
* "measureValuePath": "externalTemperature",
|
|
197
|
+
* "measureSlot": "externalTemperature",
|
|
198
|
+
* "label": {
|
|
199
|
+
* "locales": {
|
|
200
|
+
* "en": {
|
|
201
|
+
* "description": "",
|
|
202
|
+
* "friendlyName": "External temperature"
|
|
203
|
+
* },
|
|
204
|
+
* "fr": {
|
|
205
|
+
* "description": "",
|
|
206
|
+
* "friendlyName": "Température extérieure"
|
|
207
|
+
* }
|
|
208
|
+
* }
|
|
209
|
+
* },
|
|
210
|
+
* "category": "measure",
|
|
211
|
+
* "suffix": "°C"
|
|
212
|
+
* }
|
|
213
|
+
* ]
|
|
214
|
+
* }
|
|
215
|
+
* ]
|
|
216
|
+
*/
|
|
217
|
+
tooltipModels?: TooltipModels;
|
|
52
218
|
};
|
|
53
219
|
}
|
|
54
220
|
export interface DeviceModelContent extends KDocumentContent {
|
|
@@ -70,7 +236,7 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
70
236
|
* }
|
|
71
237
|
* }
|
|
72
238
|
*/
|
|
73
|
-
metadataMappings:
|
|
239
|
+
metadataMappings: MetadataMappings;
|
|
74
240
|
/**
|
|
75
241
|
* Default values for metadata.
|
|
76
242
|
*
|
|
@@ -80,6 +246,44 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
80
246
|
* }
|
|
81
247
|
*/
|
|
82
248
|
defaultMetadata: JSONObject;
|
|
249
|
+
/**
|
|
250
|
+
* Metadata details
|
|
251
|
+
* @example
|
|
252
|
+
* {
|
|
253
|
+
* "sensorVersion": {
|
|
254
|
+
* "group": "sensorSpecs",
|
|
255
|
+
* "locales": {
|
|
256
|
+
* "en": {
|
|
257
|
+
* "friendlyName": "Sensor version",
|
|
258
|
+
* "description": "Firmware version of the sensor"
|
|
259
|
+
* },
|
|
260
|
+
* "fr": {
|
|
261
|
+
* "friendlyName": "Version du capteur",
|
|
262
|
+
* "description": "Version du micrologiciel du capteur"
|
|
263
|
+
* },
|
|
264
|
+
* "readOnly": true,
|
|
265
|
+
* }
|
|
266
|
+
*/
|
|
267
|
+
metadataDetails?: MetadataDetails;
|
|
268
|
+
/**
|
|
269
|
+
* Metadata groups list
|
|
270
|
+
* @example
|
|
271
|
+
* {
|
|
272
|
+
* "sensorSpecs": {
|
|
273
|
+
* "locales": {
|
|
274
|
+
* "en": {
|
|
275
|
+
* "groupFriendlyName": "Sensor specifications",
|
|
276
|
+
* "description" : "All sensors specifications"
|
|
277
|
+
* },
|
|
278
|
+
* "fr": {
|
|
279
|
+
* "groupFriendlyName": "Spécifications techniques",
|
|
280
|
+
* "description": "Toutes les spécifications techniques"
|
|
281
|
+
* },
|
|
282
|
+
* }
|
|
283
|
+
* }
|
|
284
|
+
* }
|
|
285
|
+
*/
|
|
286
|
+
metadataGroups?: MetadataGroups;
|
|
83
287
|
/**
|
|
84
288
|
* List of decoded measures for this model
|
|
85
289
|
*
|
|
@@ -95,3 +299,4 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
95
299
|
};
|
|
96
300
|
}
|
|
97
301
|
export type ModelContent = MeasureModelContent | AssetModelContent | DeviceModelContent;
|
|
302
|
+
export {};
|
|
@@ -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,77 @@ 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
|
+
* "readOnly": true,
|
|
35
|
+
* }
|
|
36
|
+
* },
|
|
37
|
+
* metadataGroups: {
|
|
38
|
+
* buildingEnv: {
|
|
39
|
+
* locales: {
|
|
40
|
+
* en: {
|
|
41
|
+
* groupFriendlyName: "Building environment",
|
|
42
|
+
* description: "The building environment"
|
|
43
|
+
* },
|
|
44
|
+
* fr: {
|
|
45
|
+
* groupFriendlyName: "Environnement du bâtiment",
|
|
46
|
+
* description: "L'environnement du bâtiment"
|
|
47
|
+
* }
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
* },
|
|
51
|
+
* tooltipModels: {
|
|
52
|
+
* "defaultTooltipKey": {
|
|
53
|
+
* "tooltipLabel": "Default Tooltip Model",
|
|
54
|
+
* "content": [
|
|
55
|
+
* {
|
|
56
|
+
* "category": "metadata",
|
|
57
|
+
* "label": {
|
|
58
|
+
* "locales": {
|
|
59
|
+
* "en": {
|
|
60
|
+
* "friendlyName": "Container position",
|
|
61
|
+
* "description": ""
|
|
62
|
+
* },
|
|
63
|
+
* "fr": {
|
|
64
|
+
* "friendlyName": "Position du conteneur",
|
|
65
|
+
* "description": ""
|
|
66
|
+
* }
|
|
67
|
+
* }
|
|
68
|
+
* },
|
|
69
|
+
* "metadataPath": "geolocation"
|
|
70
|
+
* },
|
|
71
|
+
* {
|
|
72
|
+
* "category": "measure",
|
|
73
|
+
* "label": {
|
|
74
|
+
* "locales": {
|
|
75
|
+
* "en": {
|
|
76
|
+
* "friendlyName": "External temperature",
|
|
77
|
+
* "description": ""
|
|
78
|
+
* },
|
|
79
|
+
* "fr": {
|
|
80
|
+
* "friendlyName": "Température extérieure",
|
|
81
|
+
* "description": ""
|
|
82
|
+
* }
|
|
83
|
+
* }
|
|
84
|
+
* },
|
|
85
|
+
* "measureSlot": "externalTemperature",
|
|
86
|
+
* "measureValuePath": "externalTemperature",
|
|
87
|
+
* "suffix": "°C"
|
|
88
|
+
* }
|
|
89
|
+
* ]
|
|
90
|
+
* }
|
|
19
91
|
* }
|
|
20
92
|
* }
|
|
21
93
|
*
|
|
@@ -28,11 +100,23 @@ export type AssetModelDefinition = {
|
|
|
28
100
|
/**
|
|
29
101
|
* Metadata mappings definition
|
|
30
102
|
*/
|
|
31
|
-
metadataMappings?:
|
|
103
|
+
metadataMappings?: MetadataMappings;
|
|
32
104
|
/**
|
|
33
105
|
* Default metadata values
|
|
34
106
|
*/
|
|
35
107
|
defaultMetadata?: JSONObject;
|
|
108
|
+
/**
|
|
109
|
+
* Metadata details including tanslations and group.
|
|
110
|
+
*/
|
|
111
|
+
metadataDetails?: MetadataDetails;
|
|
112
|
+
/**
|
|
113
|
+
* Metadata groups
|
|
114
|
+
*/
|
|
115
|
+
metadataGroups?: MetadataGroups;
|
|
116
|
+
/**
|
|
117
|
+
* Tooltip models
|
|
118
|
+
*/
|
|
119
|
+
tooltipModels?: TooltipModels;
|
|
36
120
|
};
|
|
37
121
|
/**
|
|
38
122
|
* Define a device model
|
|
@@ -42,9 +126,41 @@ export type AssetModelDefinition = {
|
|
|
42
126
|
* decoder: new DummyTempPositionDecoder(),
|
|
43
127
|
* metadataMappings: {
|
|
44
128
|
* serial: { type: "keyword" },
|
|
45
|
-
* }
|
|
46
|
-
*
|
|
47
|
-
*
|
|
129
|
+
* },
|
|
130
|
+
* defaultMetadata: {
|
|
131
|
+
* company: "Firebird"
|
|
132
|
+
* },
|
|
133
|
+
* metadataDetails: {
|
|
134
|
+
* sensorType: {
|
|
135
|
+
* group: "sensorSpecs",
|
|
136
|
+
* locales: {
|
|
137
|
+
* en: {
|
|
138
|
+
* friendlyName: "Sensor type",
|
|
139
|
+
* description: "Type of the sensor"
|
|
140
|
+
* },
|
|
141
|
+
* fr: {
|
|
142
|
+
* friendlyName: "Type de traceur",
|
|
143
|
+
* description: "Type du traceur"
|
|
144
|
+
* }
|
|
145
|
+
* },
|
|
146
|
+
* readOnly: true,
|
|
147
|
+
* }
|
|
148
|
+
* },
|
|
149
|
+
* metadataGroups: {
|
|
150
|
+
* sensorSpecs: {
|
|
151
|
+
* locales: {
|
|
152
|
+
* en: {
|
|
153
|
+
* groupFriendlyName: "Sensor specifications",
|
|
154
|
+
* description : "All sensors specifications"
|
|
155
|
+
* },
|
|
156
|
+
* fr: {
|
|
157
|
+
* groupFriendlyName: "Spécifications techniques",
|
|
158
|
+
* description: "Toutes les spécifications techniques"
|
|
159
|
+
* }
|
|
160
|
+
* }
|
|
161
|
+
* }
|
|
162
|
+
* }
|
|
163
|
+
* }
|
|
48
164
|
*/
|
|
49
165
|
export type DeviceModelDefinition = {
|
|
50
166
|
/**
|
|
@@ -54,9 +170,17 @@ export type DeviceModelDefinition = {
|
|
|
54
170
|
/**
|
|
55
171
|
* Metadata mappings definition
|
|
56
172
|
*/
|
|
57
|
-
metadataMappings?:
|
|
173
|
+
metadataMappings?: MetadataMappings;
|
|
58
174
|
/**
|
|
59
175
|
* Default metadata values
|
|
60
176
|
*/
|
|
61
177
|
defaultMetadata?: JSONObject;
|
|
178
|
+
/**
|
|
179
|
+
* Metadata details including tanslations and group.
|
|
180
|
+
*/
|
|
181
|
+
metadataDetails?: MetadataDetails;
|
|
182
|
+
/**
|
|
183
|
+
* Metadata groups list and details.
|
|
184
|
+
*/
|
|
185
|
+
metadataGroups?: MetadataGroups;
|
|
62
186
|
};
|