@or-sdk/flows 0.26.1-beta.424.0 → 0.27.0-beta.427.0

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.
@@ -1,22 +1,98 @@
1
- import { List } from '@or-sdk/base';
2
- import { GraphqlResponseCheckExecution } from '@or-sdk/data-hub';
3
- import { Flow, PollingResultActivateSuccess, PollingResultDeactivateSuccess, StepTemplateRaw } from '@or-sdk/deployer';
4
- import { FlowsConfig, ListFlowsParams, StepTemplateToDelete } from './types';
5
- import { Taggable } from '@or-sdk/tags';
6
- export declare class Flows implements Taggable<Flow> {
7
- private readonly dataHub;
8
- private readonly deployer;
9
- private readonly tags;
1
+ import { Base, List } from '@or-sdk/base';
2
+ import { Flow, StepTemplateRaw } from '@or-sdk/deployer';
3
+ import { FlowsConfig, ListFlowsParams, StepTemplateToDelete, ActivateFlowParams, DeactivageFlowParams } from './types';
4
+ export declare class Flows extends Base {
5
+ sdkApiUrl?: string;
6
+ deployerUrl?: string;
10
7
  constructor(params: FlowsConfig);
11
8
  init(): Promise<void>;
9
+ deleteFlow(flow: {
10
+ id: string;
11
+ }, flowAlias?: string, temporarily?: boolean): Promise<unknown>;
12
+ recoverFlow(flow: {
13
+ id: string;
14
+ }): Promise<unknown>;
15
+ getFlowById(id: string, projection?: string[], sandbox?: boolean): Promise<Flow>;
16
+ getFlows({ query, projection, includeDeleted, includeExisting, sandbox, limit, offset }?: ListFlowsParams): Promise<List<Flow>>;
17
+ getFlowEvents({ flowId, alias }: {
18
+ flowId: string;
19
+ alias: string;
20
+ }): Promise<unknown>;
21
+ getTriggerFlows(triggers?: never[]): Promise<unknown>;
22
+ listVersions(query: {
23
+ flowId?: string;
24
+ botId?: string;
25
+ version?: string;
26
+ }): Promise<any[]>;
27
+ getVersion(params: {
28
+ flowId: string;
29
+ version: string;
30
+ }): Promise<any>;
31
+ listFlowVersionsByBotId(params: {
32
+ botId: string;
33
+ }): Promise<any[]>;
34
+ loadLogs(params: {
35
+ flowId: string;
36
+ next: string;
37
+ startTime: number;
38
+ endTime: number;
39
+ limit: number;
40
+ filter: string;
41
+ relativeTime: boolean;
42
+ }): Promise<unknown>;
43
+ saveFlow(flow: Flow, { previousVersion }?: {
44
+ previousVersion?: string;
45
+ }): Promise<{
46
+ id: any;
47
+ version: any;
48
+ accountId: string;
49
+ number: string;
50
+ data: {
51
+ label: string;
52
+ isHidden: boolean;
53
+ type: unknown;
54
+ deploy: {
55
+ timeout?: number | undefined;
56
+ memory?: number | undefined;
57
+ role: string;
58
+ };
59
+ description: string;
60
+ stepTemplates: StepTemplateRaw[];
61
+ trees: {
62
+ [key: string]: import("@or-sdk/deployer").Tree;
63
+ };
64
+ packages: unknown;
65
+ meta: {
66
+ [key: string]: unknown;
67
+ };
68
+ color: string | null;
69
+ categories: string[] | null;
70
+ annotations: import("@or-sdk/deployer").Annotation[] | null;
71
+ };
72
+ botId: string;
73
+ tags?: string[] | undefined;
74
+ }>;
75
+ getFlowsByBotId(botId: string, projection: string[]): Promise<List<Flow>>;
76
+ getRemoteDataOutsByBotId(id: string): Promise<any>;
77
+ static getEmptyStep(stepId?: string): {
78
+ id: string;
79
+ icon: string;
80
+ iconType: string;
81
+ iconUrl: string;
82
+ shape: string;
83
+ type: string;
84
+ pinLabel: boolean;
85
+ stepInputData: {};
86
+ };
87
+ static getEmptyFlow(botId: string): any;
88
+ static getNewFlow(botId: string, flowTemplate: any): Promise<any>;
12
89
  listFlows(botId?: string, params?: ListFlowsParams): Promise<List<Flow>>;
13
90
  getFlow(id: string): Promise<Flow>;
14
- saveFlow(source: Flow): Promise<Flow>;
15
- deleteFlow(source: Flow, flowAlias?: string): Promise<GraphqlResponseCheckExecution>;
16
- activateFlow(source: Flow, interactiveDebug?: boolean): Promise<PollingResultActivateSuccess>;
17
- deactivateFlow(source: Flow, flowAlias: string, deleteLambda?: boolean): Promise<PollingResultDeactivateSuccess>;
18
- addTags(source: Flow, tagNames: string[]): Promise<Flow>;
19
- removeTags(source: Flow, tagNames: string[]): Promise<Flow>;
91
+ private get deployUrl();
92
+ private get checkUrl();
93
+ private _pollResult;
94
+ activateFlow(flow: ActivateFlowParams, progresCallback: any): Promise<any>;
95
+ deactivateFlow(flow: DeactivageFlowParams, flowAlias: string, deleteLambda?: boolean): Promise<any>;
20
96
  static listUnusedStepTemplates(source: Flow): StepTemplateRaw[];
21
97
  static deleteUnusedStepTemplates(source: Flow, stepTemplates?: StepTemplateToDelete[]): Flow;
22
98
  }
@@ -1,2 +1 @@
1
- export declare const QUERY_DELETE = "mutation deleteTemporarily($entity: EntityType!, $data: DeleteInput!) {\n deleteTemporarily(entity: $entity, data: $data) {\n ... on AsyncRequest {\n requestId\n }\n }\n}";
2
- export declare const ENTITY_NAME = "FLOW";
1
+ export declare const SERVICE_KEY = "datahub2";
@@ -4,8 +4,9 @@ export declare type FlowsConfig = {
4
4
  token: Token;
5
5
  discoveryUrl?: string;
6
6
  accountId?: string;
7
- dataHubUrl?: string;
7
+ dataHub2Url?: string;
8
8
  deployerUrl?: string;
9
+ sdkApiUrl?: string;
9
10
  };
10
11
  export declare type FlowListResponse = {
11
12
  count: number;
@@ -13,11 +14,28 @@ export declare type FlowListResponse = {
13
14
  last?: string;
14
15
  };
15
16
  export declare type ListFlowsParams = {
16
- includeDeleted: boolean;
17
- includeExisting: boolean;
18
- projection: string[];
17
+ includeDeleted?: boolean;
18
+ includeExisting?: boolean;
19
+ projection?: string[];
20
+ query?: {
21
+ [key: string]: any;
22
+ };
23
+ sandbox?: boolean;
24
+ limit?: number;
25
+ offset?: number;
19
26
  };
20
27
  export declare type StepTemplateToDelete = {
21
28
  id: string;
22
29
  [key: string]: unknown;
23
30
  };
31
+ export declare type DeactivageFlowParams = {
32
+ id: string;
33
+ data: {
34
+ deploy: {
35
+ role: string;
36
+ };
37
+ };
38
+ };
39
+ export declare type ActivateFlowParams = DeactivageFlowParams & {
40
+ interactiveDebug?: boolean;
41
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.26.1-beta.424.0",
2
+ "version": "0.27.0-beta.427.0",
3
3
  "name": "@or-sdk/flows",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -13,9 +13,11 @@
13
13
  "build:watch:esm": "tsc --project tsconfig.esm.json -w",
14
14
  "build:types": "tsc --project tsconfig.types.json",
15
15
  "build:watch:types": "tsc --project tsconfig.types.json -w",
16
- "clean": "rm -rf ./dist"
16
+ "clean": "rm -rf ./dist",
17
+ "dev": "tsc --project tsconfig.dev.json -w"
17
18
  },
18
19
  "devDependencies": {
20
+ "@types/uuid": "^8.3.4",
19
21
  "concurrently": "^6.4.0",
20
22
  "typescript": "^4.4.4"
21
23
  },
@@ -23,9 +25,10 @@
23
25
  "access": "public"
24
26
  },
25
27
  "dependencies": {
26
- "@or-sdk/base": "^0.24.2-beta.424.0",
27
- "@or-sdk/data-hub": "^0.23.8-beta.424.0",
28
- "@or-sdk/deployer": "^0.24.5-beta.424.0",
29
- "@or-sdk/tags": "^0.24.1-beta.424.0"
28
+ "@or-sdk/base": "^0.24.3-beta.427.0",
29
+ "@or-sdk/data-hub": "^0.23.9-beta.427.0",
30
+ "@or-sdk/deployer": "^0.24.6-beta.427.0",
31
+ "@or-sdk/tags": "^0.25.0-beta.427.0",
32
+ "uuid": "^8.3.2"
30
33
  }
31
34
  }