@pxp-nd/flow 1.1.15 → 1.1.16
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.
|
@@ -18,5 +18,6 @@ declare class FlowInstance extends Controller {
|
|
|
18
18
|
processPending(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
19
19
|
eventProcesss(manager: EntityManager): Promise<void>;
|
|
20
20
|
checkConditions(viewData: Record<string, any>, flowId: number, actionId: number): Promise<boolean>;
|
|
21
|
+
insert(params: Record<string, any>, manager: EntityManager): Promise<unknown>;
|
|
21
22
|
}
|
|
22
23
|
export default FlowInstance;
|
|
@@ -135,6 +135,18 @@ class FlowInstance extends core_1.Controller {
|
|
|
135
135
|
}
|
|
136
136
|
return res;
|
|
137
137
|
}
|
|
138
|
+
async insert(params, manager) {
|
|
139
|
+
const { flowId, dataId, status, actionId, originName = '', originKey = '' } = params;
|
|
140
|
+
let flowInstance = new FlowInstance_1.default();
|
|
141
|
+
flowInstance.flowId = flowId;
|
|
142
|
+
flowInstance.dataId = dataId;
|
|
143
|
+
flowInstance.originName = originName;
|
|
144
|
+
flowInstance.originKey = originKey;
|
|
145
|
+
flowInstance.actionId = actionId;
|
|
146
|
+
flowInstance.status = status;
|
|
147
|
+
flowInstance = await manager.save(FlowInstance_1.default, flowInstance);
|
|
148
|
+
return flowInstance;
|
|
149
|
+
}
|
|
138
150
|
}
|
|
139
151
|
__decorate([
|
|
140
152
|
(0, core_1.Post)(),
|
|
@@ -145,4 +157,13 @@ __decorate([
|
|
|
145
157
|
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
146
158
|
__metadata("design:returntype", Promise)
|
|
147
159
|
], FlowInstance.prototype, "processPending", null);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, core_1.Post)(),
|
|
162
|
+
(0, core_1.DbSettings)('Orm'),
|
|
163
|
+
(0, core_1.ReadOnly)(false),
|
|
164
|
+
(0, core_1.Log)(true),
|
|
165
|
+
__metadata("design:type", Function),
|
|
166
|
+
__metadata("design:paramtypes", [Object, typeorm_1.EntityManager]),
|
|
167
|
+
__metadata("design:returntype", Promise)
|
|
168
|
+
], FlowInstance.prototype, "insert", null);
|
|
148
169
|
exports.default = FlowInstance;
|