kuzzle-device-manager-types 3.0.0-3-dev.23 → 3.0.0-3-dev.24
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/AssetModule.d.ts +2 -2
- package/dist/lib/modules/asset/AssetService.d.ts +4 -0
- package/dist/lib/modules/asset/AssetsController.d.ts +1 -1
- package/dist/lib/modules/decoder/DecoderModule.d.ts +1 -1
- package/dist/lib/modules/decoder/DecodersController.d.ts +2 -2
- package/dist/lib/modules/decoder/DecodersRegister.d.ts +1 -1
- package/dist/lib/modules/decoder/PayloadService.d.ts +7 -1
- package/dist/lib/modules/decoder/PayloadsController.d.ts +2 -2
- package/dist/lib/modules/device/DeviceModule.d.ts +1 -1
- package/dist/lib/modules/device/DeviceService.d.ts +8 -1
- package/dist/lib/modules/device/DevicesController.d.ts +4 -4
- package/dist/lib/modules/group/GroupsController.d.ts +3 -3
- package/dist/lib/modules/group/GroupsModule.d.ts +1 -1
- package/dist/lib/modules/group/GroupsService.d.ts +12 -0
- package/dist/lib/modules/group/groupPath.d.ts +23 -0
- package/dist/lib/modules/measure/MeasureModule.d.ts +1 -1
- package/dist/lib/modules/measure/MeasureValidationError.d.ts +1 -1
- package/dist/lib/modules/model/MappingsConflictsError.d.ts +1 -1
- package/dist/lib/modules/model/MeasuresNamesDuplicatesError.d.ts +1 -1
- package/dist/lib/modules/model/ModelModule.d.ts +1 -1
- package/dist/lib/modules/model/ModelSerializer.d.ts +3 -0
- package/dist/lib/modules/model/ModelService.d.ts +5 -0
- package/dist/lib/modules/model/ModelsController.d.ts +2 -1
- package/dist/lib/modules/model/ModelsRegister.d.ts +5 -5
- package/dist/lib/modules/plugin/DeviceManagerEngine.d.ts +20 -3
- package/dist/lib/modules/shared/Module.d.ts +1 -1
- package/dist/lib/modules/shared/errors/SchemaValidationError.d.ts +1 -1
- package/dist/lib/modules/shared/services/BaseService.d.ts +14 -1
- package/dist/lib/modules/shared/services/DigitalTwinExporter.d.ts +10 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ export declare class AssetModule extends Module {
|
|
|
4
4
|
private assetService;
|
|
5
5
|
private assetHistoryService;
|
|
6
6
|
private assetController;
|
|
7
|
-
private logger;
|
|
7
|
+
private readonly logger;
|
|
8
8
|
constructor(plugin: DeviceManagerPlugin);
|
|
9
|
-
init():
|
|
9
|
+
init(): void;
|
|
10
10
|
}
|
|
@@ -28,7 +28,7 @@ export declare class AssetsController {
|
|
|
28
28
|
* @param indexId The asset index
|
|
29
29
|
* @param assetId The target asset ID
|
|
30
30
|
* @param measureName The measureName to get the type from
|
|
31
|
-
* @param
|
|
31
|
+
* @param request The ingestion request, whose user must see the asset
|
|
32
32
|
* @returns The measure type if used in the asset, null otherwise
|
|
33
33
|
* @throws If the asset does not exists
|
|
34
34
|
*/
|
|
@@ -4,8 +4,8 @@ import { PayloadService } from "./PayloadService";
|
|
|
4
4
|
import { ApiDecoderListResult, ApiDecoderPrunePayloadsResult } from "./types/DecoderApi";
|
|
5
5
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
6
6
|
export declare class DecodersController {
|
|
7
|
-
private payloadService;
|
|
8
|
-
private decodersRegister;
|
|
7
|
+
private readonly payloadService;
|
|
8
|
+
private readonly decodersRegister;
|
|
9
9
|
definition: ControllerDefinition;
|
|
10
10
|
readonly logger: KuzzleLogger;
|
|
11
11
|
constructor(payloadService: PayloadService, decodersRegister: DecodersRegister, logger: KuzzleLogger);
|
|
@@ -8,7 +8,7 @@ import { Decoder } from "./Decoder";
|
|
|
8
8
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
9
9
|
export declare class PayloadService extends BaseService {
|
|
10
10
|
readonly logger: KuzzleLogger;
|
|
11
|
-
private provisioningStrategy;
|
|
11
|
+
private readonly provisioningStrategy;
|
|
12
12
|
constructor(plugin: DeviceManagerPlugin, logger: KuzzleLogger);
|
|
13
13
|
/**
|
|
14
14
|
* Process a payload by validating and decode it with the `decoder` associated
|
|
@@ -22,6 +22,12 @@ export declare class PayloadService extends BaseService {
|
|
|
22
22
|
receiveFormated(device: KDocument<DeviceContent>, measurements: DecodedMeasurement[], { payloadUuids }?: {
|
|
23
23
|
payloadUuids?: string[];
|
|
24
24
|
}): Promise<void>;
|
|
25
|
+
private ingestDecodedDevice;
|
|
26
|
+
/**
|
|
27
|
+
* Ingest measurements of a device attached to an engine: measures linked to
|
|
28
|
+
* an asset go to that asset, the remaining ones to the device only.
|
|
29
|
+
*/
|
|
30
|
+
private ingestEngineMeasurements;
|
|
25
31
|
/**
|
|
26
32
|
* Method used to save the payload and catch + log the error if any.
|
|
27
33
|
*
|
|
@@ -4,8 +4,8 @@ import { PayloadService } from "./PayloadService";
|
|
|
4
4
|
import { ApiPayloadReceiveUnkownResult } from "./types/PayloadApi";
|
|
5
5
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
6
6
|
export declare class PayloadsController {
|
|
7
|
-
private payloadService;
|
|
8
|
-
private decodersRegister;
|
|
7
|
+
private readonly payloadService;
|
|
8
|
+
private readonly decodersRegister;
|
|
9
9
|
readonly logger: KuzzleLogger;
|
|
10
10
|
definition: ControllerDefinition;
|
|
11
11
|
constructor(payloadService: PayloadService, decodersRegister: DecodersRegister, logger: KuzzleLogger);
|
|
@@ -59,9 +59,16 @@ export declare class DeviceService extends DigitalTwinService {
|
|
|
59
59
|
* @param {string} deviceId Id of the device
|
|
60
60
|
* @param {KuzzleRequest} request kuzzle request
|
|
61
61
|
*/
|
|
62
|
-
detachEngine(deviceId: string, request: KuzzleRequest
|
|
62
|
+
detachEngine(deviceId: string, request: KuzzleRequest, { checkRights }?: {
|
|
63
|
+
checkRights?: boolean;
|
|
64
|
+
}): Promise<KDocument<DeviceProvisioningContent>>;
|
|
65
|
+
private _removeDeviceFromAssetLinks;
|
|
63
66
|
receiveMeasures(index: string, deviceId: string, measures: DecodedMeasurement[], payloadUuids: string[], request: KuzzleRequest): Promise<void>;
|
|
64
67
|
private checkEngineExists;
|
|
68
|
+
/**
|
|
69
|
+
* The reference is part of the device id, which is used in the API routes
|
|
70
|
+
*/
|
|
71
|
+
private checkReference;
|
|
65
72
|
private checkAttachedToEngine;
|
|
66
73
|
private refreshModel;
|
|
67
74
|
}
|
|
@@ -4,11 +4,11 @@ import { DeviceService } from "./DeviceService";
|
|
|
4
4
|
import { ApiDeviceAttachEngineResult, ApiDeviceCreateResult, ApiDeviceDeleteResult, ApiDeviceDetachEngineResult, ApiDeviceGetResult, ApiDeviceLinkAssetsResult, ApiDeviceSearchResult, ApiDeviceUnlinkAssetsResult, ApiDeviceUpdateResult, ApiDeviceGetMeasuresResult, ApiDeviceUpsertResult, ApiDeviceGetLastMeasuresResult, ApiDeviceMGetLastMeasuresResult, ApiDeviceGetLastMeasuredAtResult, ApiDeviceMGetLastMeasuredAtResult, ApiDeviceMetadataReplaceResult, ApiDeviceUpdateMeasureSlotDisplayNameResult } from "./types/DeviceApi";
|
|
5
5
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
6
6
|
export declare class DevicesController {
|
|
7
|
-
private plugin;
|
|
8
|
-
private deviceService;
|
|
7
|
+
private readonly plugin;
|
|
8
|
+
private readonly deviceService;
|
|
9
9
|
definition: ControllerDefinition;
|
|
10
|
-
private exporter;
|
|
11
|
-
private measureExporter;
|
|
10
|
+
private readonly exporter;
|
|
11
|
+
private readonly measureExporter;
|
|
12
12
|
readonly logger: KuzzleLogger;
|
|
13
13
|
constructor(plugin: DeviceManagerPlugin, deviceService: DeviceService, logger: KuzzleLogger);
|
|
14
14
|
get(request: KuzzleRequest): Promise<ApiDeviceGetResult>;
|
|
@@ -4,8 +4,8 @@ import { ApiGroupAddAssetsResult, ApiGroupAddDevicesResult, ApiGroupCreateResult
|
|
|
4
4
|
import { GroupsService } from "./GroupsService";
|
|
5
5
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
6
6
|
export declare class GroupsController {
|
|
7
|
-
private plugin;
|
|
8
|
-
private groupsService;
|
|
7
|
+
private readonly plugin;
|
|
8
|
+
private readonly groupsService;
|
|
9
9
|
definition: ControllerDefinition;
|
|
10
10
|
readonly logger: KuzzleLogger;
|
|
11
11
|
constructor(plugin: DeviceManagerPlugin, groupsService: GroupsService, logger: KuzzleLogger);
|
|
@@ -19,7 +19,7 @@ export declare class GroupsController {
|
|
|
19
19
|
* @returns {void}
|
|
20
20
|
*/
|
|
21
21
|
checkPath(index: string, path: GroupsBodyRequest["path"], groupId?: string): Promise<void>;
|
|
22
|
-
checkGroupName(index: string, name: GroupsBodyRequest["name"],
|
|
22
|
+
checkGroupName(index: string, name: GroupsBodyRequest["name"], groupId?: string): Promise<void>;
|
|
23
23
|
create(request: KuzzleRequest): Promise<ApiGroupCreateResult>;
|
|
24
24
|
get(request: KuzzleRequest): Promise<ApiGroupGetResult>;
|
|
25
25
|
upsert(request: KuzzleRequest): Promise<ApiGroupUpsertResult>;
|
|
@@ -17,6 +17,16 @@ export declare class GroupsService extends BaseService {
|
|
|
17
17
|
create(_id: string, index: string, metadata: JSONObject, model: string, name: string, path: string, request: KuzzleRequest): Promise<KDocument<GroupContent>>;
|
|
18
18
|
get(index: string, _id: string, request: KuzzleRequest): Promise<import("kuzzle").KDocument<GroupContent>>;
|
|
19
19
|
update(request: KuzzleRequest, _id: string, index: string, name?: string, metadata?: Metadata): Promise<import("kuzzle").KDocument<GroupContent>>;
|
|
20
|
+
/**
|
|
21
|
+
* Fetches every document matching the query, the default search size (10)
|
|
22
|
+
* would miss documents
|
|
23
|
+
*/
|
|
24
|
+
private _searchAll;
|
|
25
|
+
/**
|
|
26
|
+
* Makes the latest writes (e.g. items just added to a group) visible to
|
|
27
|
+
* the subtree searches
|
|
28
|
+
*/
|
|
29
|
+
private _refreshGroupCollections;
|
|
20
30
|
private _updatePath;
|
|
21
31
|
moveGroup(index: string, _id: string, targetGroupId: string | null, request: KuzzleRequest): Promise<{
|
|
22
32
|
group: KDocument<GroupContent>;
|
|
@@ -121,5 +131,7 @@ export declare class GroupsService extends BaseService {
|
|
|
121
131
|
name: string;
|
|
122
132
|
path: string;
|
|
123
133
|
}>, request: KuzzleRequest): Promise<ApiGroupMUpsertResult>;
|
|
134
|
+
private buildGroupDocument;
|
|
135
|
+
private toGroupCreationError;
|
|
124
136
|
private _update;
|
|
125
137
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSONObject } from "kuzzle-sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Group paths are the ids of the ancestors joined by ".", so a plain string
|
|
4
|
+
* prefix would also match siblings sharing the same id start
|
|
5
|
+
* (e.g. "parent.quai-1" is a string prefix of "parent.quai-10").
|
|
6
|
+
* Subtree checks must always include the separator.
|
|
7
|
+
*/
|
|
8
|
+
export declare const GROUP_PATH_SEPARATOR = ".";
|
|
9
|
+
/**
|
|
10
|
+
* Whether `path` is the group `groupPath` itself or one of its descendants
|
|
11
|
+
*/
|
|
12
|
+
export declare function isInSubtree(path: string, groupPath: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Replaces the leading `oldPath` of a path of its subtree by `newPath`
|
|
15
|
+
*/
|
|
16
|
+
export declare function rebasePath(path: string, oldPath: string, newPath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Elasticsearch query matching the documents whose `field` (a keyword) is in
|
|
19
|
+
* the subtree of `groupPath`
|
|
20
|
+
*/
|
|
21
|
+
export declare function subtreeQuery(field: string, groupPath: string, { includeSelf }?: {
|
|
22
|
+
includeSelf?: boolean;
|
|
23
|
+
}): JSONObject;
|
|
@@ -5,7 +5,7 @@ export interface MeasureValidationChunks {
|
|
|
5
5
|
validationErrors: ErrorObject[];
|
|
6
6
|
}
|
|
7
7
|
export declare class MeasureValidationError extends KuzzleError {
|
|
8
|
-
private errors;
|
|
8
|
+
private readonly errors;
|
|
9
9
|
constructor(message: string, errors: MeasureValidationChunks[], id?: string, code?: number);
|
|
10
10
|
get name(): string;
|
|
11
11
|
toJSON(): import("kuzzle").JSONObject;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KuzzleError } from "kuzzle";
|
|
2
2
|
import { ConflictChunk } from "./ModelsConflicts";
|
|
3
3
|
export declare class MappingsConflictsError extends KuzzleError {
|
|
4
|
-
private conflicts;
|
|
4
|
+
private readonly conflicts;
|
|
5
5
|
constructor(message: string, conflicts: ConflictChunk[], id?: string, code?: number);
|
|
6
6
|
get name(): string;
|
|
7
7
|
toJSON(): import("kuzzle").JSONObject;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KuzzleError } from "kuzzle";
|
|
2
2
|
export declare class MeasuresNamesDuplicatesError extends KuzzleError {
|
|
3
|
-
private duplicates;
|
|
3
|
+
private readonly duplicates;
|
|
4
4
|
constructor(message: string, duplicates: string[], id?: string, code?: number);
|
|
5
5
|
get name(): string;
|
|
6
6
|
toJSON(): import("kuzzle").JSONObject;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ModelContent } from "./types/ModelContent";
|
|
2
2
|
export declare class ModelSerializer {
|
|
3
3
|
static id<T extends ModelContent>(type: string, model: T): string;
|
|
4
|
+
private static assetId;
|
|
5
|
+
private static groupId;
|
|
6
|
+
private static measureId;
|
|
4
7
|
static title<T extends ModelContent>(type: string, model: T): string;
|
|
5
8
|
}
|
|
@@ -39,6 +39,11 @@ export declare class ModelService extends BaseService {
|
|
|
39
39
|
private checkModelsConflicts;
|
|
40
40
|
private checkDefaultValues;
|
|
41
41
|
private checkGroupAffinity;
|
|
42
|
+
private validateAssetModel;
|
|
43
|
+
/**
|
|
44
|
+
* Anti-shadowing: rejects the model if one with the same name exists at a different scope level
|
|
45
|
+
*/
|
|
46
|
+
private checkAssetModelScope;
|
|
42
47
|
writeAsset(tenantClasses: string[], model: string, metadataMappings: MetadataMappings, defaultMetadata: JSONObject, metadataDetails: MetadataDetails, metadataGroups: MetadataGroups, measures: NamedMeasures, tooltipModels: TooltipModels, locales: {
|
|
43
48
|
[valueName: string]: LocaleDetails;
|
|
44
49
|
}, indexes?: string[], icon?: string): Promise<KDocument<AssetModelContent>>;
|
|
@@ -3,7 +3,7 @@ import { ModelService } from "./ModelService";
|
|
|
3
3
|
import { ApiModelWriteAssetResult, ApiModelWriteDeviceResult, ApiModelWriteMeasureResult, ApiModelUpdateAssetResult, ApiModelDeleteAssetResult, ApiModelDeleteDeviceResult, ApiModelDeleteMeasureResult, ApiModelListAssetsResult, ApiModelListDevicesResult, ApiModelListMeasuresResult, ApiModelGetAssetResult, ApiModelGetDeviceResult, ApiModelGetMeasureResult, ApiModelSearchAssetsResult, ApiModelSearchDevicesResult, ApiModelSearchMeasuresResult, ApiModelDeleteGroupResult, ApiModelGetGroupResult, ApiModelListGroupsResult, ApiModelSearchGroupsResult, ApiModelWriteGroupResult, ApiModelUpdateGroupResult, ApiModelUpdateDeviceResult, ApiModelGetMetadataReferentialResult, ApiModelWriteMetadataResult, ApiModelDeleteMetadataResult } from "./types/ModelApi";
|
|
4
4
|
import { KuzzleLogger } from "kuzzle-logger";
|
|
5
5
|
export declare class ModelsController {
|
|
6
|
-
private modelService;
|
|
6
|
+
private readonly modelService;
|
|
7
7
|
definition: ControllerDefinition;
|
|
8
8
|
readonly logger: KuzzleLogger;
|
|
9
9
|
constructor(modelService: ModelService, logger: KuzzleLogger);
|
|
@@ -20,6 +20,7 @@ export declare class ModelsController {
|
|
|
20
20
|
deleteGroup(request: KuzzleRequest): Promise<ApiModelDeleteGroupResult>;
|
|
21
21
|
deleteMeasure(request: KuzzleRequest): Promise<ApiModelDeleteMeasureResult>;
|
|
22
22
|
listAssets(request: KuzzleRequest): Promise<ApiModelListAssetsResult>;
|
|
23
|
+
private checkEngineAndTenantClasses;
|
|
23
24
|
listDevices(request: KuzzleRequest): Promise<ApiModelListDevicesResult>;
|
|
24
25
|
listGroups(request: KuzzleRequest): Promise<ApiModelListGroupsResult>;
|
|
25
26
|
listMeasures(request: KuzzleRequest): Promise<ApiModelListMeasuresResult>;
|
|
@@ -6,11 +6,11 @@ import { JSONObject } from "kuzzle-sdk";
|
|
|
6
6
|
export declare class ModelsRegister {
|
|
7
7
|
private config;
|
|
8
8
|
private context;
|
|
9
|
-
private assetModels;
|
|
10
|
-
private deviceModels;
|
|
11
|
-
private groupModels;
|
|
12
|
-
private measureModels;
|
|
13
|
-
private metadataReferential;
|
|
9
|
+
private readonly assetModels;
|
|
10
|
+
private readonly deviceModels;
|
|
11
|
+
private readonly groupModels;
|
|
12
|
+
private readonly measureModels;
|
|
13
|
+
private readonly metadataReferential;
|
|
14
14
|
private logger;
|
|
15
15
|
private get sdk();
|
|
16
16
|
init(plugin: DeviceManagerPlugin): void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Backend, KDocumentContent, Plugin } from "kuzzle";
|
|
2
2
|
import { AbstractEngine, ConfigManager, EngineContent } from "kuzzle-plugin-commons";
|
|
3
|
+
import { JSONObject } from "kuzzle-sdk";
|
|
3
4
|
import { AssetModelContent, DeviceModelContent, GroupModelContent, MeasureModelContent } from "../model";
|
|
4
5
|
import { DeviceManagerPlugin } from "./DeviceManagerPlugin";
|
|
5
6
|
import { DeviceManagerConfiguration } from "./types/DeviceManagerConfiguration";
|
|
@@ -55,6 +56,22 @@ export declare class DeviceManagerEngine extends AbstractEngine<DeviceManagerPlu
|
|
|
55
56
|
config: DeviceManagerConfiguration;
|
|
56
57
|
get app(): Backend;
|
|
57
58
|
constructor(plugin: Plugin, platformConfigManager: ConfigManager, engineConfigManager: ConfigManager);
|
|
59
|
+
private resolveModels;
|
|
60
|
+
/**
|
|
61
|
+
* Return conflicts of new twin models, first against the platform models,
|
|
62
|
+
* then against the models and the actual mappings of every engine
|
|
63
|
+
*/
|
|
64
|
+
private getTwinUpdateConflicts;
|
|
65
|
+
/**
|
|
66
|
+
* Return conflicts of new twin models applicable to an engine, against the engine
|
|
67
|
+
* models and the actual mappings of its collection
|
|
68
|
+
*/
|
|
69
|
+
private getEngineTwinConflicts;
|
|
70
|
+
/**
|
|
71
|
+
* Return conflicts of new group models, against the platform group models
|
|
72
|
+
* then against the actual mappings of every engine groups collection
|
|
73
|
+
*/
|
|
74
|
+
private getGroupsUpdateConflicts;
|
|
58
75
|
/**
|
|
59
76
|
* Returns the actual metadata mappings of an engine collection
|
|
60
77
|
*
|
|
@@ -113,10 +130,10 @@ export declare class DeviceManagerEngine extends AbstractEngine<DeviceManagerPlu
|
|
|
113
130
|
getEngines(): Promise<EngineDocument[]>;
|
|
114
131
|
updateMeasuresSchema(): Promise<void>;
|
|
115
132
|
onCreate(index: string, tenantClass?: string): Promise<{
|
|
116
|
-
collections:
|
|
133
|
+
collections: string[];
|
|
117
134
|
}>;
|
|
118
135
|
onUpdate(index: string, tenantClass?: string): Promise<{
|
|
119
|
-
collections:
|
|
136
|
+
collections: InternalCollection[];
|
|
120
137
|
}>;
|
|
121
138
|
onDelete(index: string): Promise<{
|
|
122
139
|
collections: InternalCollection[];
|
|
@@ -217,7 +234,7 @@ export declare class DeviceManagerEngine extends AbstractEngine<DeviceManagerPlu
|
|
|
217
234
|
* @returns The complete ES mappings produced by merging models mappings
|
|
218
235
|
*/
|
|
219
236
|
private getMeasuresMappings;
|
|
220
|
-
getAssetGroupsMappingFromDB(): Promise<
|
|
237
|
+
getAssetGroupsMappingFromDB(): Promise<JSONObject>;
|
|
221
238
|
/**
|
|
222
239
|
* Retrieve a certain type of models associated to an engine
|
|
223
240
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ErrorObject } from "ajv";
|
|
2
2
|
import { KuzzleError } from "kuzzle";
|
|
3
3
|
export declare class SchemaValidationError extends KuzzleError {
|
|
4
|
-
private schemaErrors;
|
|
4
|
+
private readonly schemaErrors;
|
|
5
5
|
constructor(message: string, schemaErrors: ErrorObject[], id?: string, code?: number);
|
|
6
6
|
get name(): string;
|
|
7
7
|
toJSON(): import("kuzzle").JSONObject;
|
|
@@ -6,12 +6,25 @@ interface PayloadRequest {
|
|
|
6
6
|
}
|
|
7
7
|
export type SearchParams = ReturnType<KuzzleRequest["getSearchParams"]>;
|
|
8
8
|
export declare abstract class BaseService {
|
|
9
|
-
private plugin;
|
|
9
|
+
private readonly plugin;
|
|
10
10
|
constructor(plugin: DeviceManagerPlugin);
|
|
11
11
|
protected get app(): Backend;
|
|
12
12
|
protected get sdk(): EmbeddedSDK;
|
|
13
13
|
protected get config(): DeviceManagerConfiguration;
|
|
14
14
|
protected get impersonatedSdk(): (user: User) => EmbeddedSDK;
|
|
15
|
+
/**
|
|
16
|
+
* Tells whether the request user may run the request action on the given
|
|
17
|
+
* engine.
|
|
18
|
+
*
|
|
19
|
+
* Needed for actions without an index argument (e.g. detachEngine): Kuzzle
|
|
20
|
+
* ignores the index restrictions of the user profiles for them.
|
|
21
|
+
*/
|
|
22
|
+
protected isAllowedOnEngine(index: string, request: KuzzleRequest): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Throws if the request user may not run the request action on the given
|
|
25
|
+
* engine.
|
|
26
|
+
*/
|
|
27
|
+
protected checkEngineRights(index: string, request: KuzzleRequest): Promise<void>;
|
|
15
28
|
/**
|
|
16
29
|
* Returns a request of its own for a document operation: the
|
|
17
30
|
* generic:document events see the index and collection written to, while
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
+
import { KuzzleRequest, User } from "kuzzle";
|
|
3
4
|
import { UUID } from "node:crypto";
|
|
4
5
|
import { DeviceManagerPlugin, InternalCollection } from "../../plugin";
|
|
5
|
-
import { AbstractExporter, ExporterOption } from "./AbstractExporter";
|
|
6
|
+
import { AbstractExporter, ExporterOption, ExportParams } from "./AbstractExporter";
|
|
6
7
|
export declare class DigitalTwinExporter extends AbstractExporter {
|
|
7
8
|
protected plugin: DeviceManagerPlugin;
|
|
8
9
|
protected target: InternalCollection;
|
|
9
10
|
constructor(plugin: DeviceManagerPlugin, target: InternalCollection, config?: Partial<ExporterOption>);
|
|
10
11
|
protected exportRedisKey(index: string, exportId: string): string;
|
|
11
12
|
protected getLink(index: string, exportId: UUID): string;
|
|
13
|
+
/**
|
|
14
|
+
* Prepare an export of the digital twins matching the search.
|
|
15
|
+
*
|
|
16
|
+
* The search goes through the same "generic:document:beforeSearch" pipe as the
|
|
17
|
+
* search action of the request controller, so the export only contains the
|
|
18
|
+
* digital twins the user can search.
|
|
19
|
+
*/
|
|
20
|
+
prepareExport(index: string, user: User, params: ExportParams, request?: KuzzleRequest): Promise<string>;
|
|
12
21
|
sendExport(index: string, exportId: string): Promise<import("stream").PassThrough>;
|
|
13
22
|
/**
|
|
14
23
|
* Get the deduplicated Named Measures get from models
|