@ldsg/workflow 0.2.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.
Files changed (51) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +1 -0
  3. package/dist/__tests__/unit/resource.d.ts +2 -0
  4. package/dist/__tests__/unit/resource.d.ts.map +1 -0
  5. package/dist/__tests__/unit/resource.js +130 -0
  6. package/dist/constants.d.ts +20 -0
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/constants.js +36 -0
  9. package/dist/handler.d.ts +8 -0
  10. package/dist/handler.d.ts.map +1 -0
  11. package/dist/handler.js +5 -0
  12. package/dist/index.d.ts +6 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +21 -0
  15. package/dist/instantiate-resource.d.ts +6 -0
  16. package/dist/instantiate-resource.d.ts.map +1 -0
  17. package/dist/instantiate-resource.js +13 -0
  18. package/dist/resource.d.ts +26 -0
  19. package/dist/resource.d.ts.map +1 -0
  20. package/dist/resource.js +113 -0
  21. package/dist/types/index.d.ts +7 -0
  22. package/dist/types/index.d.ts.map +1 -0
  23. package/dist/types/index.js +22 -0
  24. package/dist/types/node-variables.d.ts +4 -0
  25. package/dist/types/node-variables.d.ts.map +1 -0
  26. package/dist/types/node-variables.js +2 -0
  27. package/dist/types/specific-resource-settings.d.ts +4 -0
  28. package/dist/types/specific-resource-settings.d.ts.map +1 -0
  29. package/dist/types/specific-resource-settings.js +2 -0
  30. package/dist/types/workflow-data.d.ts +7 -0
  31. package/dist/types/workflow-data.d.ts.map +1 -0
  32. package/dist/types/workflow-data.js +2 -0
  33. package/dist/types/workflow-edge-info.d.ts +28 -0
  34. package/dist/types/workflow-edge-info.d.ts.map +1 -0
  35. package/dist/types/workflow-edge-info.js +2 -0
  36. package/dist/types/workflow-info.d.ts +13 -0
  37. package/dist/types/workflow-info.d.ts.map +1 -0
  38. package/dist/types/workflow-info.js +2 -0
  39. package/dist/types/workflow-node-info.d.ts +53 -0
  40. package/dist/types/workflow-node-info.d.ts.map +1 -0
  41. package/dist/types/workflow-node-info.js +25 -0
  42. package/dist/utils/get-end-node-output-variables.d.ts +10 -0
  43. package/dist/utils/get-end-node-output-variables.d.ts.map +1 -0
  44. package/dist/utils/get-end-node-output-variables.js +12 -0
  45. package/dist/utils/get-ordered-node-list.d.ts +19 -0
  46. package/dist/utils/get-ordered-node-list.d.ts.map +1 -0
  47. package/dist/utils/get-ordered-node-list.js +41 -0
  48. package/dist/utils/index.d.ts +3 -0
  49. package/dist/utils/index.d.ts.map +1 -0
  50. package/dist/utils/index.js +18 -0
  51. package/package.json +30 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2014-present Sebastian McKenzie and other contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # LDSG Workflow
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/__tests__/unit/resource.ts"],"names":[],"mappings":""}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("../../constants");
4
+ const resource_1 = require("../../resource");
5
+ const types_1 = require("../../types");
6
+ class AWorkflowResource extends resource_1.WorkflowResource {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.getWorkflowData = () => {
10
+ const workflowData = {
11
+ edges: [
12
+ {
13
+ sourceWorkflowNodeResourceId: "1",
14
+ targetWorkflowNodeResourceId: "2",
15
+ },
16
+ {
17
+ sourceWorkflowNodeResourceId: "2",
18
+ targetWorkflowNodeResourceId: "3",
19
+ },
20
+ {
21
+ sourceWorkflowNodeResourceId: "3",
22
+ targetWorkflowNodeResourceId: "4",
23
+ },
24
+ {
25
+ sourceWorkflowNodeResourceId: "4",
26
+ targetWorkflowNodeResourceId: "5",
27
+ },
28
+ ],
29
+ nodes: [
30
+ {
31
+ id: "1",
32
+ workflowNodeTypeResourceId: constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.start,
33
+ Executer: class AWorkflowNodeExecuter extends types_1.WorkflowNodeExecuter {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.execute = async () => {
37
+ const { setVariables } = this;
38
+ setVariables({
39
+ variables: "abc",
40
+ });
41
+ };
42
+ }
43
+ },
44
+ },
45
+ {
46
+ id: "2",
47
+ workflowNodeTypeResourceId: "",
48
+ Executer: class AWorkflowNodeExecuter extends types_1.WorkflowNodeExecuter {
49
+ constructor() {
50
+ super(...arguments);
51
+ this.execute = async () => {
52
+ const { setVariables } = this;
53
+ setVariables({
54
+ variables: "def",
55
+ });
56
+ };
57
+ }
58
+ },
59
+ },
60
+ {
61
+ id: "3",
62
+ workflowNodeTypeResourceId: "",
63
+ Executer: class AWorkflowNodeExecuter extends types_1.WorkflowNodeExecuter {
64
+ constructor() {
65
+ super(...arguments);
66
+ this.execute = async () => {
67
+ const { setVariables } = this;
68
+ setVariables({
69
+ variables: "ghi",
70
+ });
71
+ };
72
+ }
73
+ },
74
+ },
75
+ {
76
+ id: "4",
77
+ workflowNodeTypeResourceId: "",
78
+ Executer: class AWorkflowNodeExecuter extends types_1.WorkflowNodeExecuter {
79
+ constructor() {
80
+ super(...arguments);
81
+ this.execute = async () => {
82
+ const { setVariables } = this;
83
+ setVariables({
84
+ variables: "jkl",
85
+ });
86
+ };
87
+ }
88
+ },
89
+ },
90
+ {
91
+ id: "5",
92
+ workflowNodeTypeResourceId: constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.end,
93
+ Executer: class AWorkflowNodeExecuter extends types_1.WorkflowNodeExecuter {
94
+ constructor() {
95
+ super(...arguments);
96
+ this.execute = async () => {
97
+ const { setVariables } = this;
98
+ setVariables({
99
+ variables: "mno",
100
+ });
101
+ };
102
+ }
103
+ },
104
+ },
105
+ ],
106
+ };
107
+ const res = {
108
+ workflowData,
109
+ };
110
+ return res;
111
+ };
112
+ }
113
+ }
114
+ test("WorkflowResource execute", async () => {
115
+ const aWorkflowResource = new AWorkflowResource({
116
+ id: "test",
117
+ kind: "workflow",
118
+ parentId: "root",
119
+ settings: {
120
+ title: "",
121
+ description: "",
122
+ },
123
+ });
124
+ const { endNodeOutputVariables } = await aWorkflowResource.execute({
125
+ startNodeInputVariables: {
126
+ hello: "world",
127
+ },
128
+ });
129
+ expect(endNodeOutputVariables).toMatchSnapshot();
130
+ });
@@ -0,0 +1,20 @@
1
+ import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
+ import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
+ import { GeneralResourceSettings } from "@ldsg/types";
4
+ export declare const HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
5
+ /**
6
+ * Handler Resource Settings
7
+ * 此类型资源的子级处理程序资源的配置
8
+ * 如无或为 undefined,则说明无需子级处理程序。
9
+ */
10
+ export declare const HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
11
+ export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
12
+ export declare const RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS: ResourceDefinitionSpecificResourceSettings;
13
+ /**
14
+ * Specific Workflow Node Type Id Map
15
+ */
16
+ export declare const SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP: {
17
+ readonly start: "start-workflow-node-type";
18
+ readonly end: "end-workflow-node-type";
19
+ };
20
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,iCAAiC,EAAE,uBAG/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,EAAE,+BAQ9C,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAIzD,CAAC;AAEJ,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,iEAAiE;;;CAIlE,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
4
+ const constants_1 = require("@ldsg/constants");
5
+ exports.HANDLER_GENERAL_RESOURCE_SETTINGS = {
6
+ title: "工作流类型资源处理程序",
7
+ description: "",
8
+ };
9
+ /**
10
+ * Handler Resource Settings
11
+ * 此类型资源的子级处理程序资源的配置
12
+ * 如无或为 undefined,则说明无需子级处理程序。
13
+ */
14
+ exports.HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
15
+ code: `export * from "@ldsg/workflow";`,
16
+ dependencies: [
17
+ {
18
+ name: "@ldsg/workflow",
19
+ },
20
+ ],
21
+ };
22
+ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
23
+ title: "工作流类型资源定义",
24
+ description: "",
25
+ };
26
+ exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
27
+ kind: "workflow",
28
+ parentKind: constants_1.ROOT_RESOURCE_KIND,
29
+ };
30
+ /**
31
+ * Specific Workflow Node Type Id Map
32
+ */
33
+ exports.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP = {
34
+ start: "start-workflow-node-type",
35
+ end: "end-workflow-node-type",
36
+ };
@@ -0,0 +1,8 @@
1
+ import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
+ import { WorkflowResource } from "./resource";
4
+ import { WorkflowSpecificResourceSettings } from "./types";
5
+ export declare const handler: Handler<[
6
+ InstantiateResourceParams<HandlerExtendedResourceSettings<WorkflowSpecificResourceSettings>>
7
+ ], InstantiateResourceRes<WorkflowResource>>;
8
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B;IACE,yBAAyB,CACvB,+BAA+B,CAAC,gCAAgC,CAAC,CAClE;CACF,EACD,sBAAsB,CAAC,gBAAgB,CAAC,CACnB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handler = void 0;
4
+ const instantiate_resource_1 = require("./instantiate-resource");
5
+ exports.handler = instantiate_resource_1.instantiateResource;
@@ -0,0 +1,6 @@
1
+ export * from "./constants";
2
+ export * from "./handler";
3
+ export * from "./instantiate-resource";
4
+ export * from "./resource";
5
+ export * from "./types";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
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("./constants"), exports);
18
+ __exportStar(require("./handler"), exports);
19
+ __exportStar(require("./instantiate-resource"), exports);
20
+ __exportStar(require("./resource"), exports);
21
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,6 @@
1
+ import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResource } from "@ldsg/resource";
3
+ import { WorkflowResource } from "./resource";
4
+ import { WorkflowSpecificResourceSettings } from "./types";
5
+ export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<WorkflowSpecificResourceSettings>, WorkflowResource>;
6
+ //# sourceMappingURL=instantiate-resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../src/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CACnD,+BAA+B,CAAC,gCAAgC,CAAC,EACjE,gBAAgB,CAWjB,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.instantiateResource = void 0;
4
+ const resource_1 = require("./resource");
5
+ const instantiateResource = (params) => {
6
+ const { resourceConstructorParams } = params;
7
+ const resource = new resource_1.WorkflowResource(resourceConstructorParams);
8
+ const res = {
9
+ resource,
10
+ };
11
+ return res;
12
+ };
13
+ exports.instantiateResource = instantiateResource;
@@ -0,0 +1,26 @@
1
+ import { Resource } from "@ldsg/resource";
2
+ import { WorkflowData, WorkflowEdgeInfo, WorkflowExecute, WorkflowInfo, WorkflowNodeInfo, WorkflowSpecificResourceSettings } from "./types";
3
+ export interface GetWorkflowEdgeInfoListRes {
4
+ workflowEdgeInfoList: WorkflowEdgeInfo[];
5
+ }
6
+ export type GetWorkflowEdgeInfoList = () => GetWorkflowEdgeInfoListRes;
7
+ export interface GetWorkflowNodeInfoListRes {
8
+ workflowNodeInfoList: WorkflowNodeInfo[];
9
+ }
10
+ export type GetWorkflowNodeInfoList = () => GetWorkflowNodeInfoListRes;
11
+ export interface GetWorkflowDataRes {
12
+ workflowData: WorkflowData;
13
+ }
14
+ export type GetWorkflowData = () => GetWorkflowDataRes;
15
+ export interface GetWorkflowInfoRes {
16
+ workflowInfo: WorkflowInfo;
17
+ }
18
+ export type GetWorkflowInfo = () => GetWorkflowInfoRes;
19
+ export declare class WorkflowResource extends Resource<WorkflowSpecificResourceSettings> {
20
+ getWorkflowEdgeInfoList: GetWorkflowEdgeInfoList;
21
+ getWorkflowNodeInfoList: GetWorkflowNodeInfoList;
22
+ getWorkflowData: GetWorkflowData;
23
+ execute: WorkflowExecute;
24
+ getWorkflowInfo: GetWorkflowInfo;
25
+ }
26
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,OAAO,EAML,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,gCAAgC,EACjC,MAAM,SAAS,CAAC;AAGjB,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;CAC1C;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,0BAA0B,CAAC;AAEvE,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,gBAAgB,EAAE,CAAC;CAC1C;AAED,MAAM,MAAM,uBAAuB,GAAG,MAAM,0BAA0B,CAAC;AAEvE,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,kBAAkB,CAAC;AAEvD,qBAAa,gBAAiB,SAAQ,QAAQ,CAAC,gCAAgC,CAAC;IAC9E,uBAAuB,EAAE,uBAAuB,CA4B9C;IAEF,uBAAuB,EAAE,uBAAuB,CA4B9C;IAEF,eAAe,EAAE,eAAe,CAiB9B;IAEF,OAAO,EAAE,eAAe,CAiEtB;IAEF,eAAe,EAAE,eAAe,CAY9B;CACH"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.WorkflowResource = void 0;
7
+ const resource_1 = require("@ldsg/resource");
8
+ const lodash_1 = __importDefault(require("lodash"));
9
+ const constants_1 = require("./constants");
10
+ const utils_1 = require("./utils");
11
+ class WorkflowResource extends resource_1.Resource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.getWorkflowEdgeInfoList = () => {
15
+ const { id, getFilteredResources } = this;
16
+ const { resources } = getFilteredResources({
17
+ parentId: id,
18
+ });
19
+ const mapRes = resources.map((resource) => {
20
+ var _a;
21
+ return (_a = resource.getWorkflowEdgeInfo) === null || _a === void 0 ? void 0 : _a.call(resource);
22
+ });
23
+ const getWorkflowEdgeInfoResList = lodash_1.default.filter(mapRes, (value) => !lodash_1.default.isUndefined(value));
24
+ const workflowEdgeInfoList = lodash_1.default.map(getWorkflowEdgeInfoResList, "workflowEdgeInfo");
25
+ const res = {
26
+ workflowEdgeInfoList,
27
+ };
28
+ return res;
29
+ };
30
+ this.getWorkflowNodeInfoList = () => {
31
+ const { id, getFilteredResources } = this;
32
+ const { resources } = getFilteredResources({
33
+ parentId: id,
34
+ });
35
+ const mapRes = resources.map((resource) => {
36
+ var _a;
37
+ return (_a = resource.getWorkflowNodeInfo) === null || _a === void 0 ? void 0 : _a.call(resource);
38
+ });
39
+ const GetWorkflowNodeInfoResList = lodash_1.default.filter(mapRes, (value) => !lodash_1.default.isUndefined(value));
40
+ const workflowNodeInfoList = lodash_1.default.map(GetWorkflowNodeInfoResList, "workflowNodeInfo");
41
+ const res = {
42
+ workflowNodeInfoList,
43
+ };
44
+ return res;
45
+ };
46
+ this.getWorkflowData = () => {
47
+ const { getWorkflowEdgeInfoList, getWorkflowNodeInfoList } = this;
48
+ const { workflowEdgeInfoList } = getWorkflowEdgeInfoList();
49
+ const { workflowNodeInfoList } = getWorkflowNodeInfoList();
50
+ const workflowData = {
51
+ edges: workflowEdgeInfoList,
52
+ nodes: workflowNodeInfoList,
53
+ };
54
+ const res = {
55
+ workflowData,
56
+ };
57
+ return res;
58
+ };
59
+ this.execute = async (params) => {
60
+ const { startNodeInputVariables } = params;
61
+ const { getWorkflowData } = this;
62
+ const nodeIdToVariablesMap = new Map();
63
+ const { workflowData } = getWorkflowData();
64
+ const { nodes } = workflowData;
65
+ const startNode = nodes.find((value) => value.workflowNodeTypeResourceId ===
66
+ constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.start);
67
+ const endNode = nodes.find((value) => value.workflowNodeTypeResourceId ===
68
+ constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.end);
69
+ if (!startNode || !endNode) {
70
+ throw new Error("invalid workflow nodes");
71
+ }
72
+ const { orderedNodeList } = (0, utils_1.getOrderedNodeList)({
73
+ workflowData,
74
+ startNode,
75
+ endNode,
76
+ });
77
+ const executerList = orderedNodeList.map((node) => {
78
+ const { id, Executer } = node;
79
+ if (!Executer) {
80
+ throw new Error("invalid Executer");
81
+ }
82
+ const executer = new Executer({
83
+ nodeId: id,
84
+ nodeIdToVariablesMap,
85
+ ...(node.workflowNodeTypeResourceId ===
86
+ constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.start
87
+ ? { inputVariables: startNodeInputVariables }
88
+ : {}),
89
+ });
90
+ return executer;
91
+ });
92
+ for (const executer of executerList) {
93
+ await executer.execute();
94
+ }
95
+ const res = (0, utils_1.getEndNodeOutputVariables)({
96
+ endNode,
97
+ nodeIdToVariablesMap,
98
+ });
99
+ return res;
100
+ };
101
+ this.getWorkflowInfo = () => {
102
+ const { execute } = this;
103
+ const workflowInfo = {
104
+ execute,
105
+ };
106
+ const res = {
107
+ workflowInfo,
108
+ };
109
+ return res;
110
+ };
111
+ }
112
+ }
113
+ exports.WorkflowResource = WorkflowResource;
@@ -0,0 +1,7 @@
1
+ export * from "./node-variables";
2
+ export * from "./specific-resource-settings";
3
+ export * from "./workflow-data";
4
+ export * from "./workflow-edge-info";
5
+ export * from "./workflow-info";
6
+ export * from "./workflow-node-info";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,22 @@
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("./node-variables"), exports);
18
+ __exportStar(require("./specific-resource-settings"), exports);
19
+ __exportStar(require("./workflow-data"), exports);
20
+ __exportStar(require("./workflow-edge-info"), exports);
21
+ __exportStar(require("./workflow-info"), exports);
22
+ __exportStar(require("./workflow-node-info"), exports);
@@ -0,0 +1,4 @@
1
+ export type NodeId = string;
2
+ export type NodeVariables = any;
3
+ export type NodeIdToVariablesMap = Map<NodeId, NodeVariables>;
4
+ //# sourceMappingURL=node-variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-variables.d.ts","sourceRoot":"","sources":["../../src/types/node-variables.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC;AAEhC,MAAM,MAAM,oBAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,4 @@
1
+ import { SpecificResourceSettings } from "@ldsg/types";
2
+ export interface WorkflowSpecificResourceSettings extends SpecificResourceSettings {
3
+ }
4
+ //# sourceMappingURL=specific-resource-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,gCACf,SAAQ,wBAAwB;CAAG"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ import { WorkflowEdgeInfo } from "./workflow-edge-info";
2
+ import { WorkflowNodeInfo } from "./workflow-node-info";
3
+ export interface WorkflowData {
4
+ edges: WorkflowEdgeInfo[];
5
+ nodes: WorkflowNodeInfo[];
6
+ }
7
+ //# sourceMappingURL=workflow-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-data.d.ts","sourceRoot":"","sources":["../../src/types/workflow-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,28 @@
1
+ export interface WorkflowEdgeInfo {
2
+ /**
3
+ * 开始工作流节点资源ID
4
+ */
5
+ sourceWorkflowNodeResourceId: string;
6
+ /**
7
+ * 开始工作流节点端口ID
8
+ * 缺省则采用开始节点的默认端口
9
+ */
10
+ sourceWorkflowNodePortId?: string;
11
+ /**
12
+ * 目标工作流节点资源ID
13
+ */
14
+ targetWorkflowNodeResourceId: string;
15
+ /**
16
+ * 目标工作流节点端口ID
17
+ * 缺省则采用目标节点的默认端口
18
+ */
19
+ targetWorkflowNodePortId?: string;
20
+ }
21
+ export interface GetWorkflowEdgeInfoRes {
22
+ /**
23
+ * Workflow Edge Info
24
+ */
25
+ workflowEdgeInfo: WorkflowEdgeInfo;
26
+ }
27
+ export type GetWorkflowEdgeInfo = () => GetWorkflowEdgeInfoRes;
28
+ //# sourceMappingURL=workflow-edge-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-edge-info.d.ts","sourceRoot":"","sources":["../../src/types/workflow-edge-info.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,4BAA4B,EAAE,MAAM,CAAC;IAErC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,4BAA4B,EAAE,MAAM,CAAC;IAErC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ import { GetEndNodeOutputVariablesRes } from "../utils";
2
+ import { NodeVariables } from "./node-variables";
3
+ export interface WorkflowExecuteParams {
4
+ startNodeInputVariables: NodeVariables;
5
+ }
6
+ export interface WorkflowExecuteRes {
7
+ endNodeOutputVariables: NodeVariables;
8
+ }
9
+ export type WorkflowExecute = (params: WorkflowExecuteParams) => Promise<GetEndNodeOutputVariablesRes>;
10
+ export interface WorkflowInfo {
11
+ execute: WorkflowExecute;
12
+ }
13
+ //# sourceMappingURL=workflow-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-info.d.ts","sourceRoot":"","sources":["../../src/types/workflow-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,uBAAuB,EAAE,aAAa,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,sBAAsB,EAAE,aAAa,CAAC;CACvC;AAED,MAAM,MAAM,eAAe,GAAG,CAC5B,MAAM,EAAE,qBAAqB,KAC1B,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAE3C,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,eAAe,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,53 @@
1
+ import { NodeId, NodeIdToVariablesMap, NodeVariables } from "./node-variables";
2
+ export type WorkflowNodeExecuterExecute = () => void | Promise<void>;
3
+ interface WorkflowNodeExecuterConstructorParams {
4
+ nodeId: NodeId;
5
+ nodeIdToVariablesMap: NodeIdToVariablesMap;
6
+ /**
7
+ * input variables
8
+ * only in start node
9
+ */
10
+ inputVariables?: any;
11
+ }
12
+ interface SetVariablesParams {
13
+ variables: NodeVariables;
14
+ }
15
+ type SetVariables = (params: SetVariablesParams) => void;
16
+ export declare class WorkflowNodeExecuter implements WorkflowNodeExecuterConstructorParams {
17
+ nodeId: NodeId;
18
+ nodeIdToVariablesMap: NodeIdToVariablesMap;
19
+ /**
20
+ * input variables
21
+ * only in start node
22
+ */
23
+ inputVariables?: any;
24
+ constructor(params: WorkflowNodeExecuterConstructorParams);
25
+ /**
26
+ * Set Current Node Output Variables
27
+ */
28
+ setVariables: SetVariables;
29
+ execute: WorkflowNodeExecuterExecute;
30
+ }
31
+ export interface WorkflowNodeInfo {
32
+ /**
33
+ * ID
34
+ */
35
+ id: string;
36
+ /**
37
+ * Workflow Node Type Resource ID
38
+ */
39
+ workflowNodeTypeResourceId: string;
40
+ /**
41
+ * Executer
42
+ */
43
+ Executer: typeof WorkflowNodeExecuter;
44
+ }
45
+ export interface GetWorkflowNodeInfoRes {
46
+ /**
47
+ * Workflow Node Info
48
+ */
49
+ workflowNodeInfo: WorkflowNodeInfo;
50
+ }
51
+ export type GetWorkflowNodeInfo = () => GetWorkflowNodeInfoRes;
52
+ export {};
53
+ //# sourceMappingURL=workflow-node-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-node-info.d.ts","sourceRoot":"","sources":["../../src/types/workflow-node-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/E,MAAM,MAAM,2BAA2B,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAErE,UAAU,qCAAqC;IAC7C,MAAM,EAAE,MAAM,CAAC;IAEf,oBAAoB,EAAE,oBAAoB,CAAC;IAE3C;;;OAGG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC1B,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,KAAK,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;AAEzD,qBAAa,oBACX,YAAW,qCAAqC;IAEhD,MAAM,EAAE,MAAM,CAAC;IAEf,oBAAoB,EAAE,oBAAoB,CAAC;IAE3C;;;OAGG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC;gBAET,MAAM,EAAE,qCAAqC;IAQzD;;OAEG;IACH,YAAY,EAAE,YAAY,CAMxB;IAEF,OAAO,EAAE,2BAA2B,CASlC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IAEnC;;OAEG;IACH,QAAQ,EAAE,OAAO,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowNodeExecuter = void 0;
4
+ class WorkflowNodeExecuter {
5
+ constructor(params) {
6
+ /**
7
+ * Set Current Node Output Variables
8
+ */
9
+ this.setVariables = (params) => {
10
+ const { variables } = params;
11
+ const { nodeId, nodeIdToVariablesMap } = this;
12
+ nodeIdToVariablesMap.set(nodeId, variables);
13
+ };
14
+ this.execute = () => {
15
+ const { nodeId, nodeIdToVariablesMap } = this;
16
+ console.info("WorkflowNodeExecuter execute nodeId", nodeId);
17
+ console.info("WorkflowNodeExecuter execute nodeIdToVariablesMap", nodeIdToVariablesMap);
18
+ };
19
+ const { nodeId, nodeIdToVariablesMap, inputVariables } = params;
20
+ this.nodeId = nodeId;
21
+ this.nodeIdToVariablesMap = nodeIdToVariablesMap;
22
+ this.inputVariables = inputVariables;
23
+ }
24
+ }
25
+ exports.WorkflowNodeExecuter = WorkflowNodeExecuter;
@@ -0,0 +1,10 @@
1
+ import { NodeIdToVariablesMap, WorkflowExecuteRes, WorkflowNodeInfo } from "../types";
2
+ export interface GetEndNodeOutputVariablesParams {
3
+ endNode: WorkflowNodeInfo;
4
+ nodeIdToVariablesMap: NodeIdToVariablesMap;
5
+ }
6
+ export interface GetEndNodeOutputVariablesRes extends WorkflowExecuteRes {
7
+ }
8
+ export type GetEndNodeOutputVariables = (params: GetEndNodeOutputVariablesParams) => GetEndNodeOutputVariablesRes;
9
+ export declare const getEndNodeOutputVariables: GetEndNodeOutputVariables;
10
+ //# sourceMappingURL=get-end-node-output-variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-end-node-output-variables.d.ts","sourceRoot":"","sources":["../../src/utils/get-end-node-output-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,+BAA+B;IAC9C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,oBAAoB,EAAE,oBAAoB,CAAC;CAC5C;AAED,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;CAAG;AAE3E,MAAM,MAAM,yBAAyB,GAAG,CACtC,MAAM,EAAE,+BAA+B,KACpC,4BAA4B,CAAC;AAElC,eAAO,MAAM,yBAAyB,EAAE,yBAYvC,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEndNodeOutputVariables = void 0;
4
+ const getEndNodeOutputVariables = (params) => {
5
+ const { endNode, nodeIdToVariablesMap } = params;
6
+ const endNodeOutputVariables = nodeIdToVariablesMap.get(endNode.id);
7
+ const res = {
8
+ endNodeOutputVariables,
9
+ };
10
+ return res;
11
+ };
12
+ exports.getEndNodeOutputVariables = getEndNodeOutputVariables;
@@ -0,0 +1,19 @@
1
+ import { WorkflowData, WorkflowNodeInfo } from "../types";
2
+ interface GetOrderedNodeListParams {
3
+ workflowData: WorkflowData;
4
+ startNode: WorkflowNodeInfo;
5
+ endNode: WorkflowNodeInfo;
6
+ }
7
+ interface GetOrderedNodeListRes {
8
+ orderedNodeList: WorkflowNodeInfo[];
9
+ }
10
+ type GetOrderedNodeList = (params: GetOrderedNodeListParams) => GetOrderedNodeListRes;
11
+ /**
12
+ * 获取有序的节点列表
13
+ * 暂时先实现单线工作流,且节点只有开始与目标端口各一个。
14
+ * 1. 找到开始与结束节点
15
+ * 2. 从开始节点逐一向后查找
16
+ */
17
+ export declare const getOrderedNodeList: GetOrderedNodeList;
18
+ export {};
19
+ //# sourceMappingURL=get-ordered-node-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ordered-node-list.d.ts","sourceRoot":"","sources":["../../src/utils/get-ordered-node-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE1D,UAAU,wBAAwB;IAChC,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,qBAAqB;IAC7B,eAAe,EAAE,gBAAgB,EAAE,CAAC;CACrC;AAED,KAAK,kBAAkB,GAAG,CACxB,MAAM,EAAE,wBAAwB,KAC7B,qBAAqB,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBA4ChC,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getOrderedNodeList = void 0;
4
+ /**
5
+ * 获取有序的节点列表
6
+ * 暂时先实现单线工作流,且节点只有开始与目标端口各一个。
7
+ * 1. 找到开始与结束节点
8
+ * 2. 从开始节点逐一向后查找
9
+ */
10
+ const getOrderedNodeList = (params) => {
11
+ const { workflowData, startNode, endNode } = params;
12
+ const { edges, nodes } = workflowData;
13
+ const orderedNodeList = [startNode, endNode];
14
+ let currentNodeId = startNode.id;
15
+ let pending = true;
16
+ do {
17
+ const currentEdge = edges.find((edge) => edge.sourceWorkflowNodeResourceId === currentNodeId);
18
+ if (!currentEdge) {
19
+ throw new Error("invalid edge");
20
+ }
21
+ const { targetWorkflowNodeResourceId } = currentEdge;
22
+ const targetWorkflowNode = nodes.find((node) => node.id === targetWorkflowNodeResourceId);
23
+ if (targetWorkflowNode) {
24
+ currentNodeId = targetWorkflowNode.id;
25
+ if (currentNodeId === endNode.id) {
26
+ pending = false;
27
+ }
28
+ else {
29
+ orderedNodeList.splice(-1, 0, targetWorkflowNode);
30
+ }
31
+ }
32
+ else {
33
+ throw new Error("invalid edge");
34
+ }
35
+ } while (pending);
36
+ const res = {
37
+ orderedNodeList,
38
+ };
39
+ return res;
40
+ };
41
+ exports.getOrderedNodeList = getOrderedNodeList;
@@ -0,0 +1,3 @@
1
+ export * from "./get-end-node-output-variables";
2
+ export * from "./get-ordered-node-list";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,18 @@
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("./get-end-node-output-variables"), exports);
18
+ __exportStar(require("./get-ordered-node-list"), exports);
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@ldsg/workflow",
3
+ "version": "0.2.0",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist/"
8
+ ],
9
+ "types": "dist",
10
+ "keywords": [],
11
+ "author": "wanxger",
12
+ "license": "MIT",
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
16
+ "dependencies": {
17
+ "lodash": "^4.17.21",
18
+ "@ldsg/handler": "0.2.0",
19
+ "@ldsg/resource": "0.2.0",
20
+ "@ldsg/resource-definition": "0.2.0"
21
+ },
22
+ "devDependencies": {
23
+ "@types/lodash": "^4.14.202",
24
+ "@ldsg/types": "0.2.0"
25
+ },
26
+ "scripts": {
27
+ "build": "pnpm clean && tsc --project tsconfig.build.json",
28
+ "clean": "rm -rf dist"
29
+ }
30
+ }