kuzzle-device-manager-types 3.0.0-next.25 → 3.0.0-next.26
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/measure/MeasureTargetBuilder.d.ts +1 -1
- package/dist/lib/modules/measure/types/MeasureTarget.d.ts +1 -1
- package/dist/lib/modules/model/ModelService.d.ts +8 -8
- package/dist/lib/modules/model/ModelsRegister.d.ts +4 -4
- package/dist/lib/modules/model/types/ModelApi.d.ts +8 -8
- package/dist/lib/modules/model/types/ModelContent.d.ts +3 -3
- package/dist/lib/modules/model/types/ModelEvents.d.ts +1 -1
- package/dist/lib/modules/plugin/DeviceManagerPlugin.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ApiMeasureTarget, DeviceMeasureTarget } from "./types/MeasureTarget";
|
|
2
|
-
export declare function toApiTarget(indexId: string, assetId: string,
|
|
2
|
+
export declare function toApiTarget(indexId: string, assetId: string, engineGroups?: string[]): ApiMeasureTarget;
|
|
3
3
|
export declare function toDeviceTarget(indexId: string, assetId?: string): DeviceMeasureTarget;
|
|
@@ -9,7 +9,7 @@ export interface DeviceMeasureTarget extends AbstractMeasureTarget {
|
|
|
9
9
|
export interface ApiMeasureTarget extends AbstractMeasureTarget {
|
|
10
10
|
type: "api";
|
|
11
11
|
assetId: string;
|
|
12
|
-
|
|
12
|
+
engineGroups?: string[];
|
|
13
13
|
}
|
|
14
14
|
export declare function isTarget(target: any): target is AbstractMeasureTarget;
|
|
15
15
|
export declare function isTargetDevice(target: any): target is DeviceMeasureTarget;
|
|
@@ -12,11 +12,11 @@ export declare class ModelService extends BaseService {
|
|
|
12
12
|
private checkModelsConflicts;
|
|
13
13
|
private checkDefaultValues;
|
|
14
14
|
private checkGroupAffinity;
|
|
15
|
-
writeAsset(
|
|
15
|
+
writeAsset(engineGroups: string[], model: string, metadataMappings: MetadataMappings, defaultMetadata: JSONObject, metadataDetails: MetadataDetails, metadataGroups: MetadataGroups, measures: NamedMeasures, tooltipModels: TooltipModels, locales: {
|
|
16
16
|
[valueName: string]: LocaleDetails;
|
|
17
17
|
}, engineIds?: string[]): Promise<KDocument<AssetModelContent>>;
|
|
18
18
|
writeDevice(model: string, metadataMappings: MetadataMappings, defaultMetadata: JSONObject, metadataDetails: MetadataDetails, metadataGroups: MetadataGroups, measures: NamedMeasures): Promise<KDocument<DeviceModelContent>>;
|
|
19
|
-
writeGroup(
|
|
19
|
+
writeGroup(engineGroups: string[], model: string, affinity: JSONObject, metadataMappings: MetadataMappings, defaultMetadata: JSONObject, metadataDetails: MetadataDetails, metadataGroups: MetadataGroups): Promise<KDocument<GroupModelContent>>;
|
|
20
20
|
writeMeasure(type: string, valuesMappings: JSONObject, validationSchema?: SchemaObject, valuesDetails?: MeasureValuesDetails, locales?: {
|
|
21
21
|
[valueName: string]: LocaleDetails;
|
|
22
22
|
}, engineIds?: string[]): Promise<KDocument<MeasureModelContent>>;
|
|
@@ -24,17 +24,17 @@ export declare class ModelService extends BaseService {
|
|
|
24
24
|
deleteDevice(_id: string): Promise<void>;
|
|
25
25
|
deleteGroup(_id: string): Promise<void>;
|
|
26
26
|
deleteMeasure(_id: string): Promise<void>;
|
|
27
|
-
listAsset(
|
|
27
|
+
listAsset(engineGroups: string[], engineId?: string): Promise<KDocument<AssetModelContent>[]>;
|
|
28
28
|
listDevices(): Promise<KDocument<DeviceModelContent>[]>;
|
|
29
|
-
listGroups(
|
|
29
|
+
listGroups(engineGroups: string[]): Promise<KDocument<GroupModelContent>[]>;
|
|
30
30
|
listMeasures(engineId?: string): Promise<KDocument<MeasureModelContent>[]>;
|
|
31
|
-
searchAssets(
|
|
31
|
+
searchAssets(engineGroups: string[], engineId: string | undefined, searchParams: Partial<SearchParams>): Promise<SearchResult<KHit<AssetModelContent>>>;
|
|
32
32
|
searchDevices(searchParams: Partial<SearchParams>): Promise<SearchResult<KHit<DeviceModelContent>>>;
|
|
33
|
-
searchGroups(
|
|
33
|
+
searchGroups(engineGroups: string[], searchParams: Partial<SearchParams>): Promise<SearchResult<KHit<GroupModelContent>>>;
|
|
34
34
|
searchMeasures(engineId: string | undefined, searchParams: Partial<SearchParams>): Promise<SearchResult<KHit<MeasureModelContent>>>;
|
|
35
35
|
assetExists(model: string): Promise<boolean>;
|
|
36
36
|
deviceExists(model: string): Promise<boolean>;
|
|
37
|
-
getAsset(
|
|
37
|
+
getAsset(engineGroups: string[], engineId: string | undefined, model: string): Promise<KDocument<AssetModelContent>>;
|
|
38
38
|
getDevice(model: string): Promise<KDocument<DeviceModelContent>>;
|
|
39
39
|
getGroup(model: string): Promise<KDocument<GroupModelContent>>;
|
|
40
40
|
getMeasure(type: string, engineId?: string): Promise<KDocument<MeasureModelContent>>;
|
|
@@ -46,7 +46,7 @@ export declare class ModelService extends BaseService {
|
|
|
46
46
|
/**
|
|
47
47
|
* Update an asset model
|
|
48
48
|
*/
|
|
49
|
-
updateAsset(
|
|
49
|
+
updateAsset(engineGroups: string[], model: string, metadataMappings: MetadataMappings, defaultMetadata: JSONObject, metadataDetails: MetadataDetails, metadataGroups: MetadataGroups, measures: AssetModelContent["asset"]["measures"], tooltipModels: TooltipModels, locales: {
|
|
50
50
|
[valueName: string]: LocaleDetails;
|
|
51
51
|
}, request: KuzzleRequest): Promise<KDocument<AssetModelContent>>;
|
|
52
52
|
}
|
|
@@ -16,7 +16,7 @@ export declare class ModelsRegister {
|
|
|
16
16
|
/**
|
|
17
17
|
* Registers an asset model.
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param engineGroups - The engine group names.
|
|
20
20
|
* @param model - The name of the asset model, which must be in PascalCase.
|
|
21
21
|
* @param measures - The measures associated with this asset model.
|
|
22
22
|
* @param metadataMappings - The metadata mappings for the model, defaults to an empty object.
|
|
@@ -26,7 +26,7 @@ export declare class ModelsRegister {
|
|
|
26
26
|
* @param tooltipModels - Optional model list for tooltip, containing labels and tooltip content.
|
|
27
27
|
* @throws PluginImplementationError if the model name is not in PascalCase.
|
|
28
28
|
*/
|
|
29
|
-
registerAsset(
|
|
29
|
+
registerAsset(engineGroups: string[], model: string, measures: NamedMeasures, metadataMappings?: MetadataMappings, defaultMetadata?: JSONObject, metadataDetails?: MetadataDetails, metadataGroups?: MetadataGroups, tooltipModels?: TooltipModels, locales?: {
|
|
30
30
|
[valueName: string]: LocaleDetails;
|
|
31
31
|
}): void;
|
|
32
32
|
/**
|
|
@@ -45,7 +45,7 @@ export declare class ModelsRegister {
|
|
|
45
45
|
* Registers a group model.
|
|
46
46
|
*
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param engineGroups - The engine group names.
|
|
49
49
|
* @param model - The name of the group model, which must be in PascalCase.
|
|
50
50
|
* @param affinity - The type of object accepted and their model affinity.
|
|
51
51
|
* @param metadataMappings - The metadata mappings for the model, defaults to an empty object.
|
|
@@ -54,7 +54,7 @@ export declare class ModelsRegister {
|
|
|
54
54
|
* @param metadataGroups - Optional groups for organizing metadata, with localizations.
|
|
55
55
|
* @throws PluginImplementationError if the model name is not in PascalCase.
|
|
56
56
|
*/
|
|
57
|
-
registerGroup(
|
|
57
|
+
registerGroup(engineGroups: string[], model: string, affinity: GroupAffinity, metadataMappings?: MetadataMappings, defaultMetadata?: JSONObject, metadataDetails?: MetadataDetails, metadataGroups?: MetadataGroups): void;
|
|
58
58
|
registerMeasure(type: string, measureDefinition: MeasureDefinition): void;
|
|
59
59
|
private load;
|
|
60
60
|
}
|
|
@@ -8,7 +8,7 @@ interface ModelsControllerRequest {
|
|
|
8
8
|
export interface ApiModelGetAssetRequest extends ModelsControllerRequest {
|
|
9
9
|
action: "getAsset";
|
|
10
10
|
model: string;
|
|
11
|
-
|
|
11
|
+
engineGroups: string[];
|
|
12
12
|
}
|
|
13
13
|
export type ApiModelGetAssetResult = KDocument<AssetModelContent>;
|
|
14
14
|
export interface ApiModelGetDeviceRequest extends ModelsControllerRequest {
|
|
@@ -30,7 +30,7 @@ export type ApiModelGetMeasureResult = KDocument<MeasureModelContent>;
|
|
|
30
30
|
export interface ApiModelWriteAssetRequest extends ModelsControllerRequest {
|
|
31
31
|
action: "writeAsset";
|
|
32
32
|
body: {
|
|
33
|
-
|
|
33
|
+
engineGroups: string[];
|
|
34
34
|
model: string;
|
|
35
35
|
metadataDetails?: MetadataDetails;
|
|
36
36
|
metadataGroups?: MetadataGroups;
|
|
@@ -60,7 +60,7 @@ export interface ApiModelWriteGroupRequest extends ModelsControllerRequest {
|
|
|
60
60
|
action: "writeGroup";
|
|
61
61
|
body: {
|
|
62
62
|
affinity: GroupAffinity;
|
|
63
|
-
|
|
63
|
+
engineGroups: string[];
|
|
64
64
|
model: string;
|
|
65
65
|
metadataDetails?: MetadataDetails;
|
|
66
66
|
metadataGroups?: MetadataGroups;
|
|
@@ -85,7 +85,7 @@ export interface ApiModelWriteMeasureRequest extends ModelsControllerRequest {
|
|
|
85
85
|
export type ApiModelWriteMeasureResult = KDocument<MeasureModelContent>;
|
|
86
86
|
export interface ApiModelUpdateAssetRequest extends ModelsControllerRequest {
|
|
87
87
|
action: "updateAsset";
|
|
88
|
-
|
|
88
|
+
engineGroups: string[];
|
|
89
89
|
model: string;
|
|
90
90
|
body: {
|
|
91
91
|
metadataDetails?: MetadataDetails;
|
|
@@ -122,7 +122,7 @@ export interface ApiModelDeleteMeasureRequest extends ModelsControllerRequest {
|
|
|
122
122
|
export type ApiModelDeleteMeasureResult = void;
|
|
123
123
|
export interface ApiModelListAssetsRequest extends ModelsControllerRequest {
|
|
124
124
|
action: "listAssets";
|
|
125
|
-
|
|
125
|
+
engineGroups: string[];
|
|
126
126
|
}
|
|
127
127
|
export type ApiModelListAssetsResult = {
|
|
128
128
|
models: KDocument<AssetModelContent>[];
|
|
@@ -137,7 +137,7 @@ export type ApiModelListDevicesResult = {
|
|
|
137
137
|
};
|
|
138
138
|
export interface ApiModelListGroupsRequest extends ModelsControllerRequest {
|
|
139
139
|
action: "listGroups";
|
|
140
|
-
|
|
140
|
+
engineGroups: string[];
|
|
141
141
|
}
|
|
142
142
|
export type ApiModelListGroupsResult = {
|
|
143
143
|
models: KDocument<GroupModelContent>[];
|
|
@@ -153,7 +153,7 @@ export type ApiModelListMeasuresResult = {
|
|
|
153
153
|
};
|
|
154
154
|
export interface ApiModelSearchAssetsRequest extends ModelsControllerRequest {
|
|
155
155
|
action: "searchAssets";
|
|
156
|
-
|
|
156
|
+
engineGroups: string[];
|
|
157
157
|
from?: number;
|
|
158
158
|
size?: number;
|
|
159
159
|
scrollTTL?: string;
|
|
@@ -170,7 +170,7 @@ export interface ApiModelSearchDevicesRequest extends ModelsControllerRequest {
|
|
|
170
170
|
export type ApiModelSearchDevicesResult = SearchResult<KHit<DeviceModelContent>>;
|
|
171
171
|
export interface ApiModelSearchGroupsRequest extends ModelsControllerRequest {
|
|
172
172
|
action: "searchGroups";
|
|
173
|
-
|
|
173
|
+
engineGroups: string[];
|
|
174
174
|
from?: number;
|
|
175
175
|
size?: number;
|
|
176
176
|
scrollTTL?: string;
|
|
@@ -154,11 +154,11 @@ export interface TooltipModels {
|
|
|
154
154
|
}
|
|
155
155
|
export interface AssetModelContent extends KDocumentContent {
|
|
156
156
|
type: "asset";
|
|
157
|
-
|
|
157
|
+
engineGroups: string[];
|
|
158
158
|
/**
|
|
159
159
|
* Optional list of engine IDs (tenant IDs) this model is scoped to.
|
|
160
160
|
* When set, the model is only available to the specified tenants.
|
|
161
|
-
* When absent, the model is available to all tenants in the
|
|
161
|
+
* When absent, the model is available to all tenants in the engineGroups.
|
|
162
162
|
*/
|
|
163
163
|
engineIds?: string[];
|
|
164
164
|
asset: {
|
|
@@ -391,7 +391,7 @@ export interface DeviceModelContent extends KDocumentContent {
|
|
|
391
391
|
}
|
|
392
392
|
export interface GroupModelContent extends KDocumentContent {
|
|
393
393
|
type: "group";
|
|
394
|
-
|
|
394
|
+
engineGroups: string[];
|
|
395
395
|
group: {
|
|
396
396
|
/**
|
|
397
397
|
* Name of the model
|
|
@@ -23,7 +23,7 @@ export declare class DeviceManagerPlugin extends Plugin {
|
|
|
23
23
|
/**
|
|
24
24
|
* Register an asset model
|
|
25
25
|
*
|
|
26
|
-
* @param
|
|
26
|
+
* @param engineGroups Engine group names
|
|
27
27
|
* @param model Name of the asset model. Must follow a naming convention in PascalCase.
|
|
28
28
|
* @param definition Object containing the asset model definition, including:
|
|
29
29
|
* - measures: Array describing measure names and their types.
|
|
@@ -123,7 +123,7 @@ export declare class DeviceManagerPlugin extends Plugin {
|
|
|
123
123
|
* );
|
|
124
124
|
* ```
|
|
125
125
|
*/
|
|
126
|
-
registerAsset: (
|
|
126
|
+
registerAsset: (engineGroups: string[], model: string, definition: AssetModelDefinition) => void;
|
|
127
127
|
/**
|
|
128
128
|
* Register a device.
|
|
129
129
|
*
|
|
@@ -231,7 +231,7 @@ export declare class DeviceManagerPlugin extends Plugin {
|
|
|
231
231
|
* );
|
|
232
232
|
* ```
|
|
233
233
|
*/
|
|
234
|
-
registerGroup: (
|
|
234
|
+
registerGroup: (engineGroups: string[], model: string, definition: GroupModelDefinition) => void;
|
|
235
235
|
/**
|
|
236
236
|
* Register a new measure
|
|
237
237
|
*
|