@or-sdk/idw 4.0.0 → 4.0.1-beta.1717.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.
- package/dist/cjs/api/flowApi.js +3 -3
- package/dist/cjs/api/flowApi.js.map +1 -1
- package/dist/cjs/dto/flowUpsert.dto.js +36 -0
- package/dist/cjs/dto/flowUpsert.dto.js.map +1 -0
- package/dist/esm/api/flowApi.js +3 -3
- package/dist/esm/api/flowApi.js.map +1 -1
- package/dist/esm/dto/flowUpsert.dto.js +20 -0
- package/dist/esm/dto/flowUpsert.dto.js.map +1 -0
- package/dist/types/api/flowApi.d.ts +3 -3
- package/dist/types/api/flowApi.d.ts.map +1 -1
- package/dist/types/dto/flowUpsert.dto.d.ts +22 -0
- package/dist/types/dto/flowUpsert.dto.d.ts.map +1 -0
- package/dist/types/types/flow.d.ts +5 -2
- package/dist/types/types/flow.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/api/flowApi.ts +6 -6
- package/src/dto/flowUpsert.dto.ts +24 -0
- package/src/types/flow.ts +3 -2
package/dist/cjs/api/flowApi.js
CHANGED
|
@@ -39,17 +39,17 @@ var FlowApi = (function () {
|
|
|
39
39
|
data: data,
|
|
40
40
|
});
|
|
41
41
|
};
|
|
42
|
-
FlowApi.prototype.activateFlow = function (data) {
|
|
42
|
+
FlowApi.prototype.activateFlow = function (id, data) {
|
|
43
43
|
return this.providers.makeRequest({
|
|
44
44
|
route: (0, helpers_1.buildRoute)('flow/activate'),
|
|
45
|
-
method: '
|
|
45
|
+
method: 'PATCH',
|
|
46
46
|
data: data,
|
|
47
47
|
});
|
|
48
48
|
};
|
|
49
49
|
FlowApi.prototype.deactivateFlow = function (id) {
|
|
50
50
|
return this.providers.makeRequest({
|
|
51
51
|
route: (0, helpers_1.buildRoute)('flow/deactivate'),
|
|
52
|
-
method: '
|
|
52
|
+
method: 'PATCH',
|
|
53
53
|
params: {
|
|
54
54
|
id: id,
|
|
55
55
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":";;;AAEA,sCAAwC;AAExC;IACE,iBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,yBAAO,GAAP,UAAQ,EAAU;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC;YACzB,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,4BAAU,GAAV,UAAW,EAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC;YACzB,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,6BAAW,GAAX,UAAY,GAAa;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,OAAO,CAAC;YAC1B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAMD,wBAAM,GAAN,UAAO,IAAoB;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC;YACzB,MAAM,EAAE,MAAM;YACd,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAED,8BAAY,GAAZ,UAAa,
|
|
1
|
+
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":";;;AAEA,sCAAwC;AAExC;IACE,iBACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CA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,MAAM,EAAE,OAAO;YACf,MAAM,EAAE;gBACN,EAAE,IAAA;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAEH,cAAC;AAAD,CAAC,AA5ED,IA4EC;AA5EY,0BAAO"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.flowActivateDataDto = exports.flowUpsertDataDto = void 0;
|
|
15
|
+
function flowUpsertDataDto(flow) {
|
|
16
|
+
var _a = flow.data, description = _a.description, label = _a.label, trees = _a.trees, meta = _a.meta;
|
|
17
|
+
var id = flow.id, botId = flow.botId, dateCreated = flow.dateCreated, dateModified = flow.dateModified, isDeleted = flow.isDeleted;
|
|
18
|
+
return {
|
|
19
|
+
id: id,
|
|
20
|
+
botId: botId,
|
|
21
|
+
dateCreated: dateCreated,
|
|
22
|
+
dateModified: dateModified,
|
|
23
|
+
isDeleted: isDeleted,
|
|
24
|
+
description: description,
|
|
25
|
+
label: label,
|
|
26
|
+
trees: trees,
|
|
27
|
+
meta: meta,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
exports.flowUpsertDataDto = flowUpsertDataDto;
|
|
31
|
+
function flowActivateDataDto(flow) {
|
|
32
|
+
var _a = flow.data.meta.idw, idw = _a === void 0 ? {} : _a;
|
|
33
|
+
return __assign({}, idw);
|
|
34
|
+
}
|
|
35
|
+
exports.flowActivateDataDto = flowActivateDataDto;
|
|
36
|
+
//# sourceMappingURL=flowUpsert.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,SAAgB,iBAAiB,CAAC,IAAc;IACxC,IAAA,KAAsC,IAAI,CAAC,IAAI,EAA7C,WAAW,iBAAA,EAAE,KAAK,WAAA,EAAE,KAAK,WAAA,EAAE,IAAI,UAAc,CAAC;IAC9C,IAAA,EAAE,GAAkD,IAAI,GAAtD,EAAE,KAAK,GAA2C,IAAI,MAA/C,EAAE,WAAW,GAA8B,IAAI,YAAlC,EAAE,YAAY,GAAgB,IAAI,aAApB,EAAE,SAAS,GAAK,IAAI,UAAT,CAAU;IACjE,OAAO;QACL,EAAE,IAAA;QACF,KAAK,OAAA;QACL,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,SAAS,WAAA;QACT,WAAW,aAAA;QACX,KAAK,OAAA;QACL,KAAK,OAAA;QACL,IAAI,MAAA;KACL,CAAC;AACJ,CAAC;AAdD,8CAcC;AAED,SAAgB,mBAAmB,CAAC,IAAc;IAChC,IAAA,KAAe,IAAI,CAAC,IAAI,SAAhB,EAAR,GAAG,mBAAG,EAAE,KAAA,CAAiB;IACzC,oBACK,GAAG,EACN;AACJ,CAAC;AALD,kDAKC"}
|
package/dist/esm/api/flowApi.js
CHANGED
|
@@ -36,17 +36,17 @@ export class FlowApi {
|
|
|
36
36
|
data,
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
activateFlow(data) {
|
|
39
|
+
activateFlow(id, data) {
|
|
40
40
|
return this.providers.makeRequest({
|
|
41
41
|
route: buildRoute('flow/activate'),
|
|
42
|
-
method: '
|
|
42
|
+
method: 'PATCH',
|
|
43
43
|
data,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
deactivateFlow(id) {
|
|
47
47
|
return this.providers.makeRequest({
|
|
48
48
|
route: buildRoute('flow/deactivate'),
|
|
49
|
-
method: '
|
|
49
|
+
method: 'PATCH',
|
|
50
50
|
params: {
|
|
51
51
|
id,
|
|
52
52
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,OAAO,OAAO;IAClB,YACmB,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IACpC,CAAC;IAMJ,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;YACzB,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,UAAU,CAAC,EAAU;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;YACzB,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;IAMD,WAAW,CAAC,GAAa;QACvB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC;YAC1B,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE;gBACN,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IAMD,MAAM,CAAC,IAAoB;QACzB,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;YACzB,MAAM,EAAE,MAAM;YACd,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,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OAAO;YACf,MAAM,EAAE;gBACN,EAAE;aACH;SACF,CAAC,CAAC;IACL,CAAC;CAEF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function flowUpsertDataDto(flow) {
|
|
2
|
+
const { description, label, trees, meta } = flow.data;
|
|
3
|
+
const { id, botId, dateCreated, dateModified, isDeleted } = flow;
|
|
4
|
+
return {
|
|
5
|
+
id,
|
|
6
|
+
botId,
|
|
7
|
+
dateCreated,
|
|
8
|
+
dateModified,
|
|
9
|
+
isDeleted,
|
|
10
|
+
description,
|
|
11
|
+
label,
|
|
12
|
+
trees,
|
|
13
|
+
meta,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function flowActivateDataDto(flow) {
|
|
17
|
+
const { meta: { idw = {} } } = flow.data;
|
|
18
|
+
return Object.assign({}, idw);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=flowUpsert.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,iBAAiB,CAAC,IAAc;IAC9C,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IACtD,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACjE,OAAO;QACL,EAAE;QACF,KAAK;QACL,WAAW;QACX,YAAY;QACZ,SAAS;QACT,WAAW;QACX,KAAK;QACL,KAAK;QACL,IAAI;KACL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAc;IAChD,MAAM,EAAE,IAAI,EAAE,EAAE,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IACzC,yBACK,GAAG,EACN;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flow,
|
|
1
|
+
import { Flow, FlowActivateData, FlowUpsertData } from '../types';
|
|
2
2
|
import { Providers } from '@or-sdk/providers';
|
|
3
3
|
export declare class FlowApi {
|
|
4
4
|
private readonly providers;
|
|
@@ -6,8 +6,8 @@ export declare class FlowApi {
|
|
|
6
6
|
getFlow(id: string): Promise<Flow>;
|
|
7
7
|
deleteFlow(id: string): Promise<void>;
|
|
8
8
|
deleteFlows(ids: string[]): Promise<void>;
|
|
9
|
-
upsert(data:
|
|
10
|
-
activateFlow(data:
|
|
9
|
+
upsert(data: FlowUpsertData): Promise<Flow>;
|
|
10
|
+
activateFlow(id: string, data: FlowActivateData): Promise<void>;
|
|
11
11
|
deactivateFlow(id: string): Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=flowApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.d.ts","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"flowApi.d.ts","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,qBAAa,OAAO;IAEhB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAOvC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAalC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcrC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAczC,MAAM,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3C,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAU1C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Flow as FlowType } from '@or-sdk/deployer';
|
|
2
|
+
export declare function flowUpsertDataDto(flow: FlowType): {
|
|
3
|
+
id: string | undefined;
|
|
4
|
+
botId: string;
|
|
5
|
+
dateCreated: number;
|
|
6
|
+
dateModified: number;
|
|
7
|
+
isDeleted: boolean;
|
|
8
|
+
description: string;
|
|
9
|
+
label: string;
|
|
10
|
+
trees: {
|
|
11
|
+
[key: string]: import("@or-sdk/deployer").Tree;
|
|
12
|
+
};
|
|
13
|
+
meta: {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
idw?: import("@or-sdk/deployer").IDWFlowMeta | undefined;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare function flowActivateDataDto(flow: FlowType): {
|
|
19
|
+
channel?: string | undefined;
|
|
20
|
+
skills?: string[] | undefined;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=flowUpsert.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flowUpsert.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;;;;EAc/C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ;;;EAKjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { flowActivateDataDto, flowUpsertDataDto } from '../dto/flowUpsert.dto';
|
|
2
2
|
export interface Flow {
|
|
3
3
|
id: string;
|
|
4
4
|
createdAt: number;
|
|
@@ -15,5 +15,8 @@ export interface Flow {
|
|
|
15
15
|
export interface FlowWithRelationshipStatus extends Flow {
|
|
16
16
|
isRelationshipActive: boolean;
|
|
17
17
|
}
|
|
18
|
-
export type
|
|
18
|
+
export type FlowUpsertData = ReturnType<typeof flowUpsertDataDto> & {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
export type FlowActivateData = ReturnType<typeof flowActivateDataDto>;
|
|
19
22
|
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/types/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../../src/types/flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,0BAA2B,SAAQ,IAAI;IACtD,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,GAAG;IAAC,EAAE,EAAE,MAAM,CAAC;CAAC,CAAC;AAClF,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.0.0",
|
|
2
|
+
"version": "4.0.1-beta.1717.0",
|
|
3
3
|
"name": "@or-sdk/idw",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -27,6 +27,5 @@
|
|
|
27
27
|
"@or-sdk/base": "^0.28.3",
|
|
28
28
|
"@or-sdk/deployer": "^1.1.5",
|
|
29
29
|
"@or-sdk/providers": "^0.2.4"
|
|
30
|
-
}
|
|
31
|
-
"gitHead": "ec60939eed28ad25a7af706ce888cc018f4bb1c7"
|
|
30
|
+
}
|
|
32
31
|
}
|
package/src/api/flowApi.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flow,
|
|
1
|
+
import { Flow, FlowActivateData, FlowUpsertData } from '../types';
|
|
2
2
|
import { Providers } from '@or-sdk/providers';
|
|
3
3
|
import { buildRoute } from '../helpers';
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ export class FlowApi {
|
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* @description Delete specific flow
|
|
39
|
-
* @param
|
|
39
|
+
* @param ids
|
|
40
40
|
*/
|
|
41
41
|
deleteFlows(ids: string[]): Promise<void> {
|
|
42
42
|
return this.providers.makeRequest({
|
|
@@ -52,7 +52,7 @@ export class FlowApi {
|
|
|
52
52
|
* @description create flow connected with existing node
|
|
53
53
|
* @param data
|
|
54
54
|
*/
|
|
55
|
-
upsert(data:
|
|
55
|
+
upsert(data: FlowUpsertData): Promise<Flow> {
|
|
56
56
|
return this.providers.makeRequest({
|
|
57
57
|
route: buildRoute('flow'),
|
|
58
58
|
method: 'POST',
|
|
@@ -60,10 +60,10 @@ export class FlowApi {
|
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
activateFlow(data:
|
|
63
|
+
activateFlow(id: string, data: FlowActivateData): Promise<void> {
|
|
64
64
|
return this.providers.makeRequest({
|
|
65
65
|
route: buildRoute('flow/activate'),
|
|
66
|
-
method: '
|
|
66
|
+
method: 'PATCH',
|
|
67
67
|
data,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -71,7 +71,7 @@ export class FlowApi {
|
|
|
71
71
|
deactivateFlow(id: string): Promise<void> {
|
|
72
72
|
return this.providers.makeRequest({
|
|
73
73
|
route: buildRoute('flow/deactivate'),
|
|
74
|
-
method: '
|
|
74
|
+
method: 'PATCH',
|
|
75
75
|
params: {
|
|
76
76
|
id,
|
|
77
77
|
},
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Flow as FlowType } from '@or-sdk/deployer';
|
|
2
|
+
|
|
3
|
+
export function flowUpsertDataDto(flow: FlowType) {
|
|
4
|
+
const { description, label, trees, meta } = flow.data;
|
|
5
|
+
const { id, botId, dateCreated, dateModified, isDeleted } = flow;
|
|
6
|
+
return {
|
|
7
|
+
id,
|
|
8
|
+
botId,
|
|
9
|
+
dateCreated,
|
|
10
|
+
dateModified,
|
|
11
|
+
isDeleted,
|
|
12
|
+
description,
|
|
13
|
+
label,
|
|
14
|
+
trees,
|
|
15
|
+
meta,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function flowActivateDataDto(flow: FlowType) {
|
|
20
|
+
const { meta: { idw = {} } } = flow.data;
|
|
21
|
+
return {
|
|
22
|
+
...idw,
|
|
23
|
+
};
|
|
24
|
+
}
|
package/src/types/flow.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { flowActivateDataDto, flowUpsertDataDto } from '../dto/flowUpsert.dto';
|
|
2
2
|
|
|
3
3
|
export interface Flow {
|
|
4
4
|
id: string;
|
|
@@ -18,4 +18,5 @@ export interface FlowWithRelationshipStatus extends Flow {
|
|
|
18
18
|
isRelationshipActive: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export type
|
|
21
|
+
export type FlowUpsertData = ReturnType<typeof flowUpsertDataDto> & {id: string;};
|
|
22
|
+
export type FlowActivateData = ReturnType<typeof flowActivateDataDto>;
|