@or-sdk/idw 4.1.0-beta.1745.0 → 4.1.0-beta.1772.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/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.3](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@4.0.2...@or-sdk/idw@4.0.3) (2023-08-29)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **@or-sdk/idw:** fix issues with large payload ([0c4f13f](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/0c4f13fa2e9aaee598c42ed481c9b18e81d933dd))
12
+
13
+
14
+
6
15
  ## [4.0.2](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@4.0.1...@or-sdk/idw@4.0.2) (2023-08-11)
7
16
 
8
17
 
@@ -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
- trees: trees,
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,OAAA;QACL,IAAI,MAAA;KACL,CAAC;AACJ,CAAC;AAbD,8CAaC;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"}
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,CAAC;IACtD,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IACtD,OAAO;QACL,EAAE;QACF,KAAK;QACL,WAAW;QACX,YAAY;QACZ,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
+ {"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":"AAEA,MAAM,YAAY,GAAG,CAAC,KAAgC,EAAU,EAAE;IAChE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;;QAC/C,OAAO,MAAA,GAAG,IAAG,MAAA,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,0CAAE,MAAM,CAAA,mCAAI,CAAC,CAAC;IACvF,CAAC,EAAE,CAAC,CAAC,CAAC;AACR,CAAC,CAAC;AAEF,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,GAAG,IAAI,CAAC;IACtD,OAAO;QACL,EAAE;QACF,KAAK;QACL,WAAW;QACX,YAAY;QACZ,WAAW;QACX,KAAK;QACL,SAAS,EAAE,YAAY,CAAC,KAAK,CAAC;QAC9B,IAAI;KACL,CAAC;AACJ,CAAC;AAGD,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"}
@@ -6,9 +6,7 @@ export declare function flowUpsertDataDto(flow: FlowType): {
6
6
  dateModified: number;
7
7
  description: string;
8
8
  label: string;
9
- trees: {
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;AAEpD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;;;;EAa/C;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ;;;EAKjD"}
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"}
@@ -11,10 +11,10 @@ export interface IdwInfoWithStatistic extends IdwBaseInfo, ActiveFlowTotalCounte
11
11
  totalChannelSteps: number;
12
12
  }
13
13
  export interface IdwBaseInfo {
14
- slug?: string;
15
14
  name?: string;
16
15
  role?: string;
17
16
  description?: string;
18
17
  avatar?: string;
18
+ initializationStatus?: string;
19
19
  }
20
20
  //# sourceMappingURL=idwInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"idwInfo.d.ts","sourceRoot":"","sources":["../../../src/types/idwInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,WAAW,oBAAqB,SAAQ,WAAW,EAAE,sBAAsB,EAAE,iBAAiB;IAClG,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"idwInfo.d.ts","sourceRoot":"","sources":["../../../src/types/idwInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,WAAW,oBAAqB,SAAQ,WAAW,EAAE,sBAAsB,EAAE,iBAAiB;IAClG,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.1.0-beta.1745.0",
2
+ "version": "4.1.0-beta.1772.0",
3
3
  "name": "@or-sdk/idw",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -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 {
@@ -13,9 +13,9 @@ export interface IdwInfoWithStatistic extends IdwBaseInfo, ActiveFlowTotalCounte
13
13
  }
14
14
 
15
15
  export interface IdwBaseInfo {
16
- slug?: string;
17
16
  name?: string;
18
17
  role?: string;
19
18
  description?: string;
20
19
  avatar?: string;
20
+ initializationStatus?: string;
21
21
  }