kuzzle-device-manager-types 2.4.0-beta.4 → 2.4.0-beta.5

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.
@@ -33,6 +33,7 @@ export declare class AssetService {
33
33
  scroll?: string;
34
34
  lang?: string;
35
35
  }): Promise<SearchResult<KHit<AssetContent>>>;
36
+ migrateTenant(user: User, assetsList: string[], engineId: string, newEngineId: string): Promise<void>;
36
37
  /**
37
38
  * Replace an asset metadata
38
39
  */
@@ -17,4 +17,5 @@ export declare class AssetsController {
17
17
  getMeasures(request: KuzzleRequest): Promise<ApiAssetGetMeasuresResult>;
18
18
  exportMeasures(request: KuzzleRequest): Promise<any>;
19
19
  export(request: KuzzleRequest): Promise<any>;
20
+ migrateTenant(request: KuzzleRequest): Promise<void>;
20
21
  }
@@ -96,4 +96,13 @@ export interface ApiAssetExportRequest extends AssetsControllerRequest {
96
96
  export type ApiAssetExportResult = {
97
97
  link: string;
98
98
  };
99
+ export interface ApiAssetMigrateTenantRequest extends AssetsControllerRequest {
100
+ action: "migrateTenant";
101
+ engineId: string;
102
+ body: {
103
+ assetsList: string[];
104
+ newEngineId: string;
105
+ };
106
+ }
107
+ export type ApiAssetMigrateTenantResult = void;
99
108
  export {};
@@ -12,6 +12,7 @@ export declare class DeviceService {
12
12
  private get app();
13
13
  private get impersonatedSdk();
14
14
  constructor(plugin: Plugin);
15
+ registerAskEvents(): void;
15
16
  /**
16
17
  * Create a new device.
17
18
  *
@@ -2,6 +2,7 @@ import { User } from "kuzzle";
2
2
  import { KDocument } from "kuzzle-sdk";
3
3
  import { Metadata } from "../../../modules/shared";
4
4
  import { DeviceContent } from "./DeviceContent";
5
+ import { ApiDeviceLinkAssetRequest } from "./DeviceApi";
5
6
  export type EventDeviceUpdateBefore = {
6
7
  name: "device-manager:device:update:before";
7
8
  args: [{
@@ -19,6 +20,17 @@ export type EventDeviceUpdateAfter = {
19
20
  /**
20
21
  * @internal
21
22
  */
23
+ export type AskDeviceLinkAsset = {
24
+ name: "ask:device-manager:device:link-asset";
25
+ payload: {
26
+ engineId: string;
27
+ assetId: string;
28
+ deviceId: string;
29
+ user: User;
30
+ measureNames: ApiDeviceLinkAssetRequest["body"]["measureNames"];
31
+ };
32
+ result: void;
33
+ };
22
34
  export type AskDeviceUnlinkAsset = {
23
35
  name: "ask:device-manager:device:unlink-asset";
24
36
  payload: {
@@ -27,3 +39,20 @@ export type AskDeviceUnlinkAsset = {
27
39
  };
28
40
  result: void;
29
41
  };
42
+ export type AskDeviceDetachEngine = {
43
+ name: "ask:device-manager:device:detach-engine";
44
+ payload: {
45
+ deviceId: string;
46
+ user: User;
47
+ };
48
+ result: void;
49
+ };
50
+ export type AskDeviceAttachEngine = {
51
+ name: "ask:device-manager:device:attach-engine";
52
+ payload: {
53
+ engineId: string;
54
+ deviceId: string;
55
+ user: User;
56
+ };
57
+ result: void;
58
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This recovery queue has been made by the paas team here https://github.com/kuzzleio/paas-console/blob/master/apps/api/lib/api/RecoveryQueue.ts
3
+ * The RecoveryQueue allows you to store action to perform later and trigger
4
+ * all of it at once.
5
+ */
6
+ export declare class RecoveryQueue {
7
+ private actions;
8
+ constructor();
9
+ /**
10
+ * The addRecovery function adds a recovery function to an array of actions.
11
+ * @param {any} func - The `func` parameter is a function that you want to add to the `actions` array.
12
+ */
13
+ addRecovery(func: any): void;
14
+ /**
15
+ * The "reset" function clears the "actions" array.
16
+ */
17
+ reset(): void;
18
+ /**
19
+ * The `rollback` function iterates through a list of actions in reverse order and attempts to execute
20
+ * each action, logging any errors encountered.
21
+ */
22
+ rollback(): Promise<void>;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kuzzle-device-manager-types",
3
- "version": "2.4.0-beta.4",
3
+ "version": "2.4.0-beta.5",
4
4
  "description": "Shared types for Kuzzle Device Manager",
5
5
  "author": "The Kuzzle Team (support@kuzzle.io)",
6
6
  "main": "index.js",