@pxp-nd/flow 1.0.42 → 1.0.45

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.
@@ -21,73 +21,73 @@ const common_1 = require("@pxp-nd/common");
21
21
  let Node = class Node extends common_1.PxpEntity {
22
22
  };
23
23
  __decorate([
24
- typeorm_1.PrimaryGeneratedColumn({ name: 'node_id' }),
24
+ (0, typeorm_1.PrimaryGeneratedColumn)({ name: 'node_id' }),
25
25
  __metadata("design:type", Number)
26
26
  ], Node.prototype, "nodeId", void 0);
27
27
  __decorate([
28
- typeorm_1.Column({ name: 'flow_id', type: 'numeric', nullable: false }),
28
+ (0, typeorm_1.Column)({ name: 'flow_id', type: 'numeric', nullable: false }),
29
29
  __metadata("design:type", Number)
30
30
  ], Node.prototype, "flowId", void 0);
31
31
  __decorate([
32
- typeorm_1.Column({ name: 'action_id', type: 'numeric', nullable: true }),
32
+ (0, typeorm_1.Column)({ name: 'action_id', type: 'numeric', nullable: true }),
33
33
  __metadata("design:type", Number)
34
34
  ], Node.prototype, "actionId", void 0);
35
35
  __decorate([
36
- typeorm_1.Column({ name: 'is_init', type: 'varchar', nullable: false, length: 1 }),
36
+ (0, typeorm_1.Column)({ name: 'is_init', type: 'varchar', nullable: false, length: 1 }),
37
37
  __metadata("design:type", String)
38
38
  ], Node.prototype, "isInit", void 0);
39
39
  __decorate([
40
- typeorm_1.Column({ name: 'status_event', type: 'varchar', length: 50 }),
40
+ (0, typeorm_1.Column)({ name: 'status_event', type: 'varchar', length: 50 }),
41
41
  __metadata("design:type", String)
42
42
  ], Node.prototype, "statusEvent", void 0);
43
43
  __decorate([
44
- typeorm_1.Column({ name: 'is_end', type: 'varchar', nullable: false, length: 1 }),
44
+ (0, typeorm_1.Column)({ name: 'is_end', type: 'varchar', nullable: false, length: 1 }),
45
45
  __metadata("design:type", String)
46
46
  ], Node.prototype, "isEnd", void 0);
47
47
  __decorate([
48
- typeorm_1.Column({ name: 'action_config_json', type: 'text' }),
48
+ (0, typeorm_1.Column)({ name: 'action_config_json', type: 'text' }),
49
49
  __metadata("design:type", String)
50
50
  ], Node.prototype, "actionConfigJson", void 0);
51
51
  __decorate([
52
- typeorm_1.Column({ name: 'approval_config', type: 'text' }),
52
+ (0, typeorm_1.Column)({ name: 'approval_config', type: 'text' }),
53
53
  __metadata("design:type", String)
54
54
  ], Node.prototype, "approvalConfig", void 0);
55
55
  __decorate([
56
- typeorm_1.Column({ name: 'type_delay', type: 'varchar' }),
56
+ (0, typeorm_1.Column)({ name: 'type_delay', type: 'varchar' }),
57
57
  __metadata("design:type", String)
58
58
  ], Node.prototype, "typeDelay", void 0);
59
59
  __decorate([
60
- typeorm_1.Column({ name: 'delay', type: 'numeric' }),
60
+ (0, typeorm_1.Column)({ name: 'delay', type: 'numeric' }),
61
61
  __metadata("design:type", Number)
62
62
  ], Node.prototype, "delay", void 0);
63
63
  __decorate([
64
- typeorm_1.ManyToOne(() => Flow_1.default, flow => flow.nodes),
65
- typeorm_1.JoinColumn({ name: 'flow_id' }),
64
+ (0, typeorm_1.ManyToOne)(() => Flow_1.default, flow => flow.nodes),
65
+ (0, typeorm_1.JoinColumn)({ name: 'flow_id' }),
66
66
  __metadata("design:type", Flow_1.default)
67
67
  ], Node.prototype, "flow", void 0);
