@veridid/workflow-parser 0.3.2 → 0.4.1

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.
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DefaultAction = void 0;
13
+ class DefaultAction {
14
+ constructor(actionExtension) {
15
+ this.actionExtension = actionExtension;
16
+ }
17
+ processAction(currentWorkflow, instance, actionInput) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ console.log("*** processAction action=", actionInput);
20
+ // start with a blank transition
21
+ let transition = {
22
+ type: "none",
23
+ workflow_id: instance.workflow_id,
24
+ state_id: instance.current_state
25
+ };
26
+ if (actionInput.actionID != "") {
27
+ // find the state
28
+ const state = currentWorkflow.states.find(item => { return item.state_id == instance.current_state; });
29
+ // Only process actions if there are any
30
+ if (state.actions.length > 0) {
31
+ const action = state.actions.find(item => { return item.action_id == actionInput.actionID; });
32
+ // handle the types of actions from the extension first
33
+ if (this.actionExtension) {
34
+ transition = yield this.actionExtension.actions(actionInput, instance, action, transition);
35
+ }
36
+ // handle the types of actions
37
+ switch (action === null || action === void 0 ? void 0 : action.type) {
38
+ case "saveData":
39
+ // check condition
40
+ if (eval(action.condition)) {
41
+ // save the data from the workflow action to the instance data
42
+ instance.state_data = Object.assign(instance.state_data, action.value);
43
+ }
44
+ break;
45
+ case "stateData":
46
+ // check condition
47
+ if (eval(action.condition)) {
48
+ // save the data from the actionInput to the instance data
49
+ instance.state_data = Object.assign(instance.state_data, actionInput.data);
50
+ }
51
+ break;
52
+ case "stateTransition":
53
+ // check condition
54
+ if (eval(action.condition)) {
55
+ // set the transition condition for a new state
56
+ transition.type = "stateTransition";
57
+ transition.state_id = action.state_id;
58
+ }
59
+ break;
60
+ case "workflowTransition":
61
+ // check condition
62
+ if (eval(action.condition)) {
63
+ // set the transition condition for a new workflow
64
+ transition.type = "workflowTransition";
65
+ transition.workflow_id = action.workflow_id;
66
+ }
67
+ break;
68
+ default:
69
+ }
70
+ }
71
+ // check the transitions until the first true condition
72
+ let findtransition = state.transitions.find(item => { return eval(item.condition); });
73
+ if (findtransition) {
74
+ transition = findtransition;
75
+ }
76
+ }
77
+ return transition;
78
+ });
79
+ }
80
+ }
81
+ exports.DefaultAction = DefaultAction;
82
+ //# sourceMappingURL=action.default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.default.js","sourceRoot":"","sources":["../../../src/implementations/action.default.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,aAAa;IAGtB,YAAY,eAAiC;QACzC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IAC3C,CAAC;IAEK,aAAa,CAAC,eAAyB,EAAE,QAAkB,EAAE,WAAgB;;YAC/E,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,WAAW,CAAC,CAAC;YACtD,gCAAgC;YAChC,IAAI,UAAU,GAAc;gBACxB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,QAAQ,CAAC,WAAW;gBACjC,QAAQ,EAAE,QAAQ,CAAC,aAAa;aACnC,CAAC;YAEF,IAAG,WAAW,CAAC,QAAQ,IAAE,EAAE,EAAE,CAAC;gBAC1B,iBAAiB;gBACjB,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,IAAI,CAAC,QAAQ,IAAI,QAAQ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pC,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;4BAC1C,CAAC;4BACD,MAAM;wBACV,KAAK,oBAAoB;4BACrB,kBAAkB;4BAClB,IAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;gCACxB,kDAAkD;gCAClD,UAAU,CAAC,IAAI,GAAG,oBAAoB,CAAC;gCACvC,UAAU,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;4BAChD,CAAC;4BACD,MAAM;wBACV,QAAQ;oBACZ,CAAC;gBACL,CAAC;gBACD,uDAAuD;gBACvD,IAAI,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA,CAAC,CAAC,CAAC,CAAA;gBACpF,IAAG,cAAc,EAAE,CAAC;oBAChB,UAAU,GAAG,cAAc,CAAC;gBAChC,CAAC;YACL,CAAC;YACD,OAAO,UAAU,CAAC;QACtB,CAAC;KAAA;CACJ;AArED,sCAqEC"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DefaultDisplay = void 0;
13
+ class DefaultDisplay {
14
+ constructor(displayExtension) {
15
+ this.displayExtension = displayExtension;
16
+ }
17
+ processDisplay(clientID, curentWorkflow, instance, currentState) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ var _a;
20
+ console.log("*** processDisplay");
21
+ // build the display data to return
22
+ let displayData = { displayData: [] };
23
+ // for each display entry check condition and process if required
24
+ const display = curentWorkflow.states.find(item => { return item.state_id == currentState; });
25
+ const displayTemplate = display.display_data;
26
+ for (var i = 0; i < displayTemplate.length; i++) {
27
+ // condition can use instance.stateData
28
+ if ((_a = displayTemplate[i]) === null || _a === void 0 ? void 0 : _a.condition) {
29
+ if (!eval(displayTemplate[i].condition)) {
30
+ continue; // don't process if condition not met
31
+ }
32
+ }
33
+ // handle the types of displays from the extension first
34
+ if (this.displayExtension) {
35
+ let newValue = yield this.displayExtension.displays(instance, displayTemplate[i]);
36
+ if (newValue) {
37
+ displayTemplate[i] = newValue;
38
+ }
39
+ }
40
+ switch (displayTemplate[i].type) {
41
+ case "text":
42
+ displayTemplate[i].text = this.parseString(displayTemplate[i].text, instance.state_data);
43
+ break;
44
+ case "control":
45
+ displayTemplate[i].text = this.parseString(displayTemplate[i].text, instance.state_data);
46
+ break;
47
+ }
48
+ displayData.displayData[i] = displayTemplate[i];
49
+ }
50
+ return displayData;
51
+ });
52
+ }
53
+ parseString(text, data) {
54
+ // Split out the string
55
+ const parts = text.split(/[{,}]/);
56
+ // check every other string segment looking for a key in data
57
+ // Text for parsing should not start with a variable "{variable} hello!"
58
+ // *** repalce this code with a more comprehensive parser
59
+ for (var i = 1; i < parts.length; i += 2) {
60
+ // find this value in the data
61
+ let value = this.findNode(parts[i], data);
62
+ if (value) {
63
+ // if there is a value, replace the entry
64
+ parts[i] = value;
65
+ }
66
+ }
67
+ // put the string back together again
68
+ return parts.join("");
69
+ }
70
+ findNode(id, currentNode) {
71
+ var currentChild, result;
72
+ if (id in currentNode) {
73
+ return currentNode[id];
74
+ }
75
+ else {
76
+ // use a for loop instead of forEach to avoid nested functions
77
+ // otherwise "return" will not work properly
78
+ for (var i = 0; currentNode.children !== undefined; i += 1) {
79
+ currentChild = currentNode.children[i];
80
+ // Search in the current child
81
+ result = this.findNode(id, currentChild);
82
+ // Return the result if the node has been found
83
+ if (result !== false) {
84
+ return result;
85
+ }
86
+ }
87
+ // the node has not been found and we have no more options
88
+ return false;
89
+ }
90
+ }
91
+ }
92
+ exports.DefaultDisplay = DefaultDisplay;
93
+ //# sourceMappingURL=display.default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.default.js","sourceRoot":"","sources":["../../../src/implementations/display.default.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,cAAc;IAGvB,YAAY,gBAAmC;QAC3C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;IAC7C,CAAC;IAEK,cAAc,CAChB,QAAgB,EAChB,cAAwB,EACxB,QAAkB,EAClB,YAAoB;;;YAEpB,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAClC,mCAAmC;YACnC,IAAI,WAAW,GAAgB,EAAC,WAAW,EAAE,EAAE,EAAC,CAAC;YACjD,iEAAiE;YACjE,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,IAAI,CAAC,QAAQ,IAAI,YAAY,CAAA,CAAA,CAAC,CAAC,CAAC;YAC5F,MAAM,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;YAC7C,KAAI,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,uCAAuC;gBACvC,IAAG,MAAA,eAAe,CAAC,CAAC,CAAC,0CAAE,SAAS,EAAE,CAAC;oBAC/B,IAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;wBACrC,SAAS,CAAG,qCAAqC;oBACrD,CAAC;gBACL,CAAC;gBAED,wDAAwD;gBACxD,IAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBACvB,IAAI,QAAQ,GAAG,MAAM,IAAI,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nB,CAAC;QACL,CAAC;QACD,qCAAqC;QACrC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAGD,QAAQ,CAAC,EAAU,EAAE,WAAgB;QACjC,IAAI,YAAiB,EAAE,MAAW,CAAC;QAEnC,IAAI,EAAE,IAAI,WAAW,EAAE,CAAC;YACpB,OAAO,WAAW,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC;aAAM,CAAC;YACJ,8DAA8D;YAC9D,4CAA4C;YAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,QAAQ,KAAK,SAAS,EAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1D,YAAY,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAEvC,8BAA8B;gBAC9B,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;gBAEzC,+CAA+C;gBAC/C,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;oBACnB,OAAO,MAAM,CAAC;gBAClB,CAAC;YACL,CAAC;YAED,0DAA0D;YAC1D,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ;AA7FD,wCA6FC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DefaultWorkflow = void 0;
13
+ const uuid_1 = require("uuid");
14
+ class DefaultWorkflow {
15
+ constructor(dbClient) {
16
+ this.dbClient = dbClient;
17
+ }
18
+ getWorkflowByID(workflowID) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ var _a;
21
+ console.log("*** getWorkflowByID");
22
+ const res = yield ((_a = this.dbClient) === null || _a === void 0 ? void 0 : _a.query('SELECT * FROM workflows WHERE "workflow_id" = $1', [workflowID]));
23
+ //console.log("WorkflowID=", workflowID);
24
+ //console.log("Workflow=", res.rows[0]);
25
+ return res.rows.length > 0 ? res.rows[0] : null;
26
+ });
27
+ }
28
+ getInstanceByID(clientID, workflowID) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ var _a;
31
+ console.log("*** getInstanceByID");
32
+ let instance = null;
33
+ let query = 'SELECT * FROM instances WHERE "client_id" = $1 AND "workflow_id" = $2';
34
+ let res = yield ((_a = this.dbClient) === null || _a === void 0 ? void 0 : _a.query(query, [clientID, workflowID]));
35
+ //console.log("Look for existing instance clientID=", clientID, " workflowID=", workflowID);
36
+ //console.log("Found ", res.rows);
37
+ if (res.rows.length === 0) {
38
+ // no instance
39
+ //console.log("getInstanceByID - no instance");
40
+ const workflow = yield this.getWorkflowByID(workflowID);
41
+ // Create new instance with new instanceID, the initial state fromt he workflow, and empoty instance data
42
+ instance = yield this.newInstance(clientID, workflowID, workflow.initial_state);
43
+ }
44
+ else {
45
+ instance = res.rows.length > 0 ? res.rows[0] : null;
46
+ }
47
+ //console.log("Instance=", instance);
48
+ return instance;
49
+ });
50
+ }
51
+ newInstance(clientID, workflowID, stateID) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ var _a;
54
+ console.log("*** newInstance=", clientID, workflowID, stateID);
55
+ const query = 'INSERT INTO instances (instance_id, workflow_id, client_id, current_state, state_data) VALUES ($1, $2, $3, $4, $5)';
56
+ let result = yield ((_a = this.dbClient) === null || _a === void 0 ? void 0 : _a.query(query, [(0, uuid_1.v4)(), workflowID, clientID, stateID, {}]));
57
+ let res = yield this.getInstanceByID(clientID, workflowID);
58
+ return res;
59
+ });
60
+ }
61
+ updateInstanceByID(clientID, workflowID, stateID, data) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ var _a;
64
+ console.log("*** updateInstance=", clientID, workflowID, stateID, data);
65
+ // check instance and create new if does not exist
66
+ let instance = yield this.getInstanceByID(clientID, workflowID);
67
+ // update current_state and state_data
68
+ const query = "UPDATE instances SET current_state = $1, state_data = $2 WHERE workflow_id = $3 AND client_id = $4";
69
+ //console.log("query=", query);
70
+ //console.log("stateID=", stateID, " data=", data);
71
+ //console.log("workflowID=", stateID, " clientID=", clientID);
72
+ yield ((_a = this.dbClient) === null || _a === void 0 ? void 0 : _a.query(query, [stateID, JSON.stringify(data), workflowID, clientID]));
73
+ instance = yield this.getInstanceByID(clientID, workflowID);
74
+ return instance;
75
+ });
76
+ }
77
+ }
78
+ exports.DefaultWorkflow = DefaultWorkflow;
79
+ //# sourceMappingURL=workflow.default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow.default.js","sourceRoot":"","sources":["../../../src/implementations/workflow.default.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+BAAoC;AAEpC,MAAa,eAAe;IAGxB,YAAY,QAAgB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAEK,eAAe,CAAC,UAAkB;;;YACpC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YACnC,MAAM,GAAG,GAAG,MAAM,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,CAAC,kDAAkD,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA,CAAC;YACzG,yCAAyC;YACzC,wCAAwC;YACxC,OAAO,GAAG,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACpD,CAAC;KAAA;IAEK,eAAe,CAAC,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AI,GAAG,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YAC3D,OAAO,GAAG,CAAC;QACf,CAAC;KAAA;IAEK,kBAAkB,CAAC,QAAgB,EAAE,UAAkB,EAAE,OAAe,EAAE,IAAS;;;YACrF,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YACxE,kDAAkD;YAClD,IAAI,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YAChE,sCAAsC;YACtC,MAAM,KAAK,GAAG,oGAAoG,CAAC;YACnH,+BAA+B;YAC/B,mDAAmD;YACnD,8DAA8D;YAC9D,MAAM,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,KAAK,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAA,CAAC;YACzF,QAAQ,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;YAC5D,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CAEJ;AA3DD,0CA2DC"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WorkflowParser = void 0;
4
+ require("reflect-metadata");
5
+ var workflowparser_1 = require("./workflowparser");
6
+ Object.defineProperty(exports, "WorkflowParser", { enumerable: true, get: function () { return workflowparser_1.WorkflowParser; } });
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAG1B,mDAEyB;AADrB,gHAAA,cAAc,OAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=actionextension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actionextension.js","sourceRoot":"","sources":["../../../src/interfaces/actionextension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=actioninterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actioninterface.js","sourceRoot":"","sources":["../../../src/interfaces/actioninterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=displayextension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"displayextension.js","sourceRoot":"","sources":["../../../src/interfaces/displayextension.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=displayinterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"displayinterface.js","sourceRoot":"","sources":["../../../src/interfaces/displayinterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=workflowinterface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflowinterface.js","sourceRoot":"","sources":["../../../src/interfaces/workflowinterface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.WorkflowParser = void 0;
13
+ class WorkflowParser {
14
+ constructor(display, action, workflow) {
15
+ this.display = display;
16
+ this.action = action;
17
+ this.workflow = workflow;
18
+ }
19
+ parse(clientID, action) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ console.log("=== parse clientID=", clientID, " action=", action);
22
+ // get the workflow as JSON
23
+ let curentWorkflow = yield this.workflow.getWorkflowByID(action === null || action === void 0 ? void 0 : action.workflowID);
24
+ console.log("+++ currentWorkflow");
25
+ // get the instance as JSON
26
+ let instance = yield this.workflow.getInstanceByID(clientID, action === null || action === void 0 ? void 0 : action.workflowID);
27
+ console.log("+++ instance");
28
+ // current state in the workflow
29
+ let currentState = instance.current_state;
30
+ // process the action
31
+ let transition = yield this.action.processAction(curentWorkflow, instance, action);
32
+ console.log("+++ transition");
33
+ if (transition.type != "none") {
34
+ // process the transition
35
+ if (transition.type === 'workflowTransition') {
36
+ // get the new workflow
37
+ curentWorkflow = yield this.workflow.getWorkflowByID(transition === null || transition === void 0 ? void 0 : transition.workflow_id);
38
+ // get the new instance
39
+ instance = yield this.workflow.getInstanceByID(clientID, transition === null || transition === void 0 ? void 0 : transition.workflow_id);
40
+ currentState = instance.current_state;
41
+ }
42
+ if (transition.type === 'stateTransition') {
43
+ // set the new current state
44
+ currentState = transition.state_id;
45
+ }
46
+ }
47
+ // update the instance
48
+ const updatedInstance = yield this.workflow.updateInstanceByID(clientID, curentWorkflow.workflow_id, currentState, instance.state_data);
49
+ console.log("+++ Updated instance");
50
+ // process the display
51
+ const display = yield this.display.processDisplay(clientID, curentWorkflow, updatedInstance, currentState);
52
+ console.log("+++ Prcoessed display");
53
+ // return workflowID and display
54
+ return { workflowID: curentWorkflow.workflow_id, displayData: display.displayData };
55
+ });
56
+ }
57
+ }
58
+ exports.WorkflowParser = WorkflowParser;
59
+ //# sour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uB;oBACvB,cAAc,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,CAAC,CAAC;oBAC9E,uBAAuB;oBACvB,QAAQ,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,WAAW,CAAC,CAAC;oBAClF,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC;gBAC1C,CAAC;gBACD,IAAG,UAAU,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;oBACvC,4BAA4B;oBAC5B,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC;gBACvC,CAAC;YACL,CAAC;YAED,sBAAsB;YACtB,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,EAAE,cAAc,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;YACxI,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YAEpC,sBAAsB;YACtB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,CAAC,CAAA;YAC1G,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YAErC,gCAAgC;YAChC,OAAO,EAAC,UAAU,EAAE,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAC,CAAC;QACtF,CAAC;KAAA;CACJ;AAjED,wCAiEC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExtendedAction = void 0;
13
+ class ExtendedAction {
14
+ actions(actionInput, instance, action, transition) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ console.log("^^^ Extension -> actions");
17
+ // handle the types of actions
18
+ switch (action === null || action === void 0 ? void 0 : action.type) {
19
+ case "extension":
20
+ // check condition
21
+ if (eval(action.condition)) {
22
+ // save the data from the workflow action to the instance data
23
+ instance.state_data = Object.assign(instance.state_data, action.value);
24
+ }
25
+ break;
26
+ default:
27
+ }
28
+ return transition;
29
+ });
30
+ }
31
+ ;
32
+ }
33
+ exports.ExtendedAction = ExtendedAction;
34
+ //# sourceMappingURL=action.extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.extension.js","sourceRoot":"","sources":["../../test/action.extension.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,cAAc;IACjB,OAAO,CAAC,WAAgB,EAAE,QAAkB,EAAE,MAAW,EAAE,UAAsB;;YACnF,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;YACxC,8BAA8B;YAC9B,QAAO,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,EAAE,CAAC;gBAClB,KAAK,WAAW;oBACZ,kBAAkB;oBAClB,IAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;wBACxB,8DAA8D;wBAC9D,QAAQ,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;oBAC3E,CAAC;oBACD,MAAM;gBACV,QAAQ;YACZ,CAAC;YAED,OAAO,UAAU,CAAC;QACtB,CAAC;KAAA;IAAA,CAAC;CACL;AAjBD,wCAiBC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExtendedDisplay = void 0;
13
+ class ExtendedDisplay {
14
+ displays(instance, template) {
15
+ return __awaiter(this, void 0, void 0, function* () {
16
+ console.log("^^^ Extension -> displays");
17
+ // handle the types of actions
18
+ switch (template.type) {
19
+ case "extended":
20
+ template.text = "Extended display render!!";
21
+ break;
22
+ }
23
+ return template;
24
+ });
25
+ }
26
+ ;
27
+ }
28
+ exports.ExtendedDisplay = ExtendedDisplay;
29
+ //# sourceMappingURL=display.extension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"display.extension.js","sourceRoot":"","sources":["../../test/display.extension.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,MAAa,eAAe;IAClB,QAAQ,CAAC,QAAkB,EAAE,QAAa;;YAC5C,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;YACzC,8BAA8B;YAC9B,QAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACnB,KAAK,UAAU;oBACX,QAAQ,CAAC,IAAI,GAAE,2BAA2B,CAAC;oBAC3C,MAAM;YACd,CAAC;YACD,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;IAAA,CAAC;CACL;AAXD,0CAWC"}
@@ -0,0 +1,178 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
42
+ });
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ const workflowparser_1 = require("../src/workflowparser");
46
+ const display_default_1 = require("../src/implementations/display.default");
47
+ const action_default_1 = require("../src/implementations/action.default");
48
+ const workflow_default_1 = require("../src/implementations/workflow.default");
49
+ const pg_1 = require("pg");
50
+ const testWorkflows = __importStar(require("./testworkflows.json"));
51
+ const action_extension_1 = require("./action.extension");
52
+ const display_extension_1 = require("./display.extension");
53
+ const testClient = new pg_1.Client({
54
+ user: 'admin',
55
+ password: 'root',
56
+ host: 'localhost',
57
+ port: 5432,
58
+ database: 'test_workflows'
59
+ });
60
+ connectDatabase(testClient);
61
+ dropTable(testClient, "workflows");
62
+ dropTable(testClient, "instances");
63
+ addTable(testClient, `CREATE TABLE workflows (
64
+ workflow_id VARCHAR(255) PRIMARY KEY,
65
+ name VARCHAR(255),
66
+ initial_state VARCHAR(255),
67
+ render JSONB,
68
+ states JSONB
69
+ );`);
70
+ addTable(testClient, `CREATE TABLE instances (
71
+ instance_id UUID PRIMARY KEY,
72
+ workflow_id VARCHAR(255),
73
+ client_id VARCHAR(255),
74
+ current_state VARCHAR(255),
75
+ state_data JSONB
76
+ );`);
77
+ insertWorkflows(testClient);
78
+ const defaultWorkflow = new workflow_default_1.DefaultWorkflow(testClient);
79
+ const actionExtension = new action_extension_1.ExtendedAction();
80
+ const defaultAction = new action_default_1.DefaultAction(actionExtension);
81
+ const displayExtenion = new display_extension_1.ExtendedDisplay();
82
+ const defaultDisplay = new display_default_1.DefaultDisplay(displayExtenion);
83
+ const testParser = new workflowparser_1.WorkflowParser(defaultDisplay, defaultAction, defaultWorkflow);
84
+ function connectDatabase(dbClient) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ dbClient.connect();
87
+ });
88
+ }
89
+ function dropTable(dbClient, table) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ try {
92
+ console.log("*** Drop Table - ", table);
93
+ const result = yield dbClient.query('DROP TABLE IF EXISTS ' + table + ';');
94
+ console.log(result);
95
+ }
96
+ catch (error) {
97
+ console.log("Drop workflows error=", error);
98
+ }
99
+ });
100
+ }
101
+ function addTable(dbClient, tableSql) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ try {
104
+ console.log("*** Create Tables");
105
+ const result = yield dbClient.query(tableSql);
106
+ console.log(result);
107
+ }
108
+ catch (error) {
109
+ console.log("Drop table error=", error);
110
+ }
111
+ });
112
+ }
113
+ function insertWorkflows(dbClient) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ console.log("*** Insert Workflows");
116
+ const query = 'INSERT INTO workflows (workflow_id, name, initial_state, render, states) VALUES ($1, $2, $3, $4, $5)';
117
+ for (const workflow of testWorkflows.workflows) {
118
+ console.log("Inserting workflow:", workflow);
119
+ console.log("Inserting workflowID:", workflow.workflow_id);
120
+ yield dbClient.query(query, [
121
+ workflow.workflow_id,
122
+ workflow.name,
123
+ workflow.initial_state,
124
+ JSON.stringify(workflow.render),
125
+ JSON.stringify(workflow.states)
126
+ ]);
127
+ }
128
+ });
129
+ }
130
+ function runtests() {
131
+ return __awaiter(this, void 0, void 0, function* () {
132
+ console.log("~~~ Start Test 1 - Load default workflow and state");
133
+ let display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "", data: {} });
134
+ console.log("Returns displaydata= %j", display);
135
+ console.log("~~~ Start Test 2 - go to Page1");
136
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "nextButton", data: {} });
137
+ console.log("Returns displaydata= %j", display);
138
+ console.log("~~~ Start Test 3 - return from Page1 to menu");
139
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "backButton", data: {} });
140
+ console.log("Returns displaydata= %j", display);
141
+ console.log("~~~ Start Test 4 - go to page 2");
142
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "dataButton", data: {} });
143
+ console.log("Returns displaydata= %j", display);
144
+ console.log("~~~ Start Test 5 - save fixed data");
145
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "saveButton", data: {} });
146
+ console.log("Returns displaydata= %j", display);
147
+ console.log("~~~ Start Test 6 - save mobile data");
148
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "stateButton", data: { "Date": "Today" } });
149
+ console.log("Returns displaydata= %j", display);
150
+ console.log("~~~ Start Test 7 - return to menu");
151
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "backButton", data: {} });
152
+ console.log("Returns displaydata= %j", display);
153
+ console.log("~~~ Start Test 8 - go to new workflow");
154
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "workflowButton", data: {} });
155
+ console.log("Returns displaydata= %j", display);
156
+ console.log("~~~ Start Test 9 - go back to root-menu workflow");
157
+ display = yield testParser.parse("TestPersonID", { workflowID: "other-menu", actionID: "homeButton", data: {} });
158
+ console.log("Returns displaydata= %j", display);
159
+ console.log("~~~ Start Test 10 - go to new workflow");
160
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "workflowButton", data: {} });
161
+ console.log("Returns displaydata= %j", display);
162
+ console.log("~~~ Start Test 11 - return to root-menu workflow");
163
+ display = yield testParser.parse("TestPersonID", { workflowID: "other-menu", actionID: "noactionButton", data: {} });
164
+ console.log("Returns displaydata= %j", display);
165
+ console.log("~~~ Start Test 12 - go to page 2");
166
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "dataButton", data: {} });
167
+ console.log("Returns displaydata= %j", display);
168
+ console.log("~~~ Start Test 13 - extension test");
169
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "extensionButton", data: {} });
170
+ console.log("Returns displaydata= %j", display);
171
+ console.log("~~~ Start Test 14 - return to menu");
172
+ display = yield testParser.parse("TestPersonID", { workflowID: "root-menu", actionID: "backButton", data: {} });
173
+ console.log("Returns displaydata= %j", display);
174
+ });
175
+ }
176
+ // start test
177
+ runtests();
178
+ //# sourceMappingURL=test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test.js","sourceRoot":"","sources":["../../test/test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;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IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAC/G,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAEpD,CAAC;CAAA;AAED,aAAa;AACb,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,221 @@
1
+ {
2
+ "workflows": [
3
+ {
4
+ "name": "Test Workflow Display Name",
5
+ "workflow_id": "root-menu",
6
+ "initial_state": "menu",
7
+ "render": [
8
+ {}
9
+ ],
10
+ "states": [
11
+ {
12
+ "name": "Test Workflow menu",
13
+ "state_id": "menu",
14
+ "display_data": [
15
+ {
16
+ "type": "image",
17
+ "url": "http://image.com/image.png"
18
+ },
19
+ {
20
+ "type": "text",
21
+ "display": "title",
22
+ "text": "This is the test for workflow"
23
+ },
24
+ {
25
+ "type": "text",
26
+ "text": "First time showing this page",
27
+ "condition": "instance?.state_data?.first==undefined"
28
+ },
29
+ {
30
+ "type": "button",
31
+ "text": "Next button",
32
+ "action_id": "nextButton"
33
+ },
34
+ {
35
+ "type": "button",
36
+ "text": "Data button",
37
+ "action_id": "dataButton"
38
+ },
39
+ {
40
+ "type": "button",
41
+ "text": "Workflow button",
42
+ "action_id": "workflowButton"
43
+ }
44
+ ],
45
+ "actions": [
46
+ {
47
+ "action_id": "nextButton",
48
+ "type": "saveData",
49
+ "condition": "true",
50
+ "value": { "first": true }
51
+ }
52
+ ],
53
+ "transitions": [
54
+ {
55
+ "transition_id": "nextButton",
56
+ "type": "stateTransition",
57
+ "state_id": "page1",
58
+ "workflow_id": "",
59
+ "condition": "actionInput.actionID=='nextButton'"
60
+ },
61
+ {
62
+ "transition_id": "dataButton",
63
+ "type": "stateTransition",
64
+ "state_id": "page2",
65
+ "workflow_id": "",
66
+ "condition": "actionInput.actionID=='dataButton'"
67
+ }
68
+ ]
69
+ },
70
+ {
71
+ "name": "Test Workflow page 1",
72
+ "state_id": "page1",
73
+ "display_data": [
74
+ {
75
+ "type": "text",
76
+ "text": "This is the page for testing state transitions."
77
+ },
78
+ {
79
+ "type": "button",
80
+ "text": "Go back",
81
+ "action_id": "backButton"
82
+ }
83
+ ],
84
+ "actions": [],
85
+ "transitions": [
86
+ {
87
+ "transition_id": "backButton",
88
+ "type": "stateTransition",
89
+ "state_id": "menu",
90
+ "workflow_id": "",
91
+ "condition": "actionInput.actionID=='backButton'"
92
+ }
93
+ ]
94
+ },
95
+ {
96
+ "name": "Test Workflow page 2 data test",
97
+ "state_id": "page2",
98
+ "display_data": [
99
+ {
100
+ "type": "text",
101
+ "display": "title",
102
+ "text": "This is the page for testing data."
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Date={Date}",
107
+ "condition": "instance?.state_data?.Date!=undefined"
108
+ },
109
+ {
110
+ "type": "extended",
111
+ "text": "Extended text"
112
+ },
113
+ {
114
+ "type": "button",
115
+ "text": "Save Data",
116
+ "action_id": "saveButton"
117
+ },
118
+ {
119
+ "type": "button",
120
+ "text": "State Data",
121
+ "action_id": "stateButton"
122
+ },
123
+ {
124
+ "type": "button",
125
+ "text": "Extension",
126
+ "action_id": "extensionButton"
127
+ },
128
+ {
129
+ "type": "button",
130
+ "text": "Go back",
131
+ "action_id": "backButton"
132
+ }
133
+ ],
134
+ "actions": [
135
+ {
136
+ "action_id": "stateButton",
137
+ "type": "stateData",
138
+ "condition": "true",
139
+ "value": "action.data"
140
+ },
141
+ {
142
+ "action_id": "extensionButton",
143
+ "type": "extension",
144
+ "condition": "true",
145
+ "value": { "extended": true }
146
+ },
147
+ {
148
+ "action_id": "saveButton",
149
+ "type": "saveData",
150
+ "condition": "true",
151
+ "value": { "data": "Hello" }
152
+ }
153
+ ],
154
+ "transitions": [
155
+ {
156
+ "transition_id": "backButton",
157
+ "type": "stateTransition",
158
+ "state_id": "menu",
159
+ "workflow_id": "",
160
+ "condition": "actionInput.actionID=='backButton'"
161
+ }
162
+ ]
163
+ }
164
+ ]
165
+ },
166
+ {
167
+ "name": "Test Other Workflow ",
168
+ "workflow_id": "other-menu",
169
+ "initial_state": "menu2",
170
+ "render": [
171
+ {}
172
+ ],
173
+ "states": [
174
+ {
175
+ "name": "Test Other Workflow menu",
176
+ "state_id": "menu2",
177
+ "display_data": [
178
+ {
179
+ "type": "title",
180
+ "text": "This is the other test workflow."
181
+ },
182
+ {
183
+ "type": "button",
184
+ "text": "Go home workflow",
185
+ "action_id": "homeButton"
186
+ },
187
+ {
188
+ "type": "button",
189
+ "text": "No action button",
190
+ "action_id": "noactionButton"
191
+ }
192
+ ],
193
+ "actions": [
194
+ {
195
+ "action_id": "homeButton",
196
+ "type": "workflowTransition",
197
+ "condition": "true",
198
+ "value": "root-menu"
199
+ }
200
+ ],
201
+ "transitions": [
202
+ {
203
+ "transition_id": "homeButton",
204
+ "type": "workflowTransition",
205
+ "state_id": "",
206
+ "workflow_id": "root-menu",
207
+ "condition": "actionInput.actionID=='homeButton'"
208
+ },
209
+ {
210
+ "transition_id": "noactionButton",
211
+ "type": "workflowTransition",
212
+ "state_id": "",
213
+ "workflow_id": "root-menu",
214
+ "condition": "actionInput.actionID=='noactionButton'"
215
+ }
216
+ ]
217
+ }
218
+ ]
219
+ }
220
+ ]
221
+ }
package/package.json CHANGED
@@ -1,40 +1,30 @@
1
1
  {
2
2
  "name": "@veridid/workflow-parser",
3
- "version": "0.3.2",
4
- "description": "Workflow Parser is a TypeScript Node.js module for parsing and managing workflow definitions in a PostgreSQL database.",
3
+ "version": "0.4.1",
4
+ "description": "FOr parsing JOSN data that represents data-driven state machines and delivering the display data for clients to render.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
7
- "build": "mkdir -p dist && cp src/schema.sql dist/",
7
+ "build": "tsc",
8
8
  "start": "node dist/index.js",
9
- "prepublishOnly": "npm run build",
10
- "test": "echo \"Error: no test specified\" && exit 1"
9
+ "test": " tsc --resolveJsonModule test/test.ts && node test/test.js"
11
10
  },
