kuzzle-device-manager-types 2.12.0-dev.1 → 2.12.0-dev.2
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 +4 -2
- package/dist/lib/modules/device/types/DeviceEvents.d.ts +7 -5
- package/dist/lib/modules/measure/MeasureExporter.d.ts +3 -2
- package/dist/lib/modules/shared/services/AbstractExporter.d.ts +4 -2
- package/dist/lib/modules/shared/services/BaseService.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { KuzzleRequest
|
|
1
|
+
import { KuzzleRequest } from "kuzzle";
|
|
2
|
+
type BackendUser = ReturnType<KuzzleRequest["getUser"]>;
|
|
2
3
|
import { JSONObject, KDocument, KHit, SearchResult, mReplaceResponse } from "kuzzle-sdk";
|
|
3
4
|
import { DeviceManagerPlugin } from "../plugin";
|
|
4
5
|
import { DigitalTwinService, Metadata, SearchParams } from "../shared";
|
|
@@ -34,7 +35,7 @@ export declare class AssetService extends DigitalTwinService {
|
|
|
34
35
|
*/
|
|
35
36
|
delete(engineId: string, assetId: string, request: KuzzleRequest): Promise<void>;
|
|
36
37
|
search(engineId: string, searchParams: SearchParams, request: KuzzleRequest): Promise<SearchResult<KHit<AssetContent>>>;
|
|
37
|
-
migrateTenant(user:
|
|
38
|
+
migrateTenant(user: BackendUser, assetsList: string[], engineId: string, newEngineId: string): Promise<ApiAssetMigrateTenantResult>;
|
|
38
39
|
/**
|
|
39
40
|
* Replace an asset metadata
|
|
40
41
|
*/
|
|
@@ -50,3 +51,4 @@ export declare class AssetService extends DigitalTwinService {
|
|
|
50
51
|
updateModelLocales(request: KuzzleRequest, model: string): Promise<ApiAssetUpdateModelLocales[]>;
|
|
51
52
|
private refreshModel;
|
|
52
53
|
}
|
|
54
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KuzzleRequest } from "kuzzle";
|
|
2
2
|
import { KDocument } from "kuzzle-sdk";
|
|
3
|
+
type BackendUser = ReturnType<KuzzleRequest["getUser"]>;
|
|
3
4
|
import { Metadata } from "../../../modules/shared";
|
|
4
5
|
import { DeviceContent } from "./DeviceContent";
|
|
5
6
|
import { ApiDeviceLinkAssetRequest } from "./DeviceApi";
|
|
@@ -26,7 +27,7 @@ export type AskDeviceLinkAsset = {
|
|
|
26
27
|
engineId: string;
|
|
27
28
|
assetId: string;
|
|
28
29
|
deviceId: string;
|
|
29
|
-
user:
|
|
30
|
+
user: BackendUser;
|
|
30
31
|
measureNames: ApiDeviceLinkAssetRequest["body"]["measureNames"];
|
|
31
32
|
};
|
|
32
33
|
result: void;
|
|
@@ -35,7 +36,7 @@ export type AskDeviceUnlinkAsset = {
|
|
|
35
36
|
name: "ask:device-manager:device:unlink-asset";
|
|
36
37
|
payload: {
|
|
37
38
|
deviceId: string;
|
|
38
|
-
user:
|
|
39
|
+
user: BackendUser;
|
|
39
40
|
};
|
|
40
41
|
result: void;
|
|
41
42
|
};
|
|
@@ -43,7 +44,7 @@ export type AskDeviceDetachEngine = {
|
|
|
43
44
|
name: "ask:device-manager:device:detach-engine";
|
|
44
45
|
payload: {
|
|
45
46
|
deviceId: string;
|
|
46
|
-
user:
|
|
47
|
+
user: BackendUser;
|
|
47
48
|
};
|
|
48
49
|
result: void;
|
|
49
50
|
};
|
|
@@ -52,7 +53,8 @@ export type AskDeviceAttachEngine = {
|
|
|
52
53
|
payload: {
|
|
53
54
|
engineId: string;
|
|
54
55
|
deviceId: string;
|
|
55
|
-
user:
|
|
56
|
+
user: BackendUser;
|
|
56
57
|
};
|
|
57
58
|
result: void;
|
|
58
59
|
};
|
|
60
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import { KHit,
|
|
3
|
+
import { KHit, KuzzleRequest } from "kuzzle";
|
|
4
|
+
type BackendUser = ReturnType<KuzzleRequest["getUser"]>;
|
|
4
5
|
import { UUID } from "node:crypto";
|
|
5
6
|
import { AbstractExporter, Column, ExportParams } from "../shared";
|
|
6
7
|
import { MeasureContent } from "./exports";
|
|
@@ -37,7 +38,7 @@ export declare class MeasureExporter extends AbstractExporter<MeasureExportParam
|
|
|
37
38
|
*
|
|
38
39
|
* Never return a rejected promise and write potential error on the stream
|
|
39
40
|
*/
|
|
40
|
-
prepareExport(engineId: string, user:
|
|
41
|
+
prepareExport(engineId: string, user: BackendUser, params: MeasureSearchParams): Promise<string>;
|
|
41
42
|
protected formatHit(columns: Array<Column & {
|
|
42
43
|
shouldCheckName: boolean;
|
|
43
44
|
name: string;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import { UUID } from "node:crypto";
|
|
4
4
|
import { PassThrough, Readable } from "node:stream";
|
|
5
|
-
import { JSONObject, KDocumentContentGeneric, KHit, SearchResult,
|
|
5
|
+
import { JSONObject, KDocumentContentGeneric, KHit, SearchResult, KuzzleRequest } from "kuzzle";
|
|
6
|
+
type BackendUser = ReturnType<KuzzleRequest["getUser"]>;
|
|
6
7
|
import { EngineContent } from "kuzzle-plugin-commons";
|
|
7
8
|
import { DeviceManagerPlugin, InternalCollection } from "../../plugin";
|
|
8
9
|
export interface ExporterOption {
|
|
@@ -40,8 +41,9 @@ export declare abstract class AbstractExporter<P extends ExportParams = ExportPa
|
|
|
40
41
|
* the stream.
|
|
41
42
|
*/
|
|
42
43
|
abstract sendExport(engineId: string, exportId: string): Promise<Readable>;
|
|
43
|
-
prepareExport(engineId: string, user:
|
|
44
|
+
prepareExport(engineId: string, user: BackendUser, params: P): Promise<string>;
|
|
44
45
|
protected formatHit(columns: Column[], hit: KHit<KDocumentContentGeneric>): string[];
|
|
45
46
|
getExport(engineId: string, exportId: string): Promise<P>;
|
|
46
47
|
getExportStream(request: SearchResult<KHit<KDocumentContentGeneric>>, columns: Column[]): Promise<PassThrough>;
|
|
47
48
|
}
|
|
49
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ArgsDocumentControllerCreate, ArgsDocumentControllerDelete, ArgsDocumentControllerUpdate, Backend, EmbeddedSDK, KDocument, KDocumentContent, KHit, KuzzleRequest, SearchResult
|
|
1
|
+
import { ArgsDocumentControllerCreate, ArgsDocumentControllerDelete, ArgsDocumentControllerUpdate, Backend, EmbeddedSDK, KDocument, KDocumentContent, KHit, KuzzleRequest, SearchResult } from "kuzzle";
|
|
2
|
+
type BackendUser = ReturnType<KuzzleRequest["getUser"]>;
|
|
2
3
|
import { DeviceManagerPlugin, DeviceManagerConfiguration, InternalCollection } from "../../plugin";
|
|
3
4
|
interface PayloadRequest {
|
|
4
5
|
collection: InternalCollection;
|
|
@@ -11,7 +12,7 @@ export declare abstract class BaseService {
|
|
|
11
12
|
protected get app(): Backend;
|
|
12
13
|
protected get sdk(): EmbeddedSDK;
|
|
13
14
|
protected get config(): DeviceManagerConfiguration;
|
|
14
|
-
protected get impersonatedSdk(): (user:
|
|
15
|
+
protected get impersonatedSdk(): (user: BackendUser) => EmbeddedSDK;
|
|
15
16
|
protected normalizeKuzzleRequest(request: KuzzleRequest, { collection, engineId }: PayloadRequest): KuzzleRequest;
|
|
16
17
|
/**
|
|
17
18
|
* Wrapper to SDK create method with trigger generic:document events
|