@nocobase/plugin-workflow-delay 2.3.0-alpha.1 → 2.3.0-beta.10
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/externalVersion.js
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.3.0-
|
|
12
|
-
"@nocobase/plugin-workflow": "2.3.0-
|
|
11
|
+
"@nocobase/client": "2.3.0-beta.10",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.3.0-beta.10",
|
|
13
13
|
"react": "18.2.0",
|
|
14
14
|
"@ant-design/icons": "5.6.1",
|
|
15
|
-
"@nocobase/flow-engine": "2.3.0-
|
|
16
|
-
"@nocobase/client-v2": "2.3.0-
|
|
15
|
+
"@nocobase/flow-engine": "2.3.0-beta.10",
|
|
16
|
+
"@nocobase/client-v2": "2.3.0-beta.10",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
|
-
"@nocobase/server": "2.3.0-
|
|
18
|
+
"@nocobase/server": "2.3.0-beta.10",
|
|
19
19
|
"antd": "5.24.2"
|
|
20
20
|
};
|
package/dist/locale/en-US.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"Delay": "Delay",
|
|
3
3
|
"Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.": "Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.",
|
|
4
4
|
"Duration": "Duration",
|
|
5
|
+
"Delay duration must be a finite number greater than or equal to 1": "Delay duration must be a finite number greater than or equal to 1",
|
|
5
6
|
"Duration must be at least 1": "Duration must be at least 1",
|
|
6
7
|
"End status": "End status",
|
|
7
8
|
"Fail and exit": "Fail and exit",
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"Delay": "延时",
|
|
3
3
|
"Delay a period of time and then continue or exit the process. Can be used to set wait or timeout times in parallel branches.": "延时一段时间,然后继续或退出流程。可以用于并行分支中等待其他分支或设置超时时间。",
|
|
4
4
|
"Duration": "时长",
|
|
5
|
+
"Delay duration must be a finite number greater than or equal to 1": "延时时长必须是大于或等于 1 的有限数字",
|
|
5
6
|
"Duration must be at least 1": "时长不能小于 1",
|
|
6
7
|
"End status": "到时状态",
|
|
7
8
|
"Fail and exit": "失败并退出",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-09-15T04:39:05.093Z"}
|
|
@@ -42,6 +42,7 @@ module.exports = __toCommonJS(DelayInstruction_exports);
|
|
|
42
42
|
var import_joi = __toESM(require("joi"));
|
|
43
43
|
var import_plugin_workflow = require("@nocobase/plugin-workflow");
|
|
44
44
|
const UNITS = [1e3, 6e4, 36e5, 864e5, 6048e5];
|
|
45
|
+
const NAMESPACE = "workflow-delay";
|
|
45
46
|
class DelayInstruction_default extends import_plugin_workflow.Instruction {
|
|
46
47
|
constructor(workflow) {
|
|
47
48
|
super(workflow);
|
|
@@ -51,7 +52,7 @@ class DelayInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
51
52
|
}
|
|
52
53
|
timers = /* @__PURE__ */ new Map();
|
|
53
54
|
configSchema = import_joi.default.object({
|
|
54
|
-
duration: import_joi.default.number().min(1),
|
|
55
|
+
duration: import_joi.default.alternatives().try(import_joi.default.number().min(1), import_joi.default.string()),
|
|
55
56
|
endStatus: import_joi.default.number().valid(import_plugin_workflow.JOB_STATUS.RESOLVED, import_plugin_workflow.JOB_STATUS.FAILED),
|
|
56
57
|
unit: import_joi.default.number().valid(...UNITS)
|
|
57
58
|
});
|
|
@@ -107,7 +108,8 @@ class DelayInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
107
108
|
job.execution = await job.getExecution();
|
|
108
109
|
}
|
|
109
110
|
if (job.execution.status === import_plugin_workflow.EXECUTION_STATUS.STARTED) {
|
|
110
|
-
this.workflow.resume(job)
|
|
111
|
+
await this.workflow.resume(job).catch(() => {
|
|
112
|
+
});
|
|
111
113
|
}
|
|
112
114
|
const idStr = job.id.toString();
|
|
113
115
|
if (this.timers.get(idStr)) {
|
|
@@ -116,7 +118,15 @@ class DelayInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
async run(node, prevJob, processor) {
|
|
119
|
-
const
|
|
121
|
+
const parsedDuration = processor.getParsedValue(node.config.duration ?? 1, node.id);
|
|
122
|
+
if (typeof parsedDuration !== "number" || !Number.isFinite(parsedDuration) || parsedDuration < 1) {
|
|
123
|
+
throw new Error(
|
|
124
|
+
this.workflow.app.i18n.t("Delay duration must be a finite number greater than or equal to 1", {
|
|
125
|
+
ns: NAMESPACE
|
|
126
|
+
})
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const duration = parsedDuration * (node.config.unit || 1e3);
|
|
120
130
|
const job = processor.saveJob({
|
|
121
131
|
status: import_plugin_workflow.JOB_STATUS.PENDING,
|
|
122
132
|
result: duration,
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Could be used in workflow parallel branch for waiting other branches.",
|
|
7
7
|
"description.ru-RU": "Может использоваться в параллельных ветках рабочего процесса для ожидания завершения других веток.",
|
|
8
8
|
"description.zh-CN": "可用于工作流并行分支中等待其他分支执行完成。",
|
|
9
|
-
"version": "2.3.0-
|
|
9
|
+
"version": "2.3.0-beta.10",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow-delay",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@nocobase/server": "2.x",
|
|
27
27
|
"@nocobase/test": "2.x"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "7aa3dce6cf3201752882f7012c72997898015d89",
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Workflow"
|
|
32
32
|
]
|