@veridid/workflow-parser 0.4.9 → 0.4.11
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/dist/implementations/action.default.d.ts +8 -0
- package/dist/implementations/display.default.d.ts +10 -0
- package/dist/implementations/workflow.default.d.ts +10 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/actionextension.d.ts +5 -0
- package/dist/interfaces/actioninterface.d.ts +9 -0
- package/dist/interfaces/displayextension.d.ts +4 -0
- package/dist/interfaces/displayinterface.d.ts +7 -0
- package/dist/interfaces/workflowinterface.d.ts +25 -0
- package/dist/workflowparser.d.ts +24 -0
- package/dist/workflowparser.js +7 -1
- package/dist/workflowparser.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IActionExtension } from "../interfaces/actionextension";
|
|
2
|
+
import { IAction, Transition } from "../interfaces/actioninterface";
|
|
3
|
+
import { Instance, Workflow } from "../interfaces/workflowinterface";
|
|
4
|
+
export declare class DefaultAction implements IAction {
|
|
5
|
+
actionExtension: IActionExtension;
|
|
6
|
+
constructor(actionExtension: IActionExtension);
|
|
7
|
+
processAction(currentWorkflow: Workflow, instance: Instance, actionInput: any): Promise<Transition>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDisplayExtension } from "../interfaces/displayextension";
|
|
2
|
+
import { DisplayData, IDisplay } from "../interfaces/displayinterface";
|
|
3
|
+
import { Instance, Workflow } from "../interfaces/workflowinterface";
|
|
4
|
+
export declare class DefaultDisplay implements IDisplay {
|
|
5
|
+
displayExtension: IDisplayExtension;
|
|
6
|
+
constructor(displayExtension: IDisplayExtension);
|
|
7
|
+
processDisplay(clientID: string, curentWorkflow: Workflow, instance: Instance, currentState: string): Promise<DisplayData>;
|
|
8
|
+
parseString(text: string, data: any): string;
|
|
9
|
+
findNode(id: string, currentNode: any): any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Instance, IWorkflow, Workflow } from '../interfaces/workflowinterface';
|
|
2
|
+
import { Client } from 'pg';
|
|
3
|
+
export declare class DefaultWorkflow implements IWorkflow {
|
|
4
|
+
dbClient: Client;
|
|
5
|
+
constructor(dbClient: Client);
|
|
6
|
+
getWorkflowByID(workflowID: string): Promise<Workflow>;
|
|
7
|
+
getInstanceByID(clientID: string, workflowID: string): Promise<Instance>;
|
|
8
|
+
newInstance(clientID: string, workflowID: string, stateID: string): Promise<Instance>;
|
|
9
|
+
updateInstanceByID(clientID: string, workflowID: string, stateID: string, data: any): Promise<Instance>;
|
|
10
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
export { DefaultWorkflow, DefaultAction, DefaultDisplay, WorkflowParser } from './workflowparser';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WorkflowParser = void 0;
|
|
3
|
+
exports.WorkflowParser = exports.DefaultDisplay = exports.DefaultAction = exports.DefaultWorkflow = void 0;
|
|
4
4
|
require("reflect-metadata");
|
|
5
5
|
var workflowparser_1 = require("./workflowparser");
|
|
6
|
+
Object.defineProperty(exports, "DefaultWorkflow", { enumerable: true, get: function () { return workflowparser_1.DefaultWorkflow; } });
|
|
7
|
+
Object.defineProperty(exports, "DefaultAction", { enumerable: true, get: function () { return workflowparser_1.DefaultAction; } });
|
|
8
|
+
Object.defineProperty(exports, "DefaultDisplay", { enumerable: true, get: function () { return workflowparser_1.DefaultDisplay; } });
|
|
6
9
|
Object.defineProperty(exports, "WorkflowParser", { enumerable: true, get: function () { return workflowparser_1.WorkflowParser; } });
|
|
7
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4BAA0B;AAQ1B,mDAKyB;AAJrB,iHAAA,eAAe,OAAA;AACf,+GAAA,aAAa,OAAA;AACb,gHAAA,cAAc,OAAA;AACd,gHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Instance, Workflow } from "./workflowinterface";
|
|
2
|
+
export interface IAction {
|
|
3
|
+
processAction: (currentWorkflow: Workflow, instance: Instance, action: any) => Promise<Transition>;
|
|
4
|
+
}
|
|
5
|
+
export interface Transition {
|
|
6
|
+
type: string;
|
|
7
|
+
workflow_id: string;
|
|
8
|
+
state_id: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Workflow, Instance } from "./workflowinterface";
|
|
2
|
+
export interface IDisplay {
|
|
3
|
+
processDisplay: (clientID: string, curentWorkflow: Workflow, instance: Instance, currentState: string) => Promise<DisplayData>;
|
|
4
|
+
}
|
|
5
|
+
export interface DisplayData {
|
|
6
|
+
displayData: any[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface IWorkflow {
|
|
2
|
+
getWorkflowByID: (workflowID: string) => Promise<Workflow>;
|
|
3
|
+
getInstanceByID: (workflowID: string, clientID: string) => Promise<Instance>;
|
|
4
|
+
updateInstanceByID: (clientID: string, workflowID: string, stateID: string, data: any) => Promise<Instance>;
|
|
5
|
+
newInstance: (clientID: string, workflowID: string, stateID: string, data: any) => Promise<Instance>;
|
|
6
|
+
}
|
|
7
|
+
export interface Workflow {
|
|
8
|
+
workflow_id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
initial_state: string;
|
|
11
|
+
render: any[];
|
|
12
|
+
states: [{
|
|
13
|
+
state_id: string;
|
|
14
|
+
display_data: any;
|
|
15
|
+
actions: any;
|
|
16
|
+
transitions: any;
|
|
17
|
+
}];
|
|
18
|
+
}
|
|
19
|
+
export interface Instance {
|
|
20
|
+
instance_id: string;
|
|
21
|
+
workflow_id: string;
|
|
22
|
+
client_id: string;
|
|
23
|
+
current_state: string;
|
|
24
|
+
state_data: any;
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IDisplay } from "./interfaces/displayinterface";
|
|
2
|
+
import { IAction } from "./interfaces/actioninterface";
|
|
3
|
+
import { IWorkflow } from "./interfaces/workflowinterface";
|
|
4
|
+
import { IActionExtension } from "./interfaces/actionextension";
|
|
5
|
+
import { IDisplayExtension } from "./interfaces/displayextension";
|
|
6
|
+
import { Transition } from './interfaces/actioninterface';
|
|
7
|
+
import { Instance } from './interfaces/workflowinterface';
|
|
8
|
+
import { Workflow } from './interfaces/workflowinterface';
|
|
9
|
+
export declare class WorkflowParser {
|
|
10
|
+
display: IDisplay;
|
|
11
|
+
action: IAction;
|
|
12
|
+
workflow: IWorkflow;
|
|
13
|
+
constructor(display: IDisplay, action: IAction, workflow: IWorkflow);
|
|
14
|
+
parse(clientID: string, action: {
|
|
15
|
+
workflowID: string;
|
|
16
|
+
actionID: string;
|
|
17
|
+
data?: any;
|
|
18
|
+
}): Promise<any>;
|
|
19
|
+
}
|
|
20
|
+
export { DefaultWorkflow } from './implementations/workflow.default';
|
|
21
|
+
export { DefaultAction } from './implementations/action.default';
|
|
22
|
+
export { DefaultDisplay } from './implementations/display.default';
|
|
23
|
+
export { IActionExtension, IDisplayExtension };
|
|
24
|
+
export { Transition, Instance, Workflow };
|
package/dist/workflowparser.js
CHANGED
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.WorkflowParser = void 0;
|
|
12
|
+
exports.DefaultDisplay = exports.DefaultAction = exports.DefaultWorkflow = exports.WorkflowParser = void 0;
|
|
13
13
|
class WorkflowParser {
|
|
14
14
|
constructor(display, action, workflow) {
|
|
15
15
|
this.display = display;
|
|
@@ -56,4 +56,10 @@ class WorkflowParser {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
exports.WorkflowParser = WorkflowParser;
|
|
59
|
+
var workflow_default_1 = require("./implementations/workflow.default");
|
|
60
|
+
Object.defineProperty(exports, "DefaultWorkflow", { enumerable: true, get: function () { return workflow_default_1.DefaultWorkflow; } });
|
|
61
|
+
var action_default_1 = require("./implementations/action.default");
|
|
62
|
+
Object.defineProperty(exports, "DefaultAction", { enumerable: true, get: function () { return action_default_1.DefaultAction; } });
|
|
63
|
+
var display_default_1 = require("./implementations/display.default");
|
|
64
|
+
Object.defineProperty(exports, "DefaultDisplay", { enumerable: true, get: function () { return display_default_1.DefaultDisplay; } });
|
|
59
65
|
//# sourceMappingURL=workflowparser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflowparser.js","sourceRoot":"","sources":["../src/workflowparser.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"workflowparser.js","sourceRoot":"","sources":["../src/workflowparser.ts"],"names":[],"mappings":";;;;;;;;;;;;AASA,MAAa,cAAc;IAKvB,YACI,OAAiB,EACjB,MAAe,EACf,QAAmB;QAEnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAEK,KAAK,CACP,QAAgB,EAChB,MAGgB;;YAEhB,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;YAEjE,2BAA2B;YAC3B,IAAI,cAAc,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,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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;AAED,uEAAqE;AAA5D,mHAAA,eAAe,OAAA;AACxB,mEAAiE;AAAxD,+GAAA,aAAa,OAAA;AACtB,qEAAmE;AAA1D,iHAAA,cAAc,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veridid/workflow-parser",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "For parsing JSON data that represents data-driven state machines and delivering the display data for clients to render.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/workflowparser.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"build": "tsc",
|
|
8
9
|
"start": "node dist/index.js",
|