@or-sdk/idw 4.0.2 → 4.0.3-beta.1764.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/dto/flowUpsert.dto.js +7 -1
- package/dist/cjs/dto/flowUpsert.dto.js.map +1 -1
- package/dist/esm/dto/flowUpsert.dto.js +7 -1
- package/dist/esm/dto/flowUpsert.dto.js.map +1 -1
- package/dist/types/dto/flowUpsert.dto.d.ts +1 -3
- package/dist/types/dto/flowUpsert.dto.d.ts.map +1 -1
- package/package.json +2 -3
- package/src/dto/flowUpsert.dto.ts +8 -1
|
@@ -12,6 +12,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.flowActivateDataDto = exports.flowUpsertDataDto = void 0;
|
|
15
|
+
var getFlowSteps = function (trees) {
|
|
16
|
+
return Object.values(trees).reduce(function (acc, tree) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
return (_b = acc + ((_a = ((tree.steps || []).filter(function (step) { return step.type !== 'empty'; }))) === null || _a === void 0 ? void 0 : _a.length)) !== null && _b !== void 0 ? _b : 0;
|
|
19
|
+
}, 0);
|
|
20
|
+
};
|
|
15
21
|
function flowUpsertDataDto(flow) {
|
|
16
22
|
var _a = flow.data, description = _a.description, label = _a.label, trees = _a.trees, meta = _a.meta;
|
|
17
23
|
var id = flow.id, botId = flow.botId, dateCreated = flow.dateCreated, dateModified = flow.dateModified;
|
|
@@ -22,7 +28,7 @@ function flowUpsertDataDto(flow) {
|
|
|
22
28
|
dateModified: dateModified,
|
|
23
29
|
description: description,
|
|
24
30
|
label: label,
|
|
25
|
-
|
|
31
|
+
flowSteps: getFlowSteps(trees),
|
|
26
32
|
meta: meta,
|
|
27
33
|
};
|
|
28
34
|
}
|
|
@@ -1 +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,GAAuC,IAAI,GAA3C,EAAE,KAAK,GAAgC,IAAI,MAApC,EAAE,WAAW,GAAmB,IAAI,YAAvB,EAAE,YAAY,GAAK,IAAI,aAAT,CAAU;IACtD,OAAO;QACL,EAAE,IAAA;QACF,KAAK,OAAA;QACL,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,WAAW,aAAA;QACX,KAAK,OAAA;QACL,KAAK,
|
|
1
|
+
{"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAEA,IAAM,YAAY,GAAG,UAAC,KAAgC;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,IAAI;;QAC3C,OAAO,MAAA,GAAG,IAAG,MAAA,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAA,IAAI,IAAI,OAAA,IAAI,CAAC,IAAI,KAAK,OAAO,EAArB,CAAqB,CAAC,CAAC,0CAAE,MAAM,CAAA,mCAAI,CAAC,CAAC;IACvF,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,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,GAAuC,IAAI,GAA3C,EAAE,KAAK,GAAgC,IAAI,MAApC,EAAE,WAAW,GAAmB,IAAI,YAAvB,EAAE,YAAY,GAAK,IAAI,aAAT,CAAU;IACtD,OAAO;QACL,EAAE,IAAA;QACF,KAAK,OAAA;QACL,WAAW,aAAA;QACX,YAAY,cAAA;QACZ,WAAW,aAAA;QACX,KAAK,OAAA;QACL,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC;QAC9B,IAAI,MAAA;KACL,CAAC;AACJ,CAAC;AAbD,8CAaC;AAGD,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"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
const getFlowSteps = (trees) => {
|
|
2
|
+
return Object.values(trees).reduce((acc, tree) => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
return (_b = acc + ((_a = ((tree.steps || []).filter(step => step.type !== 'empty'))) === null || _a === void 0 ? void 0 : _a.length)) !== null && _b !== void 0 ? _b : 0;
|
|
5
|
+
}, 0);
|
|
6
|
+
};
|
|
1
7
|
export function flowUpsertDataDto(flow) {
|
|
2
8
|
const { description, label, trees, meta } = flow.data;
|
|
3
9
|
const { id, botId, dateCreated, dateModified } = flow;
|
|
@@ -8,7 +14,7 @@ export function flowUpsertDataDto(flow) {
|
|
|
8
14
|
dateModified,
|
|
9
15
|
description,
|
|
10
16
|
label,
|
|
11
|
-
trees,
|
|
17
|
+
flowSteps: getFlowSteps(trees),
|
|
12
18
|
meta,
|
|
13
19
|
};
|
|
14
20
|
}
|
|
@@ -1 +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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C"}
|
|
@@ -6,9 +6,7 @@ export declare function flowUpsertDataDto(flow: FlowType): {
|
|
|
6
6
|
dateModified: number;
|
|
7
7
|
description: string;
|
|
8
8
|
label: string;
|
|
9
|
-
|
|
10
|
-
[key: string]: import("@or-sdk/deployer").Tree;
|
|
11
|
-
};
|
|
9
|
+
flowSteps: number;
|
|
12
10
|
meta: {
|
|
13
11
|
[key: string]: unknown;
|
|
14
12
|
idw?: import("@or-sdk/deployer").IDWFlowMeta | undefined;
|
|
@@ -1 +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;
|
|
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;AAQpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;EAa/C;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ;;;EAKjD"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.0.
|
|
2
|
+
"version": "4.0.3-beta.1764.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": "7bc8ca6e820a573329f429eef8657182913e56c8"
|
|
30
|
+
}
|
|
32
31
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Flow as FlowType } from '@or-sdk/deployer';
|
|
2
2
|
|
|
3
|
+
const getFlowSteps = (trees: FlowType['data']['trees']): number => {
|
|
4
|
+
return Object.values(trees).reduce((acc, tree) => {
|
|
5
|
+
return acc + ((tree.steps || []).filter(step => step.type !== 'empty'))?.length ?? 0;
|
|
6
|
+
}, 0);
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
export function flowUpsertDataDto(flow: FlowType) {
|
|
4
10
|
const { description, label, trees, meta } = flow.data;
|
|
5
11
|
const { id, botId, dateCreated, dateModified } = flow;
|
|
@@ -10,11 +16,12 @@ export function flowUpsertDataDto(flow: FlowType) {
|
|
|
10
16
|
dateModified,
|
|
11
17
|
description,
|
|
12
18
|
label,
|
|
13
|
-
trees,
|
|
19
|
+
flowSteps: getFlowSteps(trees),
|
|
14
20
|
meta,
|
|
15
21
|
};
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
|
|
18
25
|
export function flowActivateDataDto(flow: FlowType) {
|
|
19
26
|
const { meta: { idw = {} } } = flow.data;
|
|
20
27
|
return {
|