@nocobase/plugin-workflow 1.2.7-alpha → 1.2.9-alpha
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 +60 -60
- package/dist/externalVersion.js +10 -10
- package/dist/locale/zh-CN.json +4 -0
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/node_modules/lru-cache/package.json +1 -1
- package/dist/server/Plugin.js +3 -5
- package/dist/server/Processor.js +6 -2
- package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +3 -4
- package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +3 -4
- package/package.json +3 -3
package/dist/externalVersion.js
CHANGED
|
@@ -11,24 +11,24 @@ module.exports = {
|
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"antd": "5.12.8",
|
|
13
13
|
"@ant-design/icons": "5.2.6",
|
|
14
|
-
"@nocobase/client": "1.2.
|
|
14
|
+
"@nocobase/client": "1.2.9-alpha",
|
|
15
15
|
"react-router-dom": "6.21.0",
|
|
16
|
-
"@nocobase/utils": "1.2.
|
|
16
|
+
"@nocobase/utils": "1.2.9-alpha",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
18
|
"@formily/core": "2.3.0",
|
|
19
19
|
"@formily/react": "2.3.0",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
|
-
"@nocobase/database": "1.2.
|
|
22
|
-
"@nocobase/server": "1.2.
|
|
23
|
-
"@nocobase/logger": "1.2.
|
|
24
|
-
"@nocobase/evaluators": "1.2.
|
|
21
|
+
"@nocobase/database": "1.2.9-alpha",
|
|
22
|
+
"@nocobase/server": "1.2.9-alpha",
|
|
23
|
+
"@nocobase/logger": "1.2.9-alpha",
|
|
24
|
+
"@nocobase/evaluators": "1.2.9-alpha",
|
|
25
25
|
"@formily/antd-v5": "1.1.9",
|
|
26
26
|
"@formily/reactive": "2.3.0",
|
|
27
27
|
"@formily/shared": "2.3.0",
|
|
28
|
-
"@nocobase/actions": "1.2.
|
|
29
|
-
"@nocobase/data-source-manager": "1.2.
|
|
28
|
+
"@nocobase/actions": "1.2.9-alpha",
|
|
29
|
+
"@nocobase/data-source-manager": "1.2.9-alpha",
|
|
30
30
|
"sequelize": "6.35.2",
|
|
31
|
-
"@nocobase/plugin-workflow-test": "1.2.
|
|
32
|
-
"@nocobase/test": "1.2.
|
|
31
|
+
"@nocobase/plugin-workflow-test": "1.2.9-alpha",
|
|
32
|
+
"@nocobase/test": "1.2.9-alpha",
|
|
33
33
|
"dayjs": "1.11.10"
|
|
34
34
|
};
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"工作流中的节点将在同一个事务中运行。任何失败都会导致数据回滚,同时也会回滚相应的执行历史。",
|
|
24
24
|
"Auto delete history when execution is on end status": "执行结束后自动删除对应状态的历史记录",
|
|
25
25
|
"Trigger": "触发器",
|
|
26
|
+
"Unknown trigger": "未知触发器",
|
|
27
|
+
"Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.": "未知类型的工作流会导致错误,请删除或检查提供该类型的插件。",
|
|
26
28
|
"Trigger variables": "触发器变量",
|
|
27
29
|
"Trigger data": "触发数据",
|
|
28
30
|
"Trigger time": "触发时间",
|
|
@@ -137,6 +139,8 @@
|
|
|
137
139
|
"Manual": "人工处理",
|
|
138
140
|
"Extended types": "扩展类型",
|
|
139
141
|
"Node type": "节点类型",
|
|
142
|
+
"Unknown node": "未知节点",
|
|
143
|
+
"Node with unknown type will cause error. Please delete it or check plugin which provide this type.": "未知类型的节点会导致错误,请删除或检查提供该类型的插件。",
|
|
140
144
|
"Calculation": "运算",
|
|
141
145
|
"Calculation engine": "运算引擎",
|
|
142
146
|
"Basic": "基础",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2024-06-
|
|
1
|
+
{"name":"cron-parser","version":"4.4.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^1.28.0"},"devDependencies":{"eslint":"^8.2.0","sinon":"^10.0.0","tap":"^16.0.1","tsd":"^0.19.0"},"engines":{"node":">=0.8"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"_lastModified":"2024-06-27T03:13:29.760Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2024-06-
|
|
1
|
+
{"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2024-06-27T03:13:29.406Z"}
|
package/dist/server/Plugin.js
CHANGED
|
@@ -224,7 +224,9 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
224
224
|
db.on("workflows.beforeSave", this.onBeforeSave);
|
|
225
225
|
db.on("workflows.afterSave", (model) => this.toggle(model));
|
|
226
226
|
db.on("workflows.afterDestroy", (model) => this.toggle(model, false));
|
|
227
|
-
this.app.on("
|
|
227
|
+
this.app.on("afterStart", async () => {
|
|
228
|
+
this.app.setMaintainingMessage("check for not started executions");
|
|
229
|
+
this.ready = true;
|
|
228
230
|
const collection = db.getCollection("workflows");
|
|
229
231
|
const workflows = await collection.repository.find({
|
|
230
232
|
filter: { enabled: true }
|
|
@@ -235,10 +237,6 @@ class PluginWorkflowServer extends import_server.Plugin {
|
|
|
235
237
|
this.checker = setInterval(() => {
|
|
236
238
|
this.dispatch();
|
|
237
239
|
}, 3e5);
|
|
238
|
-
});
|
|
239
|
-
this.app.on("afterStart", () => {
|
|
240
|
-
this.app.setMaintainingMessage("check for not started executions");
|
|
241
|
-
this.ready = true;
|
|
242
240
|
this.dispatch();
|
|
243
241
|
});
|
|
244
242
|
this.app.on("beforeStop", async () => {
|
package/dist/server/Processor.js
CHANGED
|
@@ -98,9 +98,13 @@ class Processor {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
async prepare() {
|
|
101
|
-
const {
|
|
101
|
+
const {
|
|
102
|
+
execution,
|
|
103
|
+
transaction,
|
|
104
|
+
options: { plugin }
|
|
105
|
+
} = this;
|
|
102
106
|
if (!execution.workflow) {
|
|
103
|
-
execution.workflow =
|
|
107
|
+
execution.workflow = plugin.enabledCache.get(execution.workflowId);
|
|
104
108
|
}
|
|
105
109
|
const nodes = await execution.workflow.getNodes({ transaction });
|
|
106
110
|
this.makeNodes(nodes);
|
|
@@ -121,10 +121,9 @@ class ScheduleTrigger {
|
|
|
121
121
|
// caching workflows in range, default to 5min
|
|
122
122
|
cacheCycle = 3e5;
|
|
123
123
|
async reload() {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
124
|
+
const workflows = Array.from(this.workflow.enabledCache.values()).filter(
|
|
125
|
+
(item) => item.type === "schedule" && item.config.mode === import_utils.SCHEDULE_MODE.DATE_FIELD
|
|
126
|
+
);
|
|
128
127
|
this.cache = /* @__PURE__ */ new Map();
|
|
129
128
|
this.inspect(workflows);
|
|
130
129
|
}
|
|
@@ -46,10 +46,9 @@ class StaticScheduleTrigger {
|
|
|
46
46
|
constructor(workflow) {
|
|
47
47
|
this.workflow = workflow;
|
|
48
48
|
workflow.app.on("afterStart", async () => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
49
|
+
const workflows = Array.from(this.workflow.enabledCache.values()).filter(
|
|
50
|
+
(item) => item.type === "schedule" && item.config.mode === import_utils.SCHEDULE_MODE.STATIC
|
|
51
|
+
);
|
|
53
52
|
this.inspect(workflows);
|
|
54
53
|
});
|
|
55
54
|
workflow.app.on("beforeStop", () => {
|
package/package.json
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流",
|
|
5
5
|
"description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
|
|
6
6
|
"description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
|
|
7
|
-
"version": "1.2.
|
|
7
|
+
"version": "1.2.9-alpha",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow",
|
|
11
11
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/workflow",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nocobase/plugin-workflow-test": "1.2.
|
|
13
|
+
"@nocobase/plugin-workflow-test": "1.2.9-alpha"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@ant-design/icons": "5.x",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@nocobase/test": "1.x",
|
|
45
45
|
"@nocobase/utils": "1.x"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b80e4678e8098d60755195ec63f865122aba021a",
|
|
48
48
|
"keywords": [
|
|
49
49
|
"Workflow"
|
|
50
50
|
]
|