11
+ "keywords": ["workflow", "Parser", "Data-Driven State Machine"],
12
+ "author": "VeriDID Corp. Nas TIl and Dave McKay",
13
+ "license": "MIT",
12
14
  "repository": {
13
15
  "type": "git",
14
- "url": "git+https://github.com/VeriDID/workflow-parser.git"
16
+ "url": "git+https://github.com/DigiCred-Holdings/workflow-parser.git"
15
17
  },
16
- "keywords": [
17
- "workflow",
18
- "parser",
19
- "action-menu"
20
- ],
21
- "author": "Nas Til - VeriDID",
22
- "license": "Apache-2.0",
23
- "bugs": {
24
- "url": "https://github.com/VeriDID/workflow-parser/issues"
18
+ "homepage": "https://github.com/DigiCred-Holdings/workflow-parser#readme",
19
+ "devDependencies": {
20
+ "typescript": "^5.8.2"
25
21
  },
26
- "homepage": "https://github.com/VeriDID/workflow-parser#readme",
27
22
  "dependencies": {
28
- "dotenv": "^16.4.5",
29
- "pg": "^8.12.0",
30
- "uuid": "^10.0.0"
31
- },
32
- "devDependencies": {
33
- "@types/dotenv": "^8.2.0",
34
- "@types/node": "^20.14.2",
35
- "@types/pg": "^8.11.6",
36
- "@types/uuid": "^9.0.8",
37
- "typescript": "^5.4.5"
23
+ "@types/pg": "^8.11.11",
24
+ "pg": "^8.14.1",
25
+ "reflect-metadata": "^0.2.2",
26
+ "typedi": "^0.10.0",
27
+ "uuid": "^11.1.0"
38
28
  },
39
29
  "files": [
40
30
  "dist"