@pxp-nd/flow 1.0.63 → 1.0.65
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/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/README.md +1 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Action.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Action.js +82 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/ActionType.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/ActionType.js +28 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Event.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Event.js +28 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.js +28 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Flow.d.ts +24 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Flow.js +116 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.js +78 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Node.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/Node.js +273 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.d.ts +21 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.js +165 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/OriginName.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/OriginName.js +28 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/index.d.ts +11 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/controllers/index.js +25 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Action.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Action.js +85 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/ActionType.d.ts +16 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/ActionType.js +71 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Event.d.ts +9 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Event.js +44 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FieldMap.d.ts +11 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FieldMap.js +52 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Flow.d.ts +14 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Flow.js +60 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.d.ts +16 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.js +69 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Node.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/Node.js +93 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.d.ts +10 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.js +49 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.d.ts +13 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.js +58 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/OriginName.d.ts +9 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/OriginName.js +43 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/index.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/entity/index.js +27 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/index.d.ts +3 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/index.js +15 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/Event.d.ts +21 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/Event.js +83 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/index.d.ts +3 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/dist/subscribers/index.js +6 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/package.json +39 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/tsconfig.json +29 -0
- package/.yalc/@pxp-nd/flow/.yalc/@pxp-nd/flow/yalc.sig +1 -0
- package/.yalc/@pxp-nd/flow/README.md +1 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Action.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Action.js +82 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/ActionType.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/ActionType.js +28 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Event.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Event.js +28 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/FieldMap.js +28 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Flow.d.ts +33 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Flow.js +469 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/FlowInstance.js +84 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Node.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/Node.js +273 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.d.ts +21 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/NodeInstance.js +191 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/OriginName.d.ts +17 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/OriginName.js +28 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/index.d.ts +11 -0
- package/.yalc/@pxp-nd/flow/dist/controllers/index.js +25 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Action.d.ts +20 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Action.js +85 -0
- package/.yalc/@pxp-nd/flow/dist/entity/ActionType.d.ts +16 -0
- package/.yalc/@pxp-nd/flow/dist/entity/ActionType.js +71 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Event.d.ts +9 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Event.js +44 -0
- package/.yalc/@pxp-nd/flow/dist/entity/FieldMap.d.ts +11 -0
- package/.yalc/@pxp-nd/flow/dist/entity/FieldMap.js +52 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Flow.d.ts +14 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Flow.js +60 -0
- package/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.d.ts +16 -0
- package/.yalc/@pxp-nd/flow/dist/entity/FlowInstance.js +69 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Node.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/dist/entity/Node.js +93 -0
- package/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.d.ts +10 -0
- package/.yalc/@pxp-nd/flow/dist/entity/NodeConnection.js +49 -0
- package/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.d.ts +13 -0
- package/.yalc/@pxp-nd/flow/dist/entity/NodeInstance.js +58 -0
- package/.yalc/@pxp-nd/flow/dist/entity/OriginName.d.ts +9 -0
- package/.yalc/@pxp-nd/flow/dist/entity/OriginName.js +43 -0
- package/.yalc/@pxp-nd/flow/dist/entity/index.d.ts +23 -0
- package/.yalc/@pxp-nd/flow/dist/entity/index.js +27 -0
- package/.yalc/@pxp-nd/flow/dist/index.d.ts +3 -0
- package/.yalc/@pxp-nd/flow/dist/index.js +19 -0
- package/.yalc/@pxp-nd/flow/dist/subscribers/Event.d.ts +21 -0
- package/.yalc/@pxp-nd/flow/dist/subscribers/Event.js +84 -0
- package/.yalc/@pxp-nd/flow/dist/subscribers/index.d.ts +3 -0
- package/.yalc/@pxp-nd/flow/dist/subscribers/index.js +6 -0
- package/.yalc/@pxp-nd/flow/package.json +39 -0
- package/.yalc/@pxp-nd/flow/tsconfig.json +29 -0
- package/.yalc/@pxp-nd/flow/yalc.lock +9 -0
- package/.yalc/@pxp-nd/flow/yalc.sig +1 -0
- package/dist/controllers/Flow.d.ts +2 -0
- package/dist/controllers/Flow.js +104 -3
- package/dist/controllers/Node.d.ts +10 -11
- package/dist/controllers/Node.js +26 -11
- package/dist/entity/Flow.d.ts +2 -0
- package/dist/entity/Flow.js +20 -0
- package/package.json +1 -1
- package/yalc.lock +9 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const FlowInstance_1 = __importDefault(require("./FlowInstance"));
|
|
17
|
+
const Node_1 = __importDefault(require("./Node"));
|
|
18
|
+
const common_1 = require("@pxp-nd/common");
|
|
19
|
+
let NodeInstance = class NodeInstance extends common_1.PxpEntity {
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'node_instance_id' }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], NodeInstance.prototype, "nodeInstanceId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ name: 'node_id', type: 'numeric', nullable: true }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], NodeInstance.prototype, "nodeId", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ name: 'flow_instance_id', type: 'numeric', nullable: true }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], NodeInstance.prototype, "flowInstanceId", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ name: 'run_time', type: 'timestamp', nullable: false }),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], NodeInstance.prototype, "runTime", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ name: 'schedule', type: 'timestamp', nullable: false }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], NodeInstance.prototype, "schedule", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ name: 'status', type: 'varchar', nullable: false, length: 50 }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], NodeInstance.prototype, "status", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.ManyToOne)(() => FlowInstance_1.default, flowInstance => flowInstance.nodeInstances),
|
|
47
|
+
(0, typeorm_1.JoinColumn)({ name: 'flow_instance_id' }),
|
|
48
|
+
__metadata("design:type", FlowInstance_1.default)
|
|
49
|
+
], NodeInstance.prototype, "flowInstance", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.ManyToOne)(() => Node_1.default, node => node.nodeInstances, { eager: true }),
|
|
52
|
+
(0, typeorm_1.JoinColumn)({ name: 'node_id' }),
|
|
53
|
+
__metadata("design:type", Node_1.default)
|
|
54
|
+
], NodeInstance.prototype, "node", void 0);
|
|
55
|
+
NodeInstance = __decorate([
|
|
56
|
+
(0, typeorm_1.Entity)({ name: 'twf_node_instance' })
|
|
57
|
+
], NodeInstance);
|
|
58
|
+
exports.default = NodeInstance;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const typeorm_1 = require("typeorm");
|
|
16
|
+
const FieldMap_1 = __importDefault(require("./FieldMap"));
|
|
17
|
+
const common_1 = require("@pxp-nd/common");
|
|
18
|
+
let OriginName = class OriginName extends common_1.PxpEntity {
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)({ name: 'origin_name_id' }),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], OriginName.prototype, "originNameId", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: false, length: 100 }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], OriginName.prototype, "name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], OriginName.prototype, "description", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: false, length: 150 }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], OriginName.prototype, "originKey", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.OneToMany)(() => FieldMap_1.default, (fieldMap) => fieldMap.originName),
|
|
38
|
+
__metadata("design:type", Array)
|
|
39
|
+
], OriginName.prototype, "fields", void 0);
|
|
40
|
+
OriginName = __decorate([
|
|
41
|
+
(0, typeorm_1.Entity)({ name: 'twf_origin_name' })
|
|
42
|
+
], OriginName);
|
|
43
|
+
exports.default = OriginName;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Action from './Action';
|
|
2
|
+
import ActionType from './ActionType';
|
|
3
|
+
import Event from './Event';
|
|
4
|
+
import FieldMap from './FieldMap';
|
|
5
|
+
import Flow from './Flow';
|
|
6
|
+
import FlowInstance from './FlowInstance';
|
|
7
|
+
import Node from './Node';
|
|
8
|
+
import NodeConnection from './NodeConnection';
|
|
9
|
+
import NodeInstance from './NodeInstance';
|
|
10
|
+
import OriginName from './OriginName';
|
|
11
|
+
export { Action, ActionType, Event, FieldMap, Flow, FlowInstance, Node, NodeConnection, NodeInstance, OriginName };
|
|
12
|
+
export declare const entities: {
|
|
13
|
+
Action: typeof Action;
|
|
14
|
+
ActionType: typeof ActionType;
|
|
15
|
+
Event: typeof Event;
|
|
16
|
+
FieldMap: typeof FieldMap;
|
|
17
|
+
Flow: typeof Flow;
|
|
18
|
+
FlowInstance: typeof FlowInstance;
|
|
19
|
+
Node: typeof Node;
|
|
20
|
+
NodeConnection: typeof NodeConnection;
|
|
21
|
+
NodeInstance: typeof NodeInstance;
|
|
22
|
+
OriginName: typeof OriginName;
|
|
23
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
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.entities = exports.OriginName = exports.NodeInstance = exports.NodeConnection = exports.Node = exports.FlowInstance = exports.Flow = exports.FieldMap = exports.Event = exports.ActionType = exports.Action = void 0;
|
|
7
|
+
const Action_1 = __importDefault(require("./Action"));
|
|
8
|
+
exports.Action = Action_1.default;
|
|
9
|
+
const ActionType_1 = __importDefault(require("./ActionType"));
|
|
10
|
+
exports.ActionType = ActionType_1.default;
|
|
11
|
+
const Event_1 = __importDefault(require("./Event"));
|
|
12
|
+
exports.Event = Event_1.default;
|
|
13
|
+
const FieldMap_1 = __importDefault(require("./FieldMap"));
|
|
14
|
+
exports.FieldMap = FieldMap_1.default;
|
|
15
|
+
const Flow_1 = __importDefault(require("./Flow"));
|
|
16
|
+
exports.Flow = Flow_1.default;
|
|
17
|
+
const FlowInstance_1 = __importDefault(require("./FlowInstance"));
|
|
18
|
+
exports.FlowInstance = FlowInstance_1.default;
|
|
19
|
+
const Node_1 = __importDefault(require("./Node"));
|
|
20
|
+
exports.Node = Node_1.default;
|
|
21
|
+
const NodeConnection_1 = __importDefault(require("./NodeConnection"));
|
|
22
|
+
exports.NodeConnection = NodeConnection_1.default;
|
|
23
|
+
const NodeInstance_1 = __importDefault(require("./NodeInstance"));
|
|
24
|
+
exports.NodeInstance = NodeInstance_1.default;
|
|
25
|
+
const OriginName_1 = __importDefault(require("./OriginName"));
|
|
26
|
+
exports.OriginName = OriginName_1.default;
|
|
27
|
+
exports.entities = { Action: Action_1.default, ActionType: ActionType_1.default, Event: Event_1.default, FieldMap: FieldMap_1.default, Flow: Flow_1.default, FlowInstance: FlowInstance_1.default, Node: Node_1.default, NodeConnection: NodeConnection_1.default, NodeInstance: NodeInstance_1.default, OriginName: OriginName_1.default };
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./entity"), exports);
|
|
18
|
+
__exportStar(require("./controllers"), exports);
|
|
19
|
+
__exportStar(require("./subscribers"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kplian 2021
|
|
3
|
+
*
|
|
4
|
+
* MIT
|
|
5
|
+
*
|
|
6
|
+
* Member Controller
|
|
7
|
+
*
|
|
8
|
+
* @summary Event Subscriber
|
|
9
|
+
* @author Favio Figueroa
|
|
10
|
+
* Jaime Rivera
|
|
11
|
+
*
|
|
12
|
+
* Created at : 2021-07-08 12:55:38
|
|
13
|
+
* Last modified :
|
|
14
|
+
*/
|
|
15
|
+
import { EntitySubscriberInterface, InsertEvent } from "typeorm";
|
|
16
|
+
import EventModel from "../entity/Event";
|
|
17
|
+
export declare class Event implements EntitySubscriberInterface<EventModel> {
|
|
18
|
+
listenTo(): typeof EventModel;
|
|
19
|
+
afterInsert(event: InsertEvent<EventModel>): Promise<void>;
|
|
20
|
+
checkConditions(viewData: Record<string, any>, flowId: number, actionId: number): Promise<boolean>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Event = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Kplian 2021
|
|
15
|
+
*
|
|
16
|
+
* MIT
|
|
17
|
+
*
|
|
18
|
+
* Member Controller
|
|
19
|
+
*
|
|
20
|
+
* @summary Event Subscriber
|
|
21
|
+
* @author Favio Figueroa
|
|
22
|
+
* Jaime Rivera
|
|
23
|
+
*
|
|
24
|
+
* Created at : 2021-07-08 12:55:38
|
|
25
|
+
* Last modified :
|
|
26
|
+
*/
|
|
27
|
+
const typeorm_1 = require("typeorm");
|
|
28
|
+
const Event_1 = __importDefault(require("../entity/Event"));
|
|
29
|
+
const Node_1 = __importDefault(require("../entity/Node"));
|
|
30
|
+
const Action_1 = __importDefault(require("../entity/Action"));
|
|
31
|
+
const Flow_1 = __importDefault(require("../entity/Flow"));
|
|
32
|
+
const core_1 = require("@pxp-nd/core");
|
|
33
|
+
const FlowInstance_1 = __importDefault(require("../entity/FlowInstance"));
|
|
34
|
+
let Event = class Event {
|
|
35
|
+
listenTo() {
|
|
36
|
+
return Event_1.default;
|
|
37
|
+
}
|
|
38
|
+
async afterInsert(event) {
|
|
39
|
+
//todo investigate replace variables into condition
|
|
40
|
+
const newEvent = event.entity;
|
|
41
|
+
const node = await (0, core_1.__)(Node_1.default.find({ where: { actionId: newEvent.actionId, isActive: 1 } }));
|
|
42
|
+
for (const n of node) {
|
|
43
|
+
//get data of view
|
|
44
|
+
const { action: { originName, originKey }, } = n;
|
|
45
|
+
const executeView = `select * from ${originName} where ${originKey} = ${newEvent.dataId}`;
|
|
46
|
+
const resExecuteView = await (0, typeorm_1.getManager)().query(executeView);
|
|
47
|
+
const flow = await (0, core_1.__)(Flow_1.default.findOne({ where: { flowId: n.flowId, isActive: 1 } }));
|
|
48
|
+
if (flow && flow.vendorId == resExecuteView[0].vendor_id &&
|
|
49
|
+
(await this.checkConditions(resExecuteView[0], n.flowId, newEvent.actionId))) {
|
|
50
|
+
//now check all conditions
|
|
51
|
+
let flowInstance = new FlowInstance_1.default();
|
|
52
|
+
flowInstance.flowId = n.flowId;
|
|
53
|
+
flowInstance.dataId = newEvent.dataId;
|
|
54
|
+
flowInstance.originName = originName;
|
|
55
|
+
flowInstance.originKey = originKey;
|
|
56
|
+
flowInstance.actionId = newEvent.actionId;
|
|
57
|
+
flowInstance.status = "pending";
|
|
58
|
+
flowInstance = await event.manager.save(FlowInstance_1.default, flowInstance);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async checkConditions(viewData, flowId, actionId) {
|
|
63
|
+
const action = await Action_1.default.findOne(actionId);
|
|
64
|
+
const node = await Node_1.default.findOne({ where: { actionId, flowId, isActive: 1 } });
|
|
65
|
+
let res = true;
|
|
66
|
+
if (node && action.eventConfig && node.actionConfigJson) {
|
|
67
|
+
const eventConfig = JSON.parse(action.eventConfig);
|
|
68
|
+
const actionConfigJson = JSON.parse(node.actionConfigJson);
|
|
69
|
+
if (eventConfig.filters) {
|
|
70
|
+
eventConfig.filters.forEach((filter) => {
|
|
71
|
+
if (actionConfigJson[filter.nodeField] &&
|
|
72
|
+
viewData[filter.originField] != actionConfigJson[filter.nodeField]) {
|
|
73
|
+
res = false;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return res;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
Event = __decorate([
|
|
82
|
+
(0, typeorm_1.EventSubscriber)()
|
|
83
|
+
], Event);
|
|
84
|
+
exports.Event = Event;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.EventSubscriber = void 0;
|
|
4
|
+
const Event_1 = require("./Event");
|
|
5
|
+
Object.defineProperty(exports, "EventSubscriber", { enumerable: true, get: function () { return Event_1.Event; } });
|
|
6
|
+
exports.subscribers = [Event_1.Event];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pxp-nd/flow",
|
|
3
|
+
"version": "1.0.47",
|
|
4
|
+
"description": "Workflow module for pxp-nd framework",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"prepublish": "tsc",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
|
+
"build": "rimraf ./dist && tsc",
|
|
11
|
+
"dev:publish": "yalc publish",
|
|
12
|
+
"prod:publish": "npm publish",
|
|
13
|
+
"dev": "tsc-watch --target es2017 --outDir ./dist --onSuccess \"node .\"",
|
|
14
|
+
"start": "npm run build && node dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/kplian/flow-nd.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"flow",
|
|
22
|
+
"pxp",
|
|
23
|
+
"pxp-nd"
|
|
24
|
+
],
|
|
25
|
+
"author": "Kplian",
|
|
26
|
+
"license": "ISC",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/kplian/flow-nd/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/kplian/flow-nd#readme",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@pxp-nd/common": "^1.1.4",
|
|
33
|
+
"@pxp-nd/core": "^1.1.13",
|
|
34
|
+
"axios": "^0.21.1",
|
|
35
|
+
"lodash": "^4.17.21",
|
|
36
|
+
"typeorm": "^0.2.36"
|
|
37
|
+
},
|
|
38
|
+
"yalcSig": "baf56e8c290984dd34d85e5866d5c63c"
|
|
39
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2019",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"allowJs": false,
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"rootDir": "src",
|
|
8
|
+
"strict": false,
|
|
9
|
+
"noImplicitAny": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"emitDecoratorMetadata": true,
|
|
15
|
+
"experimentalDecorators": true,
|
|
16
|
+
"moduleResolution": "node",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"strictPropertyInitialization": false,
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"custom.d.ts",
|
|
23
|
+
"src/**/*.ts"
|
|
24
|
+
],
|
|
25
|
+
"exclude": [
|
|
26
|
+
"node_modules",
|
|
27
|
+
"dist"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
baf56e8c290984dd34d85e5866d5c63c
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* 15-Aug-2023 SP25AUG23 Rensi Arteaga Add logic to duplicate flows templates nadd icons
|
|
15
15
|
* 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
|
|
16
16
|
* 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
|
|
17
|
+
* 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
|
|
17
18
|
* ******************************************************************************
|
|
18
19
|
*/
|
|
19
20
|
import { EntityManager } from 'typeorm';
|
|
@@ -34,5 +35,6 @@ declare class Flow extends Controller {
|
|
|
34
35
|
insertEventFlow(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
35
36
|
removeFlow(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
36
37
|
changeStatusFlow(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
38
|
+
basicFlowList(params: Record<string, any>): Promise<unknown>;
|
|
37
39
|
}
|
|
38
40
|
export default Flow;
|
package/dist/controllers/Flow.js
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* 15-Aug-2023 SP25AUG23 Rensi Arteaga Add logic to duplicate flows templates nadd icons
|
|
16
16
|
* 17-Aug-2023 SP25AUG23 Mercedes Zambrana Add insertEventFlow
|
|
17
17
|
* 18-Aug-2023 SP25AUG23 Mercedes Zambrana Add removeFlow
|
|
18
|
+
* 01-Sep-2023 SP08SEP23 Rensi Arteaga add base flow list
|
|
18
19
|
* ******************************************************************************
|
|
19
20
|
*/
|
|
20
21
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -91,6 +92,8 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
91
92
|
newFlow.name = params.name;
|
|
92
93
|
newFlow.description = params.description;
|
|
93
94
|
newFlow.status = 'off';
|
|
95
|
+
newFlow.modifiedAt = new Date();
|
|
96
|
+
newFlow.modifiedBy = this.user.username;
|
|
94
97
|
const insertNewFlow = await (0, core_1.__)(manager.save(Flow_1.default, newFlow));
|
|
95
98
|
// create the nodes
|
|
96
99
|
// get the first node "the trigger node"
|
|
@@ -103,6 +106,8 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
103
106
|
if (dataFlow) {
|
|
104
107
|
dataFlow.isActive = 0;
|
|
105
108
|
dataFlow.enabled = 'N';
|
|
109
|
+
dataFlow.modifiedAt = new Date();
|
|
110
|
+
dataFlow.modifiedBy = this.user.username;
|
|
106
111
|
const updFlow = await (0, core_1.__)(manager.save(dataFlow));
|
|
107
112
|
if (updFlow) {
|
|
108
113
|
let flowInstance = `UPDATE twf_flow_instance SET
|
|
@@ -139,6 +144,8 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
139
144
|
let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(params.flowId));
|
|
140
145
|
if (dataFlow) {
|
|
141
146
|
dataFlow.name = params.name;
|
|
147
|
+
dataFlow.modifiedAt = new Date();
|
|
148
|
+
dataFlow.modifiedBy = this.user.username;
|
|
142
149
|
const updFlow = await (0, core_1.__)(manager.save(dataFlow));
|
|
143
150
|
return { success: true };
|
|
144
151
|
}
|
|
@@ -240,7 +247,6 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
240
247
|
else {
|
|
241
248
|
taskIds.push('new');
|
|
242
249
|
}
|
|
243
|
-
//}
|
|
244
250
|
}
|
|
245
251
|
}
|
|
246
252
|
if (params.board.origin == 'deleteTask') {
|
|
@@ -294,9 +300,13 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
294
300
|
});
|
|
295
301
|
masterId = id;
|
|
296
302
|
const savedNodes = await manager.save(newConnection);
|
|
297
|
-
// }
|
|
298
303
|
}
|
|
299
|
-
|
|
304
|
+
}
|
|
305
|
+
let dataFlow = await (0, core_1.__)(Flow_1.default.findOne(flowId));
|
|
306
|
+
if (dataFlow) {
|
|
307
|
+
dataFlow.modifiedAt = new Date();
|
|
308
|
+
dataFlow.modifiedBy = this.user.username;
|
|
309
|
+
await (0, core_1.__)(manager.save(dataFlow));
|
|
300
310
|
}
|
|
301
311
|
return { success: true, nodeId: newId };
|
|
302
312
|
}
|
|
@@ -451,6 +461,9 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
451
461
|
nodeIdMaster: null,
|
|
452
462
|
nodeIdChild: id,
|
|
453
463
|
});
|
|
464
|
+
dataFlow.modifiedAt = new Date();
|
|
465
|
+
dataFlow.modifiedBy = this.user.username;
|
|
466
|
+
await (0, core_1.__)(manager.save(dataFlow));
|
|
454
467
|
const savedNodes = await manager.save(newConnection);
|
|
455
468
|
return { success: true, nodeId: id };
|
|
456
469
|
}
|
|
@@ -493,6 +506,8 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
493
506
|
else {
|
|
494
507
|
dataFlow.status = 'off';
|
|
495
508
|
}
|
|
509
|
+
dataFlow.modifiedAt = new Date();
|
|
510
|
+
dataFlow.modifiedBy = this.user.username;
|
|
496
511
|
const updFlow = await (0, core_1.__)(manager.save(dataFlow));
|
|
497
512
|
return { success: true };
|
|
498
513
|
}
|
|
@@ -500,6 +515,83 @@ let Flow = class Flow extends core_1.Controller {
|
|
|
500
515
|
return { success: false };
|
|
501
516
|
}
|
|
502
517
|
}
|
|
518
|
+
async basicFlowList(params) {
|
|
519
|
+
const isActive = params._isActive;
|
|
520
|
+
const type = params._type;
|
|
521
|
+
const vendorId = params._vendorId;
|
|
522
|
+
const queryBuilder = await (0, typeorm_1.getManager)()
|
|
523
|
+
.createQueryBuilder()
|
|
524
|
+
.select([
|
|
525
|
+
'f.flow_id as flowId ',
|
|
526
|
+
'f.vendor_id as vendorId',
|
|
527
|
+
'f.code as code',
|
|
528
|
+
'f.name as name',
|
|
529
|
+
'f.enabled as enabled',
|
|
530
|
+
'f.type as type',
|
|
531
|
+
'f.created_by as createdBy',
|
|
532
|
+
'f.user_id_ai as userIdAi',
|
|
533
|
+
'f.user_ai as userAi',
|
|
534
|
+
'f.modified_by as modifiedBy',
|
|
535
|
+
'f.created_at as createdAt',
|
|
536
|
+
'f.modified_at as modifiedAt',
|
|
537
|
+
'f.is_active as isActive',
|
|
538
|
+
'f.description as description',
|
|
539
|
+
'f.icon as icon',
|
|
540
|
+
'f.status as status',
|
|
541
|
+
'COUNT(fi.flow_instance_id) AS numberOfInstance',
|
|
542
|
+
])
|
|
543
|
+
.from('twf_flow', 'f')
|
|
544
|
+
.leftJoin('twf_flow_instance', 'fi', 'fi.flow_id = f.flow_id');
|
|
545
|
+
// Optional filters
|
|
546
|
+
if (isActive !== undefined) {
|
|
547
|
+
queryBuilder.where('f.is_active = :isActive', { isActive });
|
|
548
|
+
}
|
|
549
|
+
if (type) {
|
|
550
|
+
queryBuilder.andWhere('f.type = :type', { type });
|
|
551
|
+
}
|
|
552
|
+
if (vendorId) {
|
|
553
|
+
queryBuilder.andWhere('f.vendor_id = :vendorId', { vendorId });
|
|
554
|
+
}
|
|
555
|
+
// Sorting and pagination
|
|
556
|
+
queryBuilder.orderBy(`f.${params.sort}`, params.dir).skip(params.start).take(params.limit);
|
|
557
|
+
queryBuilder.groupBy([
|
|
558
|
+
'f.flow_id',
|
|
559
|
+
'f.vendor_id',
|
|
560
|
+
'f.code',
|
|
561
|
+
'f.name',
|
|
562
|
+
'f.enabled',
|
|
563
|
+
'f.type',
|
|
564
|
+
'f.created_by',
|
|
565
|
+
'f.user_id_ai',
|
|
566
|
+
'f.user_ai',
|
|
567
|
+
'f.modified_by',
|
|
568
|
+
'f.created_at',
|
|
569
|
+
'f.modified_at',
|
|
570
|
+
'f.is_active',
|
|
571
|
+
'f.description',
|
|
572
|
+
'f.icon',
|
|
573
|
+
'f.status',
|
|
574
|
+
]);
|
|
575
|
+
const data = await queryBuilder.getRawMany();
|
|
576
|
+
// Construct the count query
|
|
577
|
+
const countQuery = await (0, typeorm_1.getManager)()
|
|
578
|
+
.createQueryBuilder()
|
|
579
|
+
.select('COUNT(f.flow_id)', 'count')
|
|
580
|
+
.from('twf_flow', 'f');
|
|
581
|
+
// Optional filters for the count query
|
|
582
|
+
if (isActive !== undefined) {
|
|
583
|
+
countQuery.where('f.is_active = :isActive', { isActive });
|
|
584
|
+
}
|
|
585
|
+
if (type) {
|
|
586
|
+
countQuery.andWhere('f.type = :type', { type });
|
|
587
|
+
}
|
|
588
|
+
if (vendorId) {
|
|
589
|
+
countQuery.andWhere('f.vendor_id = :vendorId', { vendorId });
|
|
590
|
+
}
|
|
591
|
+
const totalCount = await countQuery.getRawOne();
|
|
592
|
+
const total = totalCount.count;
|
|
593
|
+
return { data, total };
|
|
594
|
+
}
|
|
503
595
|
};
|
|
504
596
|
__decorate([
|
|
505
597
|
(0, core_1.Get)(),
|
|
@@ -591,6 +683,15 @@ __decorate([
|
|
|
591
683
|
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
592
684
|
__metadata("design:returntype", Promise)
|
|
593
685
|
], Flow.prototype, "changeStatusFlow", null);
|
|
686
|
+
__decorate([
|
|
687
|
+
(0, core_1.Get)(),
|
|
688
|
+
(0, core_1.DbSettings)('Orm'),
|
|
689
|
+
(0, core_1.ReadOnly)(true),
|
|
690
|
+
(0, core_1.Log)(true),
|
|
691
|
+
__metadata("design:type", Function),
|
|
692
|
+
__metadata("design:paramtypes", [Object]),
|
|
693
|
+
__metadata("design:returntype", Promise)
|
|
694
|
+
], Flow.prototype, "basicFlowList", null);
|
|
594
695
|
Flow = __decorate([
|
|
595
696
|
(0, core_1.Model)('flow-nd/Flow')
|
|
596
697
|
], Flow);
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Last modified :
|
|
2
|
+
* ******************************************************************************
|
|
3
|
+
* NAME: Node.ts
|
|
4
|
+
* DEVELOPER: Favio Figueroa
|
|
5
|
+
* DESCRIPTION: Flow Controller
|
|
6
|
+
* REVISIONS:
|
|
7
|
+
* Date Change ID Author Description
|
|
8
|
+
* -------------- ----------- -------------- ------------------------------------
|
|
9
|
+
* 08-Jul-2021 Favio Figueroa Created
|
|
10
|
+
* 04-Sep-2023 SP08SEP23 Rensi Arteaga add modifiedAt for flows
|
|
11
|
+
* ******************************************************************************
|
|
13
12
|
*/
|
|
14
13
|
import { EntityManager } from 'typeorm';
|
|
15
14
|
import { Controller } from '@pxp-nd/core';
|