68
68
  __decorate([
69
- typeorm_1.ManyToOne(() => Action_1.default, action => action.nodes, { eager: true }),
70
- typeorm_1.JoinColumn({ name: 'action_id' }),
69
+ (0, typeorm_1.ManyToOne)(() => Action_1.default, action => action.nodes, { eager: true }),
70
+ (0, typeorm_1.JoinColumn)({ name: 'action_id' }),
71
71
  __metadata("design:type", Action_1.default)
72
72
  ], Node.prototype, "action", void 0);
73
73
  __decorate([
74
- typeorm_1.ManyToOne(() => Action_1.default, actionEvent => actionEvent.eventNodes),
75
- typeorm_1.JoinColumn({ name: 'action_id_listening_event' }),
74
+ (0, typeorm_1.ManyToOne)(() => Action_1.default, actionEvent => actionEvent.eventNodes),
75
+ (0, typeorm_1.JoinColumn)({ name: 'action_id_listening_event' }),
76
76
  __metadata("design:type", Action_1.default)
77
77
  ], Node.prototype, "actionEvent", void 0);
78
78
  __decorate([
79
- typeorm_1.OneToMany(() => NodeConnection_1.default, nodeConnection => nodeConnection.masterNode),
79
+ (0, typeorm_1.OneToMany)(() => NodeConnection_1.default, nodeConnection => nodeConnection.masterNode),
80
80
  __metadata("design:type", Array)
81
81
  ], Node.prototype, "masterConnections", void 0);
82
82
  __decorate([
83
- typeorm_1.OneToMany(() => NodeConnection_1.default, nodeConnection => nodeConnection.childNode),
83
+ (0, typeorm_1.OneToMany)(() => NodeConnection_1.default, nodeConnection => nodeConnection.childNode),
84
84
  __metadata("design:type", Array)
85
85
  ], Node.prototype, "childConnections", void 0);
86
86
  __decorate([
87
- typeorm_1.OneToMany(() => NodeInstance_1.default, (nodeInstance) => nodeInstance.node),
87
+ (0, typeorm_1.OneToMany)(() => NodeInstance_1.default, (nodeInstance) => nodeInstance.node),
88
88
  __metadata("design:type", Array)
89
89
  ], Node.prototype, "nodeInstances", void 0);
90
90
  Node = __decorate([
91
- typeorm_1.Entity({ name: 'twf_node' })
91
+ (0, typeorm_1.Entity)({ name: 'twf_node' })
92
92
  ], Node);
93
93
  exports.default = Node;
@@ -18,32 +18,32 @@ const common_1 = require("@pxp-nd/common");
18
18
  let NodeConnection = class NodeConnection extends common_1.PxpEntity {
19
19
  };
20
20
  __decorate([
21
- typeorm_1.PrimaryGeneratedColumn({ name: 'node_connection_id' }),
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({ name: 'node_connection_id' }),
22
22
  __metadata("design:type", Number)
23
23
  ], NodeConnection.prototype, "nodeConnectionId", void 0);
24
24
  __decorate([
25
- typeorm_1.Column({ type: 'varchar', nullable: false, length: 200 }),
25
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: false, length: 200 }),
26
26
  __metadata("design:type", String)
27
27
  ], NodeConnection.prototype, "condition", void 0);
28
28
  __decorate([
29
- typeorm_1.Column({ name: 'node_id_master', type: 'int', nullable: false }),
29
+ (0, typeorm_1.Column)({ name: 'node_id_master', type: 'int', nullable: false }),
30
30
  __metadata("design:type", Number)
31
31
  ], NodeConnection.prototype, "nodeIdMaster", void 0);
32
32
  __decorate([
33
- typeorm_1.Column({ name: 'node_id_child', type: 'int', nullable: false }),
33
+ (0, typeorm_1.Column)({ name: 'node_id_child', type: 'int', nullable: false }),
34
34
  __metadata("design:type", Number)
35
35
  ], NodeConnection.prototype, "nodeIdChild", void 0);
36
36
  __decorate([
37
- typeorm_1.ManyToOne(() => Node_1.default, node => node.masterConnections),
38
- typeorm_1.JoinColumn({ name: 'node_id_master' }),
37
+ (0, typeorm_1.ManyToOne)(() => Node_1.default, node => node.masterConnections),
38
+ (0, typeorm_1.JoinColumn)({ name: 'node_id_master' }),
39
39
  __metadata("design:type", Node_1.default)
40
40
  ], NodeConnection.prototype, "masterNode", void 0);
