@nocobase/plugin-workflow 0.13.0-alpha.4 → 0.13.0-alpha.6
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/client/index.js +132 -9332
- package/dist/index.js +37 -16
- package/dist/locale/en-US.js +22 -4
- package/dist/locale/es-ES.js +22 -4
- package/dist/locale/fr-FR.js +22 -4
- package/dist/locale/ja-JP.js +22 -4
- package/dist/locale/pt-BR.js +22 -4
- package/dist/locale/ru-RU.js +22 -4
- package/dist/locale/tr-TR.js +22 -4
- package/dist/locale/zh-CN.js +22 -4
- package/dist/node_modules/cron-parser/lib/parser.js +1 -1
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/lru-cache/index-cjs.js +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/server/Plugin.js +70 -55
- package/dist/server/Processor.js +42 -25
- package/dist/server/actions/executions.js +41 -14
- package/dist/server/actions/index.js +39 -34
- package/dist/server/actions/nodes.js +48 -28
- package/dist/server/actions/workflows.js +50 -20
- package/dist/server/collections/executions.js +22 -4
- package/dist/server/collections/flow_nodes.js +22 -4
- package/dist/server/collections/jobs.js +22 -4
- package/dist/server/collections/workflows.js +22 -4
- package/dist/server/constants.js +30 -6
- package/dist/server/fields/expression-field.js +29 -8
- package/dist/server/fields/index.js +24 -7
- package/dist/server/functions/index.js +22 -4
- package/dist/server/index.js +45 -39
- package/dist/server/instructions/aggregate.js +30 -13
- package/dist/server/instructions/calculation.js +30 -13
- package/dist/server/instructions/condition.js +36 -17
- package/dist/server/instructions/create.js +26 -9
- package/dist/server/instructions/delay.js +27 -10
- package/dist/server/instructions/destroy.js +24 -7
- package/dist/server/instructions/index.js +35 -12
- package/dist/server/instructions/loop.js +27 -10
- package/dist/server/instructions/manual/actions.js +31 -10
- package/dist/server/instructions/manual/collecions/jobs.js +22 -4
- package/dist/server/instructions/manual/collecions/users.js +22 -4
- package/dist/server/instructions/manual/collecions/users_jobs.js +22 -4
- package/dist/server/instructions/manual/forms/create.js +22 -4
- package/dist/server/instructions/manual/forms/index.js +36 -14
- package/dist/server/instructions/manual/forms/update.js +22 -4
- package/dist/server/instructions/manual/index.js +60 -41
- package/dist/server/instructions/parallel.js +47 -28
- package/dist/server/instructions/query.js +31 -14
- package/dist/server/instructions/request.js +39 -16
- package/dist/server/instructions/sql.js +25 -8
- package/dist/server/instructions/update.js +24 -7
- package/dist/server/migrations/20221129153547-calculation-variables.js +24 -7
- package/dist/server/migrations/20230221032941-change-request-body-type.js +28 -7
- package/dist/server/migrations/20230221071831-calculation-expression.js +24 -7
- package/dist/server/migrations/20230221121203-condition-calculation.js +62 -7
- package/dist/server/migrations/20230221162902-jsonb-to-json.js +29 -12
- package/dist/server/migrations/20230411034722-manual-multi-form.js +38 -15
- package/dist/server/migrations/20230612021134-manual-collection-block.js +26 -9
- package/dist/server/migrations/20230710115902-manual-action-values.js +24 -7
- package/dist/server/migrations/20230809113132-workflow-options.js +24 -7
- package/dist/server/triggers/collection.js +26 -9
- package/dist/server/triggers/form.js +28 -11
- package/dist/server/triggers/index.js +42 -17
- package/dist/server/triggers/schedule.js +56 -31
- package/dist/server/types/Execution.js +24 -7
- package/dist/server/types/FlowNode.js +24 -7
- package/dist/server/types/Job.js +24 -7
- package/dist/server/types/Workflow.js +24 -7
- package/dist/server/types/index.js +15 -2
- package/dist/server/utils.js +26 -4
- package/dist/swagger/index.d.ts +103 -53
- package/dist/swagger/index.js +144 -71
- package/package.json +2 -2
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var condition_exports = {};
|
|
19
|
+
__export(condition_exports, {
|
|
20
|
+
calculators: () => calculators,
|
|
21
|
+
default: () => condition_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(condition_exports);
|
|
24
|
+
var import_evaluators = require("@nocobase/evaluators");
|
|
25
|
+
var import_utils = require("@nocobase/utils");
|
|
26
|
+
var import_constants = require("../constants");
|
|
27
|
+
const calculators = new import_utils.Registry();
|
|
10
28
|
function equal(a, b) {
|
|
11
29
|
return a == b;
|
|
12
30
|
}
|
|
@@ -81,24 +99,24 @@ function logicCalculate(calculation) {
|
|
|
81
99
|
var condition_default = {
|
|
82
100
|
async run(node, prevJob, processor) {
|
|
83
101
|
const { engine, calculation, expression, rejectOnFalse } = node.config || {};
|
|
84
|
-
const evaluator =
|
|
102
|
+
const evaluator = import_evaluators.evaluators.get(engine);
|
|
85
103
|
let result = true;
|
|
86
104
|
try {
|
|
87
105
|
result = evaluator ? evaluator(expression, processor.getScope(node.id)) : logicCalculate(processor.getParsedValue(calculation, node.id));
|
|
88
106
|
} catch (e) {
|
|
89
107
|
return {
|
|
90
108
|
result: e.toString(),
|
|
91
|
-
status:
|
|
109
|
+
status: import_constants.JOB_STATUS.ERROR
|
|
92
110
|
};
|
|
93
111
|
}
|
|
94
112
|
if (!result && rejectOnFalse) {
|
|
95
113
|
return {
|
|
96
|
-
status:
|
|
114
|
+
status: import_constants.JOB_STATUS.FAILED,
|
|
97
115
|
result
|
|
98
116
|
};
|
|
99
117
|
}
|
|
100
118
|
const job = {
|
|
101
|
-
status:
|
|
119
|
+
status: import_constants.JOB_STATUS.RESOLVED,
|
|
102
120
|
result,
|
|
103
121
|
// TODO(optimize): try unify the building of job
|
|
104
122
|
nodeId: node.id,
|
|
@@ -114,12 +132,13 @@ var condition_default = {
|
|
|
114
132
|
},
|
|
115
133
|
async resume(node, branchJob, processor) {
|
|
116
134
|
const job = processor.findBranchParentJob(branchJob, node);
|
|
117
|
-
if (branchJob.status ===
|
|
135
|
+
if (branchJob.status === import_constants.JOB_STATUS.RESOLVED) {
|
|
118
136
|
return job;
|
|
119
137
|
}
|
|
120
138
|
return processor.exit(branchJob.status);
|
|
121
139
|
}
|
|
122
140
|
};
|
|
123
|
-
|
|
124
|
-
exports
|
|
125
|
-
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
calculators
|
|
144
|
+
});
|
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var create_exports = {};
|
|
19
|
+
__export(create_exports, {
|
|
20
|
+
default: () => create_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(create_exports);
|
|
23
|
+
var import_constants = require("../constants");
|
|
24
|
+
var import_utils = require("../utils");
|
|
6
25
|
var create_default = {
|
|
7
26
|
async run(node, input, processor) {
|
|
8
27
|
const { collection, params: { appends = [], ...params } = {} } = node.config;
|
|
@@ -30,10 +49,8 @@ var create_default = {
|
|
|
30
49
|
}
|
|
31
50
|
return {
|
|
32
51
|
// NOTE: get() for non-proxied instance (#380)
|
|
33
|
-
result:
|
|
34
|
-
status:
|
|
52
|
+
result: (0, import_utils.toJSON)(result),
|
|
53
|
+
status: import_constants.JOB_STATUS.RESOLVED
|
|
35
54
|
};
|
|
36
55
|
}
|
|
37
56
|
};
|
|
38
|
-
|
|
39
|
-
module.exports = create_default;
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var delay_exports = {};
|
|
19
|
+
__export(delay_exports, {
|
|
20
|
+
default: () => delay_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(delay_exports);
|
|
23
|
+
var import_constants = require("../constants");
|
|
5
24
|
class delay_default {
|
|
6
25
|
constructor(plugin) {
|
|
7
26
|
this.plugin = plugin;
|
|
@@ -13,14 +32,14 @@ class delay_default {
|
|
|
13
32
|
const { model } = this.plugin.db.getCollection("jobs");
|
|
14
33
|
const jobs = await model.findAll({
|
|
15
34
|
where: {
|
|
16
|
-
status:
|
|
35
|
+
status: import_constants.JOB_STATUS.PENDING
|
|
17
36
|
},
|
|
18
37
|
include: [
|
|
19
38
|
{
|
|
20
39
|
association: "execution",
|
|
21
40
|
attributes: [],
|
|
22
41
|
where: {
|
|
23
|
-
status:
|
|
42
|
+
status: import_constants.EXECUTION_STATUS.STARTED
|
|
24
43
|
},
|
|
25
44
|
required: true
|
|
26
45
|
},
|
|
@@ -59,7 +78,7 @@ class delay_default {
|
|
|
59
78
|
if (!job.execution) {
|
|
60
79
|
job.execution = await job.getExecution();
|
|
61
80
|
}
|
|
62
|
-
if (job.execution.status ===
|
|
81
|
+
if (job.execution.status === import_constants.EXECUTION_STATUS.STARTED) {
|
|
63
82
|
this.plugin.resume(job);
|
|
64
83
|
}
|
|
65
84
|
if (this.timers.get(job.id)) {
|
|
@@ -68,7 +87,7 @@ class delay_default {
|
|
|
68
87
|
}
|
|
69
88
|
run = async (node, prevJob, processor) => {
|
|
70
89
|
const job = await processor.saveJob({
|
|
71
|
-
status:
|
|
90
|
+
status: import_constants.JOB_STATUS.PENDING,
|
|
72
91
|
result: null,
|
|
73
92
|
nodeId: node.id,
|
|
74
93
|
upstreamId: (prevJob == null ? void 0 : prevJob.id) ?? null
|
|
@@ -83,5 +102,3 @@ class delay_default {
|
|
|
83
102
|
return prevJob;
|
|
84
103
|
};
|
|
85
104
|
}
|
|
86
|
-
|
|
87
|
-
module.exports = delay_default;
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var destroy_exports = {};
|
|
19
|
+
__export(destroy_exports, {
|
|
20
|
+
default: () => destroy_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(destroy_exports);
|
|
23
|
+
var import_constants = require("../constants");
|
|
5
24
|
var destroy_default = {
|
|
6
25
|
async run(node, input, processor) {
|
|
7
26
|
const { collection, params = {} } = node.config;
|
|
@@ -16,9 +35,7 @@ var destroy_default = {
|
|
|
16
35
|
});
|
|
17
36
|
return {
|
|
18
37
|
result,
|
|
19
|
-
status:
|
|
38
|
+
status: import_constants.JOB_STATUS.RESOLVED
|
|
20
39
|
};
|
|
21
40
|
}
|
|
22
41
|
};
|
|
23
|
-
|
|
24
|
-
module.exports = destroy_default;
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var instructions_exports = {};
|
|
29
|
+
__export(instructions_exports, {
|
|
30
|
+
default: () => instructions_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(instructions_exports);
|
|
33
|
+
var import_path = __toESM(require("path"));
|
|
34
|
+
var import_utils = require("@nocobase/utils");
|
|
10
35
|
function instructions_default(plugin, more = {}) {
|
|
11
36
|
const { instructions } = plugin;
|
|
12
37
|
const natives = [
|
|
@@ -25,7 +50,7 @@ function instructions_default(plugin, more = {}) {
|
|
|
25
50
|
"sql"
|
|
26
51
|
].reduce(
|
|
27
52
|
(result, key) => Object.assign(result, {
|
|
28
|
-
[key]:
|
|
53
|
+
[key]: (0, import_utils.requireModule)(import_path.default.isAbsolute(key) ? key : import_path.default.join(__dirname, key))
|
|
29
54
|
}),
|
|
30
55
|
{}
|
|
31
56
|
);
|
|
@@ -36,5 +61,3 @@ function instructions_default(plugin, more = {}) {
|
|
|
36
61
|
);
|
|
37
62
|
}
|
|
38
63
|
}
|
|
39
|
-
|
|
40
|
-
module.exports = instructions_default;
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var loop_exports = {};
|
|
19
|
+
__export(loop_exports, {
|
|
20
|
+
default: () => loop_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(loop_exports);
|
|
23
|
+
var import_constants = require("../constants");
|
|
5
24
|
function getTargetLength(target) {
|
|
6
25
|
let length = 0;
|
|
7
26
|
if (typeof target === "number") {
|
|
@@ -22,12 +41,12 @@ var loop_default = {
|
|
|
22
41
|
const length = getTargetLength(target);
|
|
23
42
|
if (!branch || !length) {
|
|
24
43
|
return {
|
|
25
|
-
status:
|
|
44
|
+
status: import_constants.JOB_STATUS.RESOLVED,
|
|
26
45
|
result: 0
|
|
27
46
|
};
|
|
28
47
|
}
|
|
29
48
|
const job = await processor.saveJob({
|
|
30
|
-
status:
|
|
49
|
+
status: import_constants.JOB_STATUS.PENDING,
|
|
31
50
|
// save loop index
|
|
32
51
|
result: 0,
|
|
33
52
|
nodeId: node.id,
|
|
@@ -41,12 +60,12 @@ var loop_default = {
|
|
|
41
60
|
const loop = processor.nodesMap.get(job.nodeId);
|
|
42
61
|
const [branch] = processor.getBranches(node);
|
|
43
62
|
const { result, status } = job;
|
|
44
|
-
if (status !==
|
|
63
|
+
if (status !== import_constants.JOB_STATUS.PENDING) {
|
|
45
64
|
return processor.exit();
|
|
46
65
|
}
|
|
47
66
|
const nextIndex = result + 1;
|
|
48
67
|
const target = processor.getParsedValue(loop.config.target, node.id);
|
|
49
|
-
if (branchJob.status >
|
|
68
|
+
if (branchJob.status > import_constants.JOB_STATUS.PENDING) {
|
|
50
69
|
job.set({ result: nextIndex });
|
|
51
70
|
const length = getTargetLength(target);
|
|
52
71
|
if (nextIndex < length) {
|
|
@@ -73,5 +92,3 @@ var loop_default = {
|
|
|
73
92
|
return result;
|
|
74
93
|
}
|
|
75
94
|
};
|
|
76
|
-
|
|
77
|
-
module.exports = loop_default;
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var actions_exports = {};
|
|
19
|
+
__export(actions_exports, {
|
|
20
|
+
submit: () => submit
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(actions_exports);
|
|
23
|
+
var import_actions = require("@nocobase/actions");
|
|
24
|
+
var import_constants = require("../../constants");
|
|
6
25
|
async function submit(context, next) {
|
|
7
26
|
var _a, _b, _c;
|
|
8
|
-
const repository =
|
|
27
|
+
const repository = import_actions.utils.getRepositoryFromParams(context);
|
|
9
28
|
const { filterByTk, values } = context.action.params;
|
|
10
29
|
const { currentUser } = context.state;
|
|
11
30
|
if (!currentUser) {
|
|
@@ -28,7 +47,7 @@ async function submit(context, next) {
|
|
|
28
47
|
const [formKey] = Object.keys(values.result ?? {}).filter((key) => key !== "_");
|
|
29
48
|
const actionKey = (_a = values.result) == null ? void 0 : _a._;
|
|
30
49
|
const actionItem = (_c = (_b = forms[formKey]) == null ? void 0 : _b.actions) == null ? void 0 : _c.find((item) => item.key === actionKey);
|
|
31
|
-
if (userJob.status !==
|
|
50
|
+
if (userJob.status !== import_constants.JOB_STATUS.PENDING || userJob.job.status !== import_constants.JOB_STATUS.PENDING || userJob.execution.status !== import_constants.EXECUTION_STATUS.STARTED || !userJob.workflow.enabled || !actionKey || (actionItem == null ? void 0 : actionItem.status) == null) {
|
|
32
51
|
return context.throw(400);
|
|
33
52
|
}
|
|
34
53
|
userJob.execution.workflow = userJob.workflow;
|
|
@@ -45,7 +64,7 @@ async function submit(context, next) {
|
|
|
45
64
|
});
|
|
46
65
|
userJob.set({
|
|
47
66
|
status: actionItem.status,
|
|
48
|
-
result: actionItem.status >
|
|
67
|
+
result: actionItem.status > import_constants.JOB_STATUS.PENDING ? { [formKey]: Object.assign(values.result[formKey], presetValues), _: actionKey } : Object.assign(userJob.result ?? {}, values.result)
|
|
49
68
|
});
|
|
50
69
|
const handler = instruction.formTypes.get(forms[formKey].type);
|
|
51
70
|
if (handler && userJob.status) {
|
|
@@ -61,5 +80,7 @@ async function submit(context, next) {
|
|
|
61
80
|
processor.logger.info(`manual node (${userJob.nodeId}) action trigger execution (${userJob.execution.id}) to resume`);
|
|
62
81
|
plugin.resume(userJob.job);
|
|
63
82
|
}
|
|
64
|
-
|
|
65
|
-
exports
|
|
83
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
84
|
+
0 && (module.exports = {
|
|
85
|
+
submit
|
|
86
|
+
});
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var jobs_exports = {};
|
|
19
|
+
__export(jobs_exports, {
|
|
20
|
+
default: () => jobs_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(jobs_exports);
|
|
3
23
|
var jobs_default = {
|
|
4
24
|
name: "jobs",
|
|
5
25
|
fields: [
|
|
@@ -17,5 +37,3 @@ var jobs_default = {
|
|
|
17
37
|
}
|
|
18
38
|
]
|
|
19
39
|
};
|
|
20
|
-
|
|
21
|
-
module.exports = jobs_default;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var users_exports = {};
|
|
19
|
+
__export(users_exports, {
|
|
20
|
+
default: () => users_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(users_exports);
|
|
3
23
|
var users_default = {
|
|
4
24
|
name: "users",
|
|
5
25
|
fields: [
|
|
@@ -15,5 +35,3 @@ var users_default = {
|
|
|
15
35
|
}
|
|
16
36
|
]
|
|
17
37
|
};
|
|
18
|
-
|
|
19
|
-
module.exports = users_default;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var users_jobs_exports = {};
|
|
19
|
+
__export(users_jobs_exports, {
|
|
20
|
+
default: () => users_jobs_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(users_jobs_exports);
|
|
3
23
|
var users_jobs_default = {
|
|
4
24
|
namespace: "workflow.executionLogs",
|
|
5
25
|
name: "users_jobs",
|
|
@@ -48,5 +68,3 @@ var users_jobs_default = {
|
|
|
48
68
|
}
|
|
49
69
|
]
|
|
50
70
|
};
|
|
51
|
-
|
|
52
|
-
module.exports = users_jobs_default;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var create_exports = {};
|
|
19
|
+
__export(create_exports, {
|
|
20
|
+
default: () => create_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(create_exports);
|
|
3
23
|
async function create_default(instance, { collection }, processor) {
|
|
4
24
|
const repo = this.plugin.db.getRepository(collection);
|
|
5
25
|
if (!repo) {
|
|
@@ -19,5 +39,3 @@ async function create_default(instance, { collection }, processor) {
|
|
|
19
39
|
transaction: processor.transaction
|
|
20
40
|
});
|
|
21
41
|
}
|
|
22
|
-
|
|
23
|
-
module.exports = create_default;
|
|
@@ -1,16 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var forms_exports = {};
|
|
29
|
+
__export(forms_exports, {
|
|
30
|
+
default: () => forms_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(forms_exports);
|
|
33
|
+
var import_create = __toESM(require("./create"));
|
|
34
|
+
var import_update = __toESM(require("./update"));
|
|
11
35
|
function forms_default({ formTypes }) {
|
|
12
|
-
formTypes.register("create",
|
|
13
|
-
formTypes.register("update",
|
|
36
|
+
formTypes.register("create", import_create.default);
|
|
37
|
+
formTypes.register("update", import_update.default);
|
|
14
38
|
}
|
|
15
|
-
|
|
16
|
-
module.exports = forms_default;
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var update_exports = {};
|
|
19
|
+
__export(update_exports, {
|
|
20
|
+
default: () => update_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(update_exports);
|
|
3
23
|
async function update_default(instance, { collection, filter = {} }, processor) {
|
|
4
24
|
const repo = this.plugin.db.getRepository(collection);
|
|
5
25
|
if (!repo) {
|
|
@@ -19,5 +39,3 @@ async function update_default(instance, { collection, filter = {} }, processor)
|
|
|
19
39
|
transaction: processor.transaction
|
|
20
40
|
});
|
|
21
41
|
}
|
|
22
|
-
|
|
23
|
-
module.exports = update_default;
|