@ldsg/workflow 0.2.5 → 0.2.7
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.
|
@@ -119,6 +119,8 @@ test("WorkflowResource execute", async () => {
|
|
|
119
119
|
settings: {
|
|
120
120
|
title: "",
|
|
121
121
|
description: "",
|
|
122
|
+
startWorkflowNodeResourceId: "1",
|
|
123
|
+
endWorkflowNodeResourceId: "5",
|
|
122
124
|
},
|
|
123
125
|
});
|
|
124
126
|
const { endNodeOutputVariables } = await aWorkflowResource.execute({
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,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,CA+DtB;IAEF,eAAe,EAAE,eAAe,CAY9B;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.WorkflowResource = void 0;
|
|
7
7
|
const resource_1 = require("@ldsg/resource");
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const constants_1 = require("./constants");
|
|
10
9
|
const utils_1 = require("./utils");
|
|
11
10
|
class WorkflowResource extends resource_1.Resource {
|
|
12
11
|
constructor() {
|
|
@@ -58,14 +57,12 @@ class WorkflowResource extends resource_1.Resource {
|
|
|
58
57
|
};
|
|
59
58
|
this.execute = async (params) => {
|
|
60
59
|
const { startNodeInputVariables } = params;
|
|
61
|
-
const { getWorkflowData } = this;
|
|
60
|
+
const { getWorkflowData, settings: { startWorkflowNodeResourceId, endWorkflowNodeResourceId }, } = this;
|
|
62
61
|
const nodeIdToVariablesMap = new Map();
|
|
63
62
|
const { workflowData } = getWorkflowData();
|
|
64
63
|
const { nodes } = workflowData;
|
|
65
|
-
const startNode = nodes.find((value) => value.
|
|
66
|
-
|
|
67
|
-
const endNode = nodes.find((value) => value.workflowNodeTypeResourceId ===
|
|
68
|
-
constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.end);
|
|
64
|
+
const startNode = nodes.find((value) => value.id === startWorkflowNodeResourceId);
|
|
65
|
+
const endNode = nodes.find((value) => value.id === endWorkflowNodeResourceId);
|
|
69
66
|
if (!startNode || !endNode) {
|
|
70
67
|
throw new Error("invalid workflow nodes");
|
|
71
68
|
}
|
|
@@ -82,8 +79,7 @@ class WorkflowResource extends resource_1.Resource {
|
|
|
82
79
|
const executer = new Executer({
|
|
83
80
|
nodeId: id,
|
|
84
81
|
nodeIdToVariablesMap,
|
|
85
|
-
...(node.workflowNodeTypeResourceId ===
|
|
86
|
-
constants_1.SPECIFIC_WORKFLOW_NODE_TYPE_TO_WORKFLOW_NODE_TYPE_RESOURCE_ID_MAP.start
|
|
82
|
+
...(node.workflowNodeTypeResourceId === startWorkflowNodeResourceId
|
|
87
83
|
? { inputVariables: startNodeInputVariables }
|
|
88
84
|
: {}),
|
|
89
85
|
});
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import { SpecificResourceSettings } from "@ldsg/types";
|
|
2
2
|
export interface WorkflowSpecificResourceSettings extends SpecificResourceSettings {
|
|
3
|
+
/**
|
|
4
|
+
* Start Workflow Node Resource ID
|
|
5
|
+
*/
|
|
6
|
+
startWorkflowNodeResourceId: string;
|
|
7
|
+
/**
|
|
8
|
+
* End Workflow Node Resource ID
|
|
9
|
+
*/
|
|
10
|
+
endWorkflowNodeResourceId: string;
|
|
3
11
|
}
|
|
4
12
|
//# sourceMappingURL=specific-resource-settings.d.ts.map
|
|
@@ -1 +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;
|
|
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;IAChC;;OAEG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,yBAAyB,EAAE,MAAM,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/workflow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"lodash": "^4.17.21",
|
|
18
|
-
"@ldsg/resource": "0.2.
|
|
19
|
-
"@ldsg/
|
|
20
|
-
"@ldsg/
|
|
18
|
+
"@ldsg/resource": "0.2.7",
|
|
19
|
+
"@ldsg/handler": "0.2.7",
|
|
20
|
+
"@ldsg/resource-definition": "0.2.7"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/lodash": "^4.14.202",
|
|
24
|
-
"@ldsg/types": "0.2.
|
|
24
|
+
"@ldsg/types": "0.2.7"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "tsc --project tsconfig.build.json",
|