@nocobase/plugin-workflow 2.0.0-alpha.33 → 2.0.0-alpha.35

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.
@@ -11,8 +11,8 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.7",
13
13
  "@formily/react": "2.3.7",
14
- "@nocobase/client": "2.0.0-alpha.33",
15
- "@nocobase/utils": "2.0.0-alpha.33",
14
+ "@nocobase/client": "2.0.0-alpha.35",
15
+ "@nocobase/utils": "2.0.0-alpha.35",
16
16
  "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
18
  "react-router-dom": "6.30.1",
@@ -20,17 +20,17 @@ module.exports = {
20
20
  "lodash": "4.17.21",
21
21
  "@dnd-kit/core": "6.1.0",
22
22
  "@formily/shared": "2.3.7",
23
- "@nocobase/plugin-mobile": "2.0.0-alpha.33",
23
+ "@nocobase/plugin-mobile": "2.0.0-alpha.35",
24
24
  "sequelize": "6.35.2",
25
- "@nocobase/database": "2.0.0-alpha.33",
26
- "@nocobase/server": "2.0.0-alpha.33",
27
- "@nocobase/data-source-manager": "2.0.0-alpha.33",
28
- "@nocobase/logger": "2.0.0-alpha.33",
29
- "@nocobase/evaluators": "2.0.0-alpha.33",
25
+ "@nocobase/database": "2.0.0-alpha.35",
26
+ "@nocobase/server": "2.0.0-alpha.35",
27
+ "@nocobase/data-source-manager": "2.0.0-alpha.35",
28
+ "@nocobase/logger": "2.0.0-alpha.35",
29
+ "@nocobase/evaluators": "2.0.0-alpha.35",
30
30
  "@formily/antd-v5": "1.2.3",
31
31
  "@formily/reactive": "2.3.7",
32
- "@nocobase/actions": "2.0.0-alpha.33",
32
+ "@nocobase/actions": "2.0.0-alpha.35",
33
33
  "dayjs": "1.11.13",
34
- "@nocobase/plugin-workflow-test": "2.0.0-alpha.33",
35
- "@nocobase/test": "2.0.0-alpha.33"
34
+ "@nocobase/plugin-workflow-test": "2.0.0-alpha.35",
35
+ "@nocobase/test": "2.0.0-alpha.35"
36
36
  };
