@pxp-nd/flow 1.0.30 → 1.0.32
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/README.md +1 -1
- package/dist/controllers/Action.d.ts +20 -20
- package/dist/controllers/Action.js +82 -82
- package/dist/controllers/ActionType.d.ts +17 -17
- package/dist/controllers/ActionType.js +28 -28
- package/dist/controllers/Event.d.ts +17 -17
- package/dist/controllers/Event.js +28 -28
- package/dist/controllers/FieldMap.d.ts +17 -17
- package/dist/controllers/FieldMap.js +28 -28
- package/dist/controllers/Flow.d.ts +30 -24
- package/dist/controllers/Flow.js +331 -116
- package/dist/controllers/FlowInstance.d.ts +20 -20
- package/dist/controllers/FlowInstance.js +84 -84
- package/dist/controllers/Node.d.ts +23 -23
- package/dist/controllers/Node.js +273 -273
- package/dist/controllers/NodeInstance.d.ts +21 -21
- package/dist/controllers/NodeInstance.js +191 -191
- package/dist/controllers/OriginName.d.ts +17 -17
- package/dist/controllers/OriginName.js +28 -28
- package/dist/controllers/index.d.ts +11 -11
- package/dist/controllers/index.js +25 -25
- package/dist/entity/Action.d.ts +20 -20
- package/dist/entity/Action.js +85 -85
- package/dist/entity/ActionType.d.ts +16 -16
- package/dist/entity/ActionType.js +71 -71
- package/dist/entity/Event.d.ts +9 -9
- package/dist/entity/Event.js +44 -44
- package/dist/entity/FieldMap.d.ts +11 -11
- package/dist/entity/FieldMap.js +52 -52
- package/dist/entity/Flow.d.ts +14 -14
- package/dist/entity/Flow.js +60 -60
- package/dist/entity/FlowInstance.d.ts +16 -16
- package/dist/entity/FlowInstance.js +69 -69
- package/dist/entity/Node.d.ts +23 -23
- package/dist/entity/Node.js +93 -93
- package/dist/entity/NodeConnection.d.ts +10 -10
- package/dist/entity/NodeConnection.js +49 -49
- package/dist/entity/NodeInstance.d.ts +13 -13
- package/dist/entity/NodeInstance.js +58 -58
- package/dist/entity/OriginName.d.ts +9 -9
- package/dist/entity/OriginName.js +43 -43
- package/dist/entity/index.d.ts +23 -23
- package/dist/entity/index.js +27 -27
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -15
- package/dist/subscribers/Event.d.ts +21 -21
- package/dist/subscribers/Event.js +85 -83
- package/dist/subscribers/index.d.ts +3 -3
- package/dist/subscribers/index.js +6 -6
- package/package.json +45 -45
- package/tsconfig.json +29 -29
package/dist/controllers/Flow.js
CHANGED
|
@@ -1,116 +1,331 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
await
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
newFlow
|
|
86
|
-
newFlow
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright(c) 2021 Qorus Inc
|
|
4
|
+
* * All rights reserved
|
|
5
|
+
* * ******************************************************************************
|
|
6
|
+
* * NAME: Flow.ts
|
|
7
|
+
* * DEVELOPER: Jaime Figueroa
|
|
8
|
+
* * DESCRIPTION: Flow Controller
|
|
9
|
+
* * REVISIONS:
|
|
10
|
+
* * Date Change ID Author Description
|
|
11
|
+
* * -------------- ----------- -------------- ------------------------------------
|
|
12
|
+
* 08-Jul-2021 Jaime Rivera Created
|
|
13
|
+
* 18-Jul-2023 SP28JUL23 Mercedes Zambrana Add deleteFlow, saveFlowName, duplicateFlow
|
|
14
|
+
* ******************************************************************************
|
|
15
|
+
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
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;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
22
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
23
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const typeorm_1 = require("typeorm");
|
|
30
|
+
const core_1 = require("@pxp-nd/core");
|
|
31
|
+
const Node_1 = __importDefault(require("../entity/Node"));
|
|
32
|
+
const Action_1 = __importDefault(require("../entity/Action"));
|
|
33
|
+
const NodeConnection_1 = __importDefault(require("../entity/NodeConnection"));
|
|
34
|
+
const Flow_1 = __importDefault(require("../entity/Flow"));
|
|
35
|
+
let Flow = class Flow extends core_1.Controller {
|
|
36
|
+
async get(params) {
|
|
37
|
+
const nodes = await Node_1.default.find({ flowId: params.flowId });
|
|
38
|
+
const restNodes = [];
|
|
39
|
+
for (let node of nodes) {
|
|
40
|
+
const { actionConfigJson, action: { actionType: { schemaJson } } } = node;
|
|
41
|
+
const actionConfigJsonObject = actionConfigJson ? JSON.parse(actionConfigJson) : {};
|
|
42
|
+
const schemaJsonObject = schemaJson ? JSON.parse(schemaJson) : {};
|
|
43
|
+
const valuesForShowingInNode = {};
|
|
44
|
+
Object.entries(schemaJsonObject).filter(([n, sjo]) => sjo.showInNode === true).forEach(([nameKey, json]) => {
|
|
45
|
+
valuesForShowingInNode[nameKey] = {
|
|
46
|
+
label: json.label,
|
|
47
|
+
value: actionConfigJsonObject[nameKey] || null
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
const nodeRow = {
|
|
51
|
+
...node,
|
|
52
|
+
valuesForShowingInNode
|
|
53
|
+
};
|
|
54
|
+
const connections = await NodeConnection_1.default.find({ nodeIdMaster: node.nodeId });
|
|
55
|
+
restNodes.push({ node: nodeRow, connections: connections.map(c => c.nodeIdChild) });
|
|
56
|
+
}
|
|
57
|
+
return restNodes;
|
|
58
|
+
}
|
|
59
|
+
async copyNodeConnections(nodeId, newNodeId, newFlowId, manager) {
|
|
60
|
+
const connections = await core_1.__(NodeConnection_1.default.find({ nodeIdMaster: nodeId }));
|
|
61
|
+
for (let connection of connections) {
|
|
62
|
+
const newNodeConnection = new NodeConnection_1.default();
|
|
63
|
+
const { nodeConnectionId, nodeIdMaster, nodeIdChild, createdAt, modifiedAt, ...nodeConnectionToCopy } = connection;
|
|
64
|
+
// get node from nodeIdChild
|
|
65
|
+
const dataNodeChild = await Node_1.default.findOne({ nodeId: connection.nodeIdChild });
|
|
66
|
+
const { nodeId: newNodeIdChild } = await this.copyNode(dataNodeChild, newFlowId, manager);
|
|
67
|
+
Object.assign(newNodeConnection, { ...nodeConnectionToCopy, nodeIdMaster: newNodeId, nodeIdChild: newNodeIdChild });
|
|
68
|
+
const insertNewNodeConnection = await core_1.__(manager.save(NodeConnection_1.default, newNodeConnection));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async copyNode(node, newFlowId, manager) {
|
|
72
|
+
// insert new node
|
|
73
|
+
const newNode = new Node_1.default();
|
|
74
|
+
const { nodeId, flowId, createdAt, modifiedAt, actionConfigJson, ...nodeToCopy } = node;
|
|
75
|
+
Object.assign(newNode, { ...nodeToCopy, flowId: newFlowId });
|
|
76
|
+
const insertNewNode = await core_1.__(manager.save(Node_1.default, newNode));
|
|
77
|
+
// insert connection
|
|
78
|
+
await this.copyNodeConnections(node.nodeId, insertNewNode.nodeId, newFlowId, manager);
|
|
79
|
+
return { nodeId: insertNewNode.nodeId };
|
|
80
|
+
}
|
|
81
|
+
async createFlowFromFlow(params, manager) {
|
|
82
|
+
// we need clone the flow selected
|
|
83
|
+
const dataFlow = await core_1.__(Flow_1.default.findOne(params.flowId));
|
|
84
|
+
const { flowId, createdAt, modifiedAt, nodes, ...flowToCopy } = dataFlow;
|
|
85
|
+
const newFlow = new Flow_1.default();
|
|
86
|
+
Object.assign(newFlow, flowToCopy);
|
|
87
|
+
newFlow.name = params.name;
|
|
88
|
+
newFlow.description = params.description;
|
|
89
|
+
const insertNewFlow = await core_1.__(manager.save(Flow_1.default, newFlow));
|
|
90
|
+
// create the nodes
|
|
91
|
+
// get the first node "the trigger node"
|
|
92
|
+
const dataNode = await Node_1.default.findOne({ where: { flowId: params.flowId }, order: { nodeId: "ASC" } });
|
|
93
|
+
dataNode && await this.copyNode(dataNode, insertNewFlow.flowId, manager);
|
|
94
|
+
return { flowId: insertNewFlow.flowId };
|
|
95
|
+
}
|
|
96
|
+
async deleteFlow(params, manager) {
|
|
97
|
+
let dataFlow = await core_1.__(Flow_1.default.findOne(params.flowId));
|
|
98
|
+
if (dataFlow) {
|
|
99
|
+
dataFlow.isActive = 0;
|
|
100
|
+
dataFlow.enabled = 'N';
|
|
101
|
+
const updFlow = await core_1.__(manager.save(dataFlow));
|
|
102
|
+
if (updFlow) {
|
|
103
|
+
let flowInstance = `UPDATE twf_flow_instance SET
|
|
104
|
+
is_active = 'N' WHERE flow_id = ${updFlow.flowId}`;
|
|
105
|
+
await manager.query(flowInstance);
|
|
106
|
+
let flowNode = `UPDATE twf_node SET
|
|
107
|
+
is_active = 'N' WHERE flow_id = ${updFlow.flowId}`;
|
|
108
|
+
await manager.query(flowNode);
|
|
109
|
+
const nodesToInact = await manager.find(Node_1.default, { flowId: updFlow.flowId });
|
|
110
|
+
const originalNodeIds = nodesToInact.map((node) => node.nodeId);
|
|
111
|
+
const connectionsToInact = await manager.find(NodeConnection_1.default, {
|
|
112
|
+
where: { nodeIdChild: typeorm_1.In(originalNodeIds) } // Suponiendo que originalNodeIds contiene los IDs de los nodos originales que deseas duplicar
|
|
113
|
+
});
|
|
114
|
+
const originalNodeCIds = connectionsToInact.map((node) => node.nodeConnectionId);
|
|
115
|
+
let flowNodeC = `UPDATE twf_node_connection SET
|
|
116
|
+
is_active = 'N' WHERE node_connection_id in ( ${originalNodeCIds})`;
|
|
117
|
+
await manager.query(flowNodeC);
|
|
118
|
+
return { success: true };
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
return { success: false };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
return { success: false };
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async saveFlowName(params, manager) {
|
|
129
|
+
let dataFlow = await core_1.__(Flow_1.default.findOne(params.flowId));
|
|
130
|
+
if (dataFlow) {
|
|
131
|
+
dataFlow.name = params.name;
|
|
132
|
+
const updFlow = await core_1.__(manager.save(dataFlow));
|
|
133
|
+
return { success: true };
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
return { success: false };
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async duplicateFlow(params, manager) {
|
|
140
|
+
const flowData = await manager.findOne(Flow_1.default, params.flowId);
|
|
141
|
+
const flowToClone = {
|
|
142
|
+
...flowData,
|
|
143
|
+
flowId: undefined,
|
|
144
|
+
nodes: [],
|
|
145
|
+
createdAt: undefined
|
|
146
|
+
};
|
|
147
|
+
const flowDataClone = await manager.save(Flow_1.default, { ...flowToClone, name: `${flowData.name} Copy` });
|
|
148
|
+
const nodesToDuplicate = await manager.find(Node_1.default, { flowId: flowData === null || flowData === void 0 ? void 0 : flowData.flowId });
|
|
149
|
+
const originalNodeIds = nodesToDuplicate.map((node) => node.nodeId);
|
|
150
|
+
const duplicatedNodes = nodesToDuplicate.map((node) => {
|
|
151
|
+
const duplicatedNode = manager.create(Node_1.default, { ...node, nodeId: undefined });
|
|
152
|
+
duplicatedNode.flowId = flowDataClone.flowId;
|
|
153
|
+
return duplicatedNode;
|
|
154
|
+
});
|
|
155
|
+
const savedNodes = await manager.save(duplicatedNodes);
|
|
156
|
+
const newNodeIds = savedNodes.map((node) => node.nodeId);
|
|
157
|
+
const connectionsToDuplicate = await manager.find(NodeConnection_1.default, {
|
|
158
|
+
where: { nodeIdChild: typeorm_1.In(originalNodeIds) }
|
|
159
|
+
});
|
|
160
|
+
const duplicatedConnections = newNodeIds.map((nodeId, index) => {
|
|
161
|
+
const duplicatedConnection = manager.create(NodeConnection_1.default, {
|
|
162
|
+
nodeConnectionId: undefined,
|
|
163
|
+
nodeIdMaster: index === 0 ? null : newNodeIds[index - 1],
|
|
164
|
+
nodeIdChild: nodeId,
|
|
165
|
+
});
|
|
166
|
+
return duplicatedConnection;
|
|
167
|
+
});
|
|
168
|
+
await manager.save(duplicatedConnections);
|
|
169
|
+
return { success: true };
|
|
170
|
+
}
|
|
171
|
+
async getFlowRender(params) {
|
|
172
|
+
let actions = await typeorm_1.getManager()
|
|
173
|
+
.createQueryBuilder(Action_1.default, "a")
|
|
174
|
+
.select([
|
|
175
|
+
"a.actionId",
|
|
176
|
+
"a.code",
|
|
177
|
+
"a.name",
|
|
178
|
+
"a.description",
|
|
179
|
+
"at.name"
|
|
180
|
+
])
|
|
181
|
+
.innerJoin("a.actionType", "at")
|
|
182
|
+
.where(`a.isActive = 1 and a.hidden = 'N'`)
|
|
183
|
+
.getMany();
|
|
184
|
+
const connections = await typeorm_1.getManager()
|
|
185
|
+
.createQueryBuilder(NodeConnection_1.default, "nc")
|
|
186
|
+
.select([
|
|
187
|
+
"nc.nodeIdMaster",
|
|
188
|
+
"nc.nodeIdChild",
|
|
189
|
+
])
|
|
190
|
+
.innerJoin("nc.childNode", "cn")
|
|
191
|
+
.where(`cn.flowId = :flowId`, { flowId: params.flowId })
|
|
192
|
+
.getMany();
|
|
193
|
+
const nodes = await typeorm_1.getManager()
|
|
194
|
+
.createQueryBuilder(Node_1.default, "n")
|
|
195
|
+
.select([
|
|
196
|
+
"n.nodeId",
|
|
197
|
+
"n.flowId",
|
|
198
|
+
"a.code",
|
|
199
|
+
"a.name",
|
|
200
|
+
"a.description",
|
|
201
|
+
])
|
|
202
|
+
.innerJoin("n.action", "a")
|
|
203
|
+
.where(`n.flowId = :flowId`, { flowId: params.flowId })
|
|
204
|
+
.getMany();
|
|
205
|
+
let sortedNodes = this.sortNodesByConnections(nodes, connections);
|
|
206
|
+
actions.forEach((item) => {
|
|
207
|
+
item.actionId = `action-${item.actionId}`;
|
|
208
|
+
});
|
|
209
|
+
sortedNodes.forEach((item) => {
|
|
210
|
+
item.nodeId = `node-${item.nodeId}`;
|
|
211
|
+
});
|
|
212
|
+
const actionIds = actions.map((item) => item.actionId);
|
|
213
|
+
const nodeIds = sortedNodes.map((item) => item.nodeId);
|
|
214
|
+
sortedNodes = sortedNodes.map(({ nodeId, ...rest }) => {
|
|
215
|
+
return { id: nodeId, ...rest };
|
|
216
|
+
});
|
|
217
|
+
const modActions = actions.map(({ actionId, ...rest }) => {
|
|
218
|
+
return { id: actionId, type: 'template', ...rest };
|
|
219
|
+
});
|
|
220
|
+
const tasks = [...modActions, ...sortedNodes];
|
|
221
|
+
const tasksObject = tasks.reduce((acc, obj) => {
|
|
222
|
+
acc[obj.id] = obj;
|
|
223
|
+
return acc;
|
|
224
|
+
}, {});
|
|
225
|
+
let response = {
|
|
226
|
+
board: {
|
|
227
|
+
columns: {
|
|
228
|
+
"1-column-config-nodes": {
|
|
229
|
+
id: "1-column-config-nodes",
|
|
230
|
+
name: "Add Nodes",
|
|
231
|
+
taskIds: actionIds,
|
|
232
|
+
},
|
|
233
|
+
"2-column-nodes-configured": {
|
|
234
|
+
id: "2-column-nodes-configured",
|
|
235
|
+
name: "Test Flow",
|
|
236
|
+
taskIds: nodeIds,
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
tasks: tasksObject,
|
|
240
|
+
ordered: [
|
|
241
|
+
"1-column-config-nodes",
|
|
242
|
+
"2-column-nodes-configured"
|
|
243
|
+
],
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
return response;
|
|
247
|
+
}
|
|
248
|
+
sortNodesByConnections(nodes, connections) {
|
|
249
|
+
const nodeMap = new Map();
|
|
250
|
+
nodes.forEach((node) => nodeMap.set(node.nodeId, node));
|
|
251
|
+
const sortedNodes = [];
|
|
252
|
+
const visitedNodes = new Set();
|
|
253
|
+
function dfs(nodeId) {
|
|
254
|
+
visitedNodes.add(nodeId);
|
|
255
|
+
const node = nodeMap.get(nodeId);
|
|
256
|
+
if (node) {
|
|
257
|
+
sortedNodes.push(node);
|
|
258
|
+
}
|
|
259
|
+
const connectedNodes = connections.filter((connection) => connection.nodeIdMaster === nodeId);
|
|
260
|
+
connectedNodes.forEach((connection) => {
|
|
261
|
+
if (!visitedNodes.has(connection.nodeIdChild)) {
|
|
262
|
+
dfs(connection.nodeIdChild);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
connections.forEach((connection) => {
|
|
267
|
+
if (connection.nodeIdMaster === null && !visitedNodes.has(connection.nodeIdChild)) {
|
|
268
|
+
dfs(connection.nodeIdChild);
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
return sortedNodes;
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
__decorate([
|
|
275
|
+
core_1.Get(),
|
|
276
|
+
core_1.DbSettings('Orm'),
|
|
277
|
+
core_1.ReadOnly(true),
|
|
278
|
+
core_1.Log(true),
|
|
279
|
+
__metadata("design:type", Function),
|
|
280
|
+
__metadata("design:paramtypes", [Object]),
|
|
281
|
+
__metadata("design:returntype", Promise)
|
|
282
|
+
], Flow.prototype, "get", null);
|
|
283
|
+
__decorate([
|
|
284
|
+
core_1.Post(),
|
|
285
|
+
core_1.DbSettings('Orm'),
|
|
286
|
+
core_1.ReadOnly(false),
|
|
287
|
+
core_1.Log(true),
|
|
288
|
+
__metadata("design:type", Function),
|
|
289
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
290
|
+
__metadata("design:returntype", Promise)
|
|
291
|
+
], Flow.prototype, "createFlowFromFlow", null);
|
|
292
|
+
__decorate([
|
|
293
|
+
core_1.Post(),
|
|
294
|
+
core_1.DbSettings('Orm'),
|
|
295
|
+
core_1.ReadOnly(false),
|
|
296
|
+
core_1.Log(true),
|
|
297
|
+
__metadata("design:type", Function),
|
|
298
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
299
|
+
__metadata("design:returntype", Promise)
|
|
300
|
+
], Flow.prototype, "deleteFlow", null);
|
|
301
|
+
__decorate([
|
|
302
|
+
core_1.Post(),
|
|
303
|
+
core_1.DbSettings('Orm'),
|
|
304
|
+
core_1.ReadOnly(false),
|
|
305
|
+
core_1.Log(true),
|
|
306
|
+
__metadata("design:type", Function),
|
|
307
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
308
|
+
__metadata("design:returntype", Promise)
|
|
309
|
+
], Flow.prototype, "saveFlowName", null);
|
|
310
|
+
__decorate([
|
|
311
|
+
core_1.Post(),
|
|
312
|
+
core_1.DbSettings('Orm'),
|
|
313
|
+
core_1.ReadOnly(false),
|
|
314
|
+
core_1.Log(true),
|
|
315
|
+
__metadata("design:type", Function),
|
|
316
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
317
|
+
__metadata("design:returntype", Promise)
|
|
318
|
+
], Flow.prototype, "duplicateFlow", null);
|
|
319
|
+
__decorate([
|
|
320
|
+
core_1.Get(),
|
|
321
|
+
core_1.DbSettings('Orm'),
|
|
322
|
+
core_1.ReadOnly(true),
|
|
323
|
+
core_1.Log(true),
|
|
324
|
+
__metadata("design:type", Function),
|
|
325
|
+
__metadata("design:paramtypes", [Object]),
|
|
326
|
+
__metadata("design:returntype", Promise)
|
|
327
|
+
], Flow.prototype, "getFlowRender", null);
|
|
328
|
+
Flow = __decorate([
|
|
329
|
+
core_1.Model('flow-nd/Flow')
|
|
330
|
+
], Flow);
|
|
331
|
+
exports.default = Flow;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kplian 2021
|
|
3
|
-
*
|
|
4
|
-
* MIT
|
|
5
|
-
*
|
|
6
|
-
* NodeInstance Controller
|
|
7
|
-
*
|
|
8
|
-
* @summary Member Controller
|
|
9
|
-
* @author Favio Figueroa
|
|
10
|
-
* Jaime Rivera
|
|
11
|
-
*
|
|
12
|
-
* Created at : 2021-07-08 12:55:38
|
|
13
|
-
* Last modified :
|
|
14
|
-
*/
|
|
15
|
-
import { EntityManager } from 'typeorm';
|
|
16
|
-
import { Controller } from '@pxp-nd/core';
|
|
17
|
-
declare class FlowInstance extends Controller {
|
|
18
|
-
processPending(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
-
}
|
|
20
|
-
export default FlowInstance;
|
|
1
|
+
/**
|
|
2
|
+
* Kplian 2021
|
|
3
|
+
*
|
|
4
|
+
* MIT
|
|
5
|
+
*
|
|
6
|
+
* NodeInstance Controller
|
|
7
|
+
*
|
|
8
|
+
* @summary Member Controller
|
|
9
|
+
* @author Favio Figueroa
|
|
10
|
+
* Jaime Rivera
|
|
11
|
+
*
|
|
12
|
+
* Created at : 2021-07-08 12:55:38
|
|
13
|
+
* Last modified :
|
|
14
|
+
*/
|
|
15
|
+
import { EntityManager } from 'typeorm';
|
|
16
|
+
import { Controller } from '@pxp-nd/core';
|
|
17
|
+
declare class FlowInstance extends Controller {
|
|
18
|
+
processPending(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
|
+
}
|
|
20
|
+
export default FlowInstance;
|