41
41
  __decorate([
42
- typeorm_1.ManyToOne(() => Node_1.default, node => node.childConnections),
43
- typeorm_1.JoinColumn({ name: 'node_id_child' }),
42
+ (0, typeorm_1.ManyToOne)(() => Node_1.default, node => node.childConnections),
43
+ (0, typeorm_1.JoinColumn)({ name: 'node_id_child' }),
44
44
  __metadata("design:type", Node_1.default)
45
45
  ], NodeConnection.prototype, "childNode", void 0);
46
46
  NodeConnection = __decorate([
47
- typeorm_1.Entity({ name: 'twf_node_connection' })
47
+ (0, typeorm_1.Entity)({ name: 'twf_node_connection' })
48
48
  ], NodeConnection);
49
49
  exports.default = NodeConnection;
@@ -19,40 +19,40 @@ const common_1 = require("@pxp-nd/common");
19
19
  let NodeInstance = class NodeInstance extends common_1.PxpEntity {
20
20
  };
21
21
  __decorate([
22
- typeorm_1.PrimaryGeneratedColumn({ name: 'node_instance_id' }),
22
+ (0, typeorm_1.PrimaryGeneratedColumn)({ name: 'node_instance_id' }),
23
23
  __metadata("design:type", Number)
24
24
  ], NodeInstance.prototype, "nodeInstanceId", void 0);
25
25
  __decorate([
26
- typeorm_1.Column({ name: 'node_id', type: 'numeric', nullable: true }),
26
+ (0, typeorm_1.Column)({ name: 'node_id', type: 'numeric', nullable: true }),
27
27
  __metadata("design:type", Number)
28
28
  ], NodeInstance.prototype, "nodeId", void 0);
29
29
  __decorate([
30
- typeorm_1.Column({ name: 'flow_instance_id', type: 'numeric', nullable: true }),
30
+ (0, typeorm_1.Column)({ name: 'flow_instance_id', type: 'numeric', nullable: true }),
31
31
  __metadata("design:type", Number)
32
32
  ], NodeInstance.prototype, "flowInstanceId", void 0);
33
33
  __decorate([
34
- typeorm_1.Column({ name: 'run_time', type: 'timestamp', nullable: false }),
34
+ (0, typeorm_1.Column)({ name: 'run_time', type: 'timestamp', nullable: false }),
35
35
  __metadata("design:type", Date)
36
36
  ], NodeInstance.prototype, "runTime", void 0);
37
37
  __decorate([
38
- typeorm_1.Column({ name: 'schedule', type: 'timestamp', nullable: false }),
38
+ (0, typeorm_1.Column)({ name: 'schedule', type: 'timestamp', nullable: false }),
39
39
  __metadata("design:type", Date)
40
40
  ], NodeInstance.prototype, "schedule", void 0);
41
41
  __decorate([
42
- typeorm_1.Column({ name: 'status', type: 'varchar', nullable: false, length: 50 }),
42
+ (0, typeorm_1.Column)({ name: 'status', type: 'varchar', nullable: false, length: 50 }),
43
43
  __metadata("design:type", String)
44
44
  ], NodeInstance.prototype, "status", void 0);
45
45
  __decorate([
46
- typeorm_1.ManyToOne(() => FlowInstance_1.default, flowInstance => flowInstance.nodeInstances),
47
- typeorm_1.JoinColumn({ name: 'flow_instance_id' }),
46
+ (0, typeorm_1.ManyToOne)(() => FlowInstance_1.default, flowInstance => flowInstance.nodeInstances),
47
+ (0, typeorm_1.JoinColumn)({ name: 'flow_instance_id' }),
48
48
  __metadata("design:type", FlowInstance_1.default)
49
49
  ], NodeInstance.prototype, "flowInstance", void 0);