@@ -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":"2025-11-05T03:42:09.415Z"}
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":"2025-11-06T09:31:43.572Z"}
@@ -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":"2025-11-05T03:42:09.052Z"}
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":"2025-11-06T09:31:43.223Z"}
@@ -1 +1 @@
1
- {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2025-11-05T03:42:08.858Z"}
1
+ {"name":"nodejs-snowflake","collaborators":["Utkarsh Srivastava <utkarsh@sagacious.dev>"],"description":"Generate time sortable 64 bits unique ids for distributed systems (inspired from twitter snowflake)","version":"2.0.1","license":"Apache 2.0","repository":{"type":"git","url":"https://github.com/utkarsh-pro/nodejs-snowflake.git"},"files":["nodejs_snowflake_bg.wasm","nodejs_snowflake.js","nodejs_snowflake.d.ts"],"main":"nodejs_snowflake.js","types":"nodejs_snowflake.d.ts","_lastModified":"2025-11-06T09:31:43.034Z"}
@@ -347,7 +347,9 @@ class PluginWorkflowServer extends import_server.Plugin {
347
347
  const type = workflow.get("type");
348
348
  const trigger = this.triggers.get(type);
349
349
  if (!trigger) {
350
- this.getLogger(workflow.id).error(`trigger type ${workflow.type} of workflow ${workflow.id} is not implemented`);
350
+ this.getLogger(workflow.id).error(`trigger type ${workflow.type} of workflow ${workflow.id} is not implemented`, {
351
+ workflowId: workflow.id
352
+ });
351
353
  return;
352
354
  }
353
355
  const next = enable ?? workflow.get("enabled");
@@ -355,14 +357,20 @@ class PluginWorkflowServer extends import_server.Plugin {
355
357
  const prev = workflow.previous();
356
358
  if (prev.config) {
357
359
  trigger.off({ ...workflow.get(), ...prev });
358
- this.getLogger(workflow.id).info(`toggle OFF workflow ${workflow.id} based on configuration before updated`);
360
+ this.getLogger(workflow.id).info(`toggle OFF workflow ${workflow.id} based on configuration before updated`, {
361
+ workflowId: workflow.id
362
+ });
359
363
  }
360
364
  trigger.on(workflow);
361
- this.getLogger(workflow.id).info(`toggle ON workflow ${workflow.id}`);
365
+ this.getLogger(workflow.id).info(`toggle ON workflow ${workflow.id}`, {
366
+ workflowId: workflow.id
367
+ });
362
368
  this.enabledCache.set(workflow.id, workflow);
363
369
  } else {
364
370
  trigger.off(workflow);
365
- this.getLogger(workflow.id).info(`toggle OFF workflow ${workflow.id}`);
371
+ this.getLogger(workflow.id).info(`toggle OFF workflow ${workflow.id}`, {
372
+ workflowId: workflow.id
373
+ });
366
374
  this.enabledCache.delete(workflow.id);
367
375
  }
368
376
  if (!silent) {
@@ -144,7 +144,9 @@ class Processor {
144
144
  async start() {
145
145
  const { execution } = this;
146
146
  if (execution.status) {
147
- this.logger.warn(`execution was ended with status ${execution.status} before, could not be started again`);
147
+ this.logger.warn(`execution was ended with status ${execution.status} before, could not be started again`, {
148
+ workflowId: execution.workflowId
149
+ });
148
150
  return;
149
151
  }
150
152
  await this.prepare();
@@ -158,7 +160,9 @@ class Processor {
158
160
  async resume(job) {
159
161
  const { execution } = this;
160
162
  if (execution.status) {
161
- this.logger.warn(`execution was ended with status ${execution.status} before, could not be resumed`);
163
+ this.logger.warn(`execution was ended with status ${execution.status} before, could not be resumed`, {
164
+ workflowId: execution.workflowId
165
+ });
162
166
  return;
163
167
  }
164
168
  await this.prepare();
@@ -168,7 +172,7 @@ class Processor {
168
172
  async exec(instruction, node, prevJob) {
169
173
  let job;
170
174
  try {
171
- this.logger.debug(`config of node`, { data: node.config });
175
+ this.logger.debug(`config of node`, { data: node.config, workflowId: node.workflowId });
172
176
  job = await instruction(node, prevJob, this);
173
177
  if (job === null) {
174
178
  return this.exit();
@@ -179,7 +183,7 @@ class Processor {
179
183
  } catch (err) {
180
184
  this.logger.error(
181
185
  `execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id}) failed: `,
182
- err
186
+ { error: err, workflowId: node.workflowId }
183
187
  );
184
188
  job = {
185
189
  result: err instanceof Error ? {
@@ -199,7 +203,10 @@ class Processor {
199
203
  }
200
204
  const savedJob = this.saveJob(job);
201
205
  this.logger.info(
202
- `execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id}) finished as status: ${savedJob.status}`
206
+ `execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id}) finished as status: ${savedJob.status}`,
207
+ {
208
+ workflowId: node.workflowId
209
+ }
203
210
  );
204
211
  this.logger.debug(`result of node`, { data: savedJob.result });
205
212
  if (savedJob.status === import_constants.JOB_STATUS.RESOLVED && node.downstream) {
@@ -217,7 +224,9 @@ class Processor {
217
224
  if (typeof instruction.run !== "function") {
218
225
  return Promise.reject(new Error("`run` should be implemented for customized execution of the node"));
219
226
  }
220
- this.logger.info(`execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id})`);
227
+ this.logger.info(`execution (${this.execution.id}) run instruction [${node.type}] for node (${node.id})`, {
228
+ workflowId: node.workflowId
229
+ });
221
230
  return this.exec(instruction.run.bind(instruction), node, input);
222
231
  }
223
232
  // parent node should take over the control
@@ -225,7 +234,9 @@ class Processor {
225
234
  this.logger.debug(`branch ended at node (${node.id})`);
226
235
  const parentNode = this.findBranchParentNode(node);
227
236
  if (parentNode) {
228
- this.logger.debug(`not on main, recall to parent entry node (${node.id})})`);
237
+ this.logger.debug(`not on main, recall to parent entry node (${node.id})})`, {
238
+ workflowId: node.workflowId
239
+ });
229
240
  await this.recall(parentNode, job);
230
241
  return null;
231
242
  }
@@ -242,7 +253,9 @@ class Processor {
242
253
  new Error(`"resume" method should be implemented for [${node.type}] instruction of node (#${node.id})`)
243
254
  );
244
255
  }
245
- this.logger.info(`execution (${this.execution.id}) resume instruction [${node.type}] for node (${node.id})`);
256
+ this.logger.info(`execution (${this.execution.id}) resume instruction [${node.type}] for node (${node.id})`, {
257
+ workflowId: node.workflowId
258
+ });
246
259
  return this.exec(instruction.resume.bind(instruction), node, job);
247
260
  }
248
261
  async exit(s) {
@@ -295,7 +308,9 @@ class Processor {
295
308
  if (this.mainTransaction && this.mainTransaction !== this.transaction) {
296
309
  await this.mainTransaction.commit();
297
310
  }
298
- this.logger.info(`execution (${this.execution.id}) exiting with status ${this.execution.status}`);
311
+ this.logger.info(`execution (${this.execution.id}) exiting with status ${this.execution.status}`, {
312
+ workflowId: this.execution.workflowId
313
+ });
299
314
  return null;
300
315
  }
301
316
  /**
@@ -326,7 +341,9 @@ class Processor {
326
341
  this.lastSavedJob = job;
327
342
  this.jobsMapByNodeKey[job.nodeKey] = job;
328
343
  this.jobResultsMapByNodeKey[job.nodeKey] = job.result;
329
- this.logger.debug(`job added to save list: ${JSON.stringify(job)}`);
344
+ this.logger.debug(`job added to save list: ${JSON.stringify(job)}`, {
345
+ workflowId: this.execution.workflowId
346
+ });
330
347
  return job;
331
348
  }
332
349
  /**
package/package.json CHANGED
@@ -4,7 +4,7 @@
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": "2.0.0-alpha.33",
7
+ "version": "2.0.0-alpha.35",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -45,7 +45,7 @@
45
45
  "@nocobase/test": "2.x",
46
46
  "@nocobase/utils": "2.x"
47
47
  },
48
- "gitHead": "d5970aa7f8bf84e92082e182b780344e86bde998",
48
+ "gitHead": "e60da9bab9fd4c8ba9457e9806d5428054cefa7a",
49
49
  "keywords": [
50
50
  "Workflow"
51
51
  ]