@or-sdk/idw 6.0.0 → 7.0.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 +13 -0
- package/dist/cjs/api/flowApi.js +0 -48
- package/dist/cjs/api/flowApi.js.map +1 -1
- package/dist/esm/api/flowApi.js +0 -48
- package/dist/esm/api/flowApi.js.map +1 -1
- package/dist/types/api/flowApi.d.ts +1 -6
- package/dist/types/api/flowApi.d.ts.map +1 -1
- package/dist/types/types/flow.d.ts +1 -27
- package/dist/types/types/flow.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/flowApi.ts +1 -75
- package/src/types/flow.ts +1 -27
- package/dist/cjs/dto/flowUpsert.dto.js +0 -33
- package/dist/cjs/dto/flowUpsert.dto.js.map +0 -1
- package/dist/cjs/dto/index.js +0 -18
- package/dist/cjs/dto/index.js.map +0 -1
- package/dist/esm/dto/flowUpsert.dto.js +0 -28
- package/dist/esm/dto/flowUpsert.dto.js.map +0 -1
- package/dist/esm/dto/index.js +0 -2
- package/dist/esm/dto/index.js.map +0 -1
- package/dist/types/dto/flowUpsert.dto.d.ts +0 -18
- package/dist/types/dto/flowUpsert.dto.d.ts.map +0 -1
- package/dist/types/dto/index.d.ts +0 -2
- package/dist/types/dto/index.d.ts.map +0 -1
- package/src/dto/flowUpsert.dto.ts +0 -32
- package/src/dto/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
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
|
+
## [7.0.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@6.0.0...@or-sdk/idw@7.0.0) (2024-02-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* remove flow crud
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* remove flow crud ([28928ba](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/commit/28928baac3189f27560f35acd1cef8ccea9dc9b0))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
6
19
|
## [6.0.0](https://gitlab.internal.onereach.io/onereach/platform/or-sdk-next/compare/@or-sdk/idw@5.1.4...@or-sdk/idw@6.0.0) (2024-02-28)
|
|
7
20
|
|
|
8
21
|
|
package/dist/cjs/api/flowApi.js
CHANGED
|
@@ -16,7 +16,6 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.FlowApi = void 0;
|
|
19
|
-
var dto_1 = require("../dto");
|
|
20
19
|
var BaseApi_1 = require("./BaseApi");
|
|
21
20
|
var FlowApi = (function (_super) {
|
|
22
21
|
__extends(FlowApi, _super);
|
|
@@ -38,53 +37,6 @@ var FlowApi = (function (_super) {
|
|
|
38
37
|
method: 'GET',
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
|
-
FlowApi.prototype.deleteFlow = function (id) {
|
|
42
|
-
return this.providers.makeRequest({
|
|
43
|
-
route: this.buildRoute('flow'),
|
|
44
|
-
method: 'DELETE',
|
|
45
|
-
params: {
|
|
46
|
-
id: id,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
};
|
|
50
|
-
FlowApi.prototype.deleteFlows = function (ids) {
|
|
51
|
-
return this.providers.makeRequest({
|
|
52
|
-
route: this.buildRoute('flows'),
|
|
53
|
-
method: 'DELETE',
|
|
54
|
-
params: {
|
|
55
|
-
ids: ids.join(),
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
FlowApi.prototype.upsert = function (flow) {
|
|
60
|
-
var data = (0, dto_1.flowUpsertDataDto)(flow);
|
|
61
|
-
return this.providers.makeRequest({
|
|
62
|
-
route: this.buildRoute('flow'),
|
|
63
|
-
method: 'POST',
|
|
64
|
-
data: data,
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
FlowApi.prototype.activateFlow = function (flow) {
|
|
68
|
-
var id = flow.id;
|
|
69
|
-
var data = (0, dto_1.flowActivateDataDto)(flow);
|
|
70
|
-
return this.providers.makeRequest({
|
|
71
|
-
route: this.buildRoute('flow/activate'),
|
|
72
|
-
method: 'PATCH',
|
|
73
|
-
data: data,
|
|
74
|
-
params: {
|
|
75
|
-
id: id,
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
FlowApi.prototype.deactivateFlow = function (id) {
|
|
80
|
-
return this.providers.makeRequest({
|
|
81
|
-
route: this.buildRoute('flow/deactivate'),
|
|
82
|
-
method: 'PATCH',
|
|
83
|
-
params: {
|
|
84
|
-
id: id,
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
40
|
return FlowApi;
|
|
89
41
|
}(BaseApi_1.BaseApi));
|
|
90
42
|
exports.FlowApi = FlowApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,
|
|
1
|
+
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,qCAAoC;AAEpC;IAA6B,2BAAO;IAClC,iBAAY,MAAqB;eAC/B,kBAAM,MAAM,CAAC;IACf,CAAC;IAiBD,yBAAO,GAAP,UAAQ,EAAU,EAAE,mBAA6B;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAC9B,MAAM,EAAE;gBACN,EAAE,IAAA;gBACF,mBAAmB,qBAAA;aACpB;SACF,CAAC,CAAC;IACL,CAAC;IAKD,0BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;IACH,cAAC;AAAD,CAAC,AAvCD,CAA6B,iBAAO,GAuCnC;AAvCY,0BAAO"}
|
package/dist/esm/api/flowApi.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { flowActivateDataDto, flowUpsertDataDto } from '../dto';
|
|
2
1
|
import { BaseApi } from './BaseApi';
|
|
3
2
|
export class FlowApi extends BaseApi {
|
|
4
3
|
constructor(config) {
|
|
@@ -19,52 +18,5 @@ export class FlowApi extends BaseApi {
|
|
|
19
18
|
method: 'GET',
|
|
20
19
|
});
|
|
21
20
|
}
|
|
22
|
-
deleteFlow(id) {
|
|
23
|
-
return this.providers.makeRequest({
|
|
24
|
-
route: this.buildRoute('flow'),
|
|
25
|
-
method: 'DELETE',
|
|
26
|
-
params: {
|
|
27
|
-
id,
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
deleteFlows(ids) {
|
|
32
|
-
return this.providers.makeRequest({
|
|
33
|
-
route: this.buildRoute('flows'),
|
|
34
|
-
method: 'DELETE',
|
|
35
|
-
params: {
|
|
36
|
-
ids: ids.join(),
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
upsert(flow) {
|
|
41
|
-
const data = flowUpsertDataDto(flow);
|
|
42
|
-
return this.providers.makeRequest({
|
|
43
|
-
route: this.buildRoute('flow'),
|
|
44
|
-
method: 'POST',
|
|
45
|
-
data,
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
activateFlow(flow) {
|
|
49
|
-
const id = flow.id;
|
|
50
|
-
const data = flowActivateDataDto(flow);
|
|
51
|
-
return this.providers.makeRequest({
|
|
52
|
-
route: this.buildRoute('flow/activate'),
|
|
53
|
-
method: 'PATCH',
|
|
54
|
-
data,
|
|
55
|
-
params: {
|
|
56
|
-
id,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
deactivateFlow(id) {
|
|
61
|
-
return this.providers.makeRequest({
|
|
62
|
-
route: this.buildRoute('flow/deactivate'),
|
|
63
|
-
method: 'PATCH',
|
|
64
|
-
params: {
|
|
65
|
-
id,
|
|
66
|
-
},
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
21
|
}
|
|
70
22
|
//# sourceMappingURL=flowApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"flowApi.js","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,OAAO,OAAQ,SAAQ,OAAO;IAClC,YAAY,MAAqB;QAC/B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAiBD,OAAO,CAAC,EAAU,EAAE,mBAA6B;QAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAC9B,MAAM,EAAE;gBACN,EAAE;gBACF,mBAAmB;aACpB;SACF,CAAC,CAAC;IACL,CAAC;IAKD,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;YAChC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC/B,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { Flow,
|
|
1
|
+
import { Flow, FlowWithRelatedEntities, IDWBaseConfig } from '../types';
|
|
2
2
|
import { BaseApi } from './BaseApi';
|
|
3
3
|
export declare class FlowApi extends BaseApi {
|
|
4
4
|
constructor(config: IDWBaseConfig);
|
|
5
5
|
getFlow(id: string): Promise<Flow>;
|
|
6
6
|
getFlow<T extends boolean | undefined>(id: string, withRelatedEntities?: T): T extends true ? Promise<FlowWithRelatedEntities> : Promise<Flow>;
|
|
7
7
|
getFlows(): Promise<Flow[]>;
|
|
8
|
-
deleteFlow(id: string): Promise<void>;
|
|
9
|
-
deleteFlows(ids: string[]): Promise<void>;
|
|
10
|
-
upsert(flow: FlowType): Promise<Flow>;
|
|
11
|
-
activateFlow(flow: FlowType): Promise<void>;
|
|
12
|
-
deactivateFlow(id: string): Promise<void>;
|
|
13
8
|
}
|
|
14
9
|
//# 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,
|
|
1
|
+
{"version":3,"file":"flowApi.d.ts","sourceRoot":"","sources":["../../../src/api/flowApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,OAAQ,SAAQ,OAAO;gBACtB,MAAM,EAAE,aAAa;IAQjC,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAMlC,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG,SAAS,EACnC,EAAE,EAAE,MAAM,EACV,mBAAmB,CAAC,EAAE,CAAC,GACtB,CAAC,SAAS,IAAI,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAepE,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;CAM5B"}
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
import { flowActivateDataDto, flowUpsertDataDto } from '../dto';
|
|
2
|
-
import { Skill } from './skill';
|
|
3
1
|
import { Channel } from './channel';
|
|
4
|
-
import {
|
|
5
|
-
export type FlowType = FlowDeployerType & {
|
|
6
|
-
data: {
|
|
7
|
-
meta: IDWFlowMeta;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export interface IDWFlowMetaSkill {
|
|
11
|
-
id?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
meta?: Record<string, unknown>;
|
|
14
|
-
}
|
|
15
|
-
export interface IDWFlowMetaChannel {
|
|
16
|
-
appId?: string;
|
|
17
|
-
id: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
}
|
|
20
|
-
export interface IDWFlowMeta {
|
|
21
|
-
channel?: IDWFlowMetaChannel;
|
|
22
|
-
skills?: IDWFlowMetaSkill[];
|
|
23
|
-
}
|
|
2
|
+
import { Skill } from './skill';
|
|
24
3
|
export interface Flow {
|
|
25
4
|
id: string;
|
|
26
5
|
createdAt: number;
|
|
@@ -44,9 +23,4 @@ export interface FlowWithRelatedEntities {
|
|
|
44
23
|
export interface FlowWithRelationshipStatus extends Flow {
|
|
45
24
|
isRelationshipActive: boolean;
|
|
46
25
|
}
|
|
47
|
-
export type FlowUpsertData = Omit<ReturnType<typeof flowUpsertDataDto>, 'description'> & {
|
|
48
|
-
id: string;
|
|
49
|
-
description?: string;
|
|
50
|
-
};
|
|
51
|
-
export type FlowActivateData = ReturnType<typeof flowActivateDataDto>;
|
|
52
26
|
//# 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,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,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;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,0BAA2B,SAAQ,IAAI;IACtD,oBAAoB,EAAE,OAAO,CAAC;CAC/B"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "
|
|
2
|
+
"version": "7.0.0",
|
|
3
3
|
"name": "@or-sdk/idw",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"@or-sdk/deployer": "^1.2.9",
|
|
29
29
|
"@or-sdk/providers": "^0.2.18"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "e53de04c6810003c357bc17e38980b0090ee6418"
|
|
32
32
|
}
|
package/src/api/flowApi.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Flow,
|
|
2
|
-
import { flowActivateDataDto, flowUpsertDataDto } from '../dto';
|
|
1
|
+
import { Flow, FlowWithRelatedEntities, IDWBaseConfig } from '../types';
|
|
3
2
|
import { BaseApi } from './BaseApi';
|
|
4
3
|
|
|
5
4
|
export class FlowApi extends BaseApi {
|
|
@@ -41,77 +40,4 @@ export class FlowApi extends BaseApi {
|
|
|
41
40
|
method: 'GET',
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @description Delete specific flow
|
|
47
|
-
* @param id
|
|
48
|
-
*/
|
|
49
|
-
deleteFlow(id: string): Promise<void> {
|
|
50
|
-
return this.providers.makeRequest({
|
|
51
|
-
route: this.buildRoute('flow'),
|
|
52
|
-
method: 'DELETE',
|
|
53
|
-
params: {
|
|
54
|
-
id,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @description Delete specific flow
|
|
61
|
-
* @param ids
|
|
62
|
-
*/
|
|
63
|
-
deleteFlows(ids: string[]): Promise<void> {
|
|
64
|
-
return this.providers.makeRequest({
|
|
65
|
-
route: this.buildRoute('flows'),
|
|
66
|
-
method: 'DELETE',
|
|
67
|
-
params: {
|
|
68
|
-
ids: ids.join(),
|
|
69
|
-
},
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @description create flow connected with existing node
|
|
75
|
-
* @param flow
|
|
76
|
-
*/
|
|
77
|
-
upsert(flow: FlowType): Promise<Flow> {
|
|
78
|
-
const data = flowUpsertDataDto(flow);
|
|
79
|
-
return this.providers.makeRequest({
|
|
80
|
-
route: this.buildRoute('flow'),
|
|
81
|
-
method: 'POST',
|
|
82
|
-
data,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* activate flow
|
|
88
|
-
* @param flow
|
|
89
|
-
*/
|
|
90
|
-
activateFlow(flow: FlowType): Promise<void> {
|
|
91
|
-
const id = flow.id;
|
|
92
|
-
const data = flowActivateDataDto(flow);
|
|
93
|
-
return this.providers.makeRequest({
|
|
94
|
-
route: this.buildRoute('flow/activate'),
|
|
95
|
-
method: 'PATCH',
|
|
96
|
-
data,
|
|
97
|
-
params: {
|
|
98
|
-
id,
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* deactivate flow
|
|
105
|
-
* @param id
|
|
106
|
-
*/
|
|
107
|
-
deactivateFlow(id: string): Promise<void> {
|
|
108
|
-
return this.providers.makeRequest({
|
|
109
|
-
route: this.buildRoute('flow/deactivate'),
|
|
110
|
-
method: 'PATCH',
|
|
111
|
-
params: {
|
|
112
|
-
id,
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
43
|
}
|
package/src/types/flow.ts
CHANGED
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
import { flowActivateDataDto, flowUpsertDataDto } from '../dto';
|
|
2
|
-
import { Skill } from './skill';
|
|
3
1
|
import { Channel } from './channel';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type FlowType = FlowDeployerType & { data: { meta: IDWFlowMeta; }; };
|
|
8
|
-
|
|
9
|
-
export interface IDWFlowMetaSkill {
|
|
10
|
-
id?: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
meta?: Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface IDWFlowMetaChannel {
|
|
16
|
-
appId?: string;
|
|
17
|
-
id: string;
|
|
18
|
-
url?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IDWFlowMeta {
|
|
22
|
-
channel?: IDWFlowMetaChannel;
|
|
23
|
-
skills?: IDWFlowMetaSkill[];
|
|
24
|
-
}
|
|
2
|
+
import { Skill } from './skill';
|
|
25
3
|
|
|
26
4
|
export interface Flow {
|
|
27
5
|
id: string;
|
|
@@ -48,7 +26,3 @@ export interface FlowWithRelatedEntities {
|
|
|
48
26
|
export interface FlowWithRelationshipStatus extends Flow {
|
|
49
27
|
isRelationshipActive: boolean;
|
|
50
28
|
}
|
|
51
|
-
|
|
52
|
-
export type FlowUpsertData =
|
|
53
|
-
Omit<ReturnType<typeof flowUpsertDataDto>, 'description'> & { id: string; description?: string; };
|
|
54
|
-
export type FlowActivateData = ReturnType<typeof flowActivateDataDto>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flowActivateDataDto = exports.flowUpsertDataDto = void 0;
|
|
4
|
-
var getFlowSteps = function (trees) {
|
|
5
|
-
return Object.values(trees).reduce(function (acc, tree) {
|
|
6
|
-
var _a, _b;
|
|
7
|
-
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;
|
|
8
|
-
}, 0);
|
|
9
|
-
};
|
|
10
|
-
function flowUpsertDataDto(flow) {
|
|
11
|
-
var _a = flow.data, description = _a.description, label = _a.label, trees = _a.trees, meta = _a.meta;
|
|
12
|
-
var id = flow.id, botId = flow.botId, dateCreated = flow.dateCreated, dateModified = flow.dateModified;
|
|
13
|
-
return {
|
|
14
|
-
id: id,
|
|
15
|
-
botId: botId,
|
|
16
|
-
dateCreated: dateCreated,
|
|
17
|
-
dateModified: dateModified,
|
|
18
|
-
description: description,
|
|
19
|
-
label: label,
|
|
20
|
-
flowSteps: getFlowSteps(trees),
|
|
21
|
-
meta: meta,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
exports.flowUpsertDataDto = flowUpsertDataDto;
|
|
25
|
-
function flowActivateDataDto(flow) {
|
|
26
|
-
var _a = flow.data.meta, _b = _a.skills, skills = _b === void 0 ? [] : _b, _c = _a.channel, channel = _c === void 0 ? undefined : _c;
|
|
27
|
-
return {
|
|
28
|
-
channel: channel,
|
|
29
|
-
skills: skills,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
exports.flowActivateDataDto = flowActivateDataDto;
|
|
33
|
-
//# sourceMappingURL=flowUpsert.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":";;;AAGA,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;IACxC,IAAA,KAA+C,IAAI,CAAC,IAAI,KAAd,EAAlC,cAAW,EAAX,MAAM,mBAAG,EAAE,KAAA,EAAE,eAAmB,EAAnB,OAAO,mBAAG,SAAS,KAAE,CAAe;IACjE,OAAO;QACL,OAAO,SAAA;QACP,MAAM,QAAA;KACP,CAAC;AACJ,CAAC;AAND,kDAMC"}
|
package/dist/cjs/dto/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./flowUpsert.dto"), exports);
|
|
18
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
};
|
|
7
|
-
export function flowUpsertDataDto(flow) {
|
|
8
|
-
const { description, label, trees, meta } = flow.data;
|
|
9
|
-
const { id, botId, dateCreated, dateModified } = flow;
|
|
10
|
-
return {
|
|
11
|
-
id,
|
|
12
|
-
botId,
|
|
13
|
-
dateCreated,
|
|
14
|
-
dateModified,
|
|
15
|
-
description,
|
|
16
|
-
label,
|
|
17
|
-
flowSteps: getFlowSteps(trees),
|
|
18
|
-
meta,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export function flowActivateDataDto(flow) {
|
|
22
|
-
const { meta: { skills = [], channel = undefined } } = flow.data;
|
|
23
|
-
return {
|
|
24
|
-
channel,
|
|
25
|
-
skills,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=flowUpsert.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowUpsert.dto.js","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":"AAGA,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,MAAM,GAAG,EAAE,EAAE,OAAO,GAAG,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC;IACjE,OAAO;QACL,OAAO;QACP,MAAM;KACP,CAAC;AACJ,CAAC"}
|
package/dist/esm/dto/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { FlowType } from '../types';
|
|
2
|
-
export declare function flowUpsertDataDto(flow: FlowType): {
|
|
3
|
-
id: string | undefined;
|
|
4
|
-
botId: string;
|
|
5
|
-
dateCreated: number;
|
|
6
|
-
dateModified: number;
|
|
7
|
-
description: string;
|
|
8
|
-
label: string;
|
|
9
|
-
flowSteps: number;
|
|
10
|
-
meta: {
|
|
11
|
-
[key: string]: unknown;
|
|
12
|
-
} & import("../types").IDWFlowMeta;
|
|
13
|
-
};
|
|
14
|
-
export declare function flowActivateDataDto(flow: FlowType): {
|
|
15
|
-
channel: import("../types").IDWFlowMetaChannel | undefined;
|
|
16
|
-
skills: import("../types").IDWFlowMetaSkill[];
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=flowUpsert.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"flowUpsert.dto.d.ts","sourceRoot":"","sources":["../../../src/dto/flowUpsert.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AASpC,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ;;;;;;;;;;;EAa/C;AAGD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ;;;EAMjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { FlowType } from '../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getFlowSteps = (trees: FlowType['data']['trees']): number => {
|
|
5
|
-
return Object.values(trees).reduce((acc, tree) => {
|
|
6
|
-
return acc + ((tree.steps || []).filter(step => step.type !== 'empty'))?.length ?? 0;
|
|
7
|
-
}, 0);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export function flowUpsertDataDto(flow: FlowType) {
|
|
11
|
-
const { description, label, trees, meta } = flow.data;
|
|
12
|
-
const { id, botId, dateCreated, dateModified } = flow;
|
|
13
|
-
return {
|
|
14
|
-
id,
|
|
15
|
-
botId,
|
|
16
|
-
dateCreated,
|
|
17
|
-
dateModified,
|
|
18
|
-
description,
|
|
19
|
-
label,
|
|
20
|
-
flowSteps: getFlowSteps(trees),
|
|
21
|
-
meta,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export function flowActivateDataDto(flow: FlowType) {
|
|
27
|
-
const { meta: { skills = [], channel = undefined } } = flow.data;
|
|
28
|
-
return {
|
|
29
|
-
channel,
|
|
30
|
-
skills,
|
|
31
|
-
};
|
|
32
|
-
}
|
package/src/dto/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './flowUpsert.dto';
|