50
50
  __decorate([
51
- typeorm_1.ManyToOne(() => Node_1.default, node => node.nodeInstances, { eager: true }),
52
- typeorm_1.JoinColumn({ name: 'node_id' }),
51
+ (0, typeorm_1.ManyToOne)(() => Node_1.default, node => node.nodeInstances, { eager: true }),
52
+ (0, typeorm_1.JoinColumn)({ name: 'node_id' }),
53
53
  __metadata("design:type", Node_1.default)
54
54
  ], NodeInstance.prototype, "node", void 0);
55
55
  NodeInstance = __decorate([
56
- typeorm_1.Entity({ name: 'twf_node_instance' })
56
+ (0, typeorm_1.Entity)({ name: 'twf_node_instance' })
57
57
  ], NodeInstance);
58
58
  exports.default = NodeInstance;
@@ -18,26 +18,26 @@ const common_1 = require("@pxp-nd/common");
18
18
  let OriginName = class OriginName extends common_1.PxpEntity {
19
19
  };
20
20
  __decorate([
21
- typeorm_1.PrimaryGeneratedColumn({ name: 'origin_name_id' }),
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({ name: 'origin_name_id' }),
22
22
  __metadata("design:type", Number)
23
23
  ], OriginName.prototype, "originNameId", void 0);
24
24
  __decorate([
25
- typeorm_1.Column({ type: 'varchar', nullable: false, length: 100 }),
25
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: false, length: 100 }),
26
26
  __metadata("design:type", String)
27
27
  ], OriginName.prototype, "name", void 0);
28
28
  __decorate([
29
- typeorm_1.Column({ type: 'text', nullable: false }),
29
+ (0, typeorm_1.Column)({ type: 'text', nullable: false }),
30
30
  __metadata("design:type", String)
31
31
  ], OriginName.prototype, "description", void 0);
32
32
  __decorate([
33
- typeorm_1.Column({ type: 'varchar', nullable: false, length: 150 }),
33
+ (0, typeorm_1.Column)({ type: 'varchar', nullable: false, length: 150 }),
34
34
  __metadata("design:type", String)
35
35
  ], OriginName.prototype, "originKey", void 0);
36
36
  __decorate([
37
- typeorm_1.OneToMany(() => FieldMap_1.default, (fieldMap) => fieldMap.originName),
37
+ (0, typeorm_1.OneToMany)(() => FieldMap_1.default, (fieldMap) => fieldMap.originName),
38
38
  __metadata("design:type", Array)
39
39
  ], OriginName.prototype, "fields", void 0);
40
40
  OriginName = __decorate([
41
- typeorm_1.Entity({ name: 'twf_origin_name' })
41
+ (0, typeorm_1.Entity)({ name: 'twf_origin_name' })
42
42
  ], OriginName);
43
43
  exports.default = OriginName;
package/dist/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -38,13 +38,13 @@ let Event = class Event {
38
38
  async afterInsert(event) {
39
39
  //todo investigate replace variables into condition
40
40
  const newEvent = event.entity;
41
- const node = await core_1.__(Node_1.default.find({ where: { actionId: newEvent.actionId, isActive: 1 } }));
41
+ const node = await (0, core_1.__)(Node_1.default.find({ where: { actionId: newEvent.actionId, isActive: 1 } }));
42
42
  for (const n of node) {
43
43
  //get data of view
44
44
  const { action: { originName, originKey }, } = n;
45
45
  const executeView = `select * from ${originName} where ${originKey} = ${newEvent.dataId}`;
46
- const resExecuteView = await typeorm_1.getManager().query(executeView);
47
- const flow = await core_1.__(Flow_1.default.findOne({ where: { flowId: n.flowId, isActive: 1 } }));
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
48
  if (flow && flow.vendorId == resExecuteView[0].vendor_id &&
49
49
  (await this.checkConditions(resExecuteView[0], n.flowId, newEvent.actionId))) {
50
50
  //now check all conditions
@@ -79,6 +79,6 @@ let Event = class Event {
79
79
  }
80
80
  };
81
81
  Event = __decorate([
82
- typeorm_1.EventSubscriber()
82
+ (0, typeorm_1.EventSubscriber)()
83
83
  ], Event);
84
84
  exports.Event = Event;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pxp-nd/flow",
3
- "version": "1.0.42",
3
+ "version": "1.0.45",
4
4
  "description": "Workflow module for pxp-nd framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",