@tachybase/module-workflow 0.23.41 → 0.23.47

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.
Files changed (40) hide show
  1. package/dist/client/components/ExecutionRetryAction.d.ts +3 -0
  2. package/dist/client/components/ExecutionTime.d.ts +2 -1
  3. package/dist/client/components/index.d.ts +2 -1
  4. package/dist/client/features/dynamic-calculation/DynamicExpression.d.ts +2 -2
  5. package/dist/client/features/trigger-instruction/TriggerInstruction.d.ts +4 -2
  6. package/dist/client/index.d.ts +1 -2
  7. package/dist/client/index.js +58 -58
  8. package/dist/client/schemas/executions.d.ts +16 -6
  9. package/dist/externalVersion.js +15 -15
  10. package/dist/locale/zh-CN.json +8 -0
  11. package/dist/node_modules/@babel/core/package.json +1 -1
  12. package/dist/node_modules/cron-parser/package.json +1 -1
  13. package/dist/node_modules/form-data/package.json +1 -1
  14. package/dist/node_modules/jsonata/package.json +1 -1
  15. package/dist/node_modules/lru-cache/package.json +1 -1
  16. package/dist/node_modules/mime-types/package.json +1 -1
  17. package/dist/node_modules/qrcode/package.json +1 -1
  18. package/dist/server/Plugin.js +80 -76
  19. package/dist/server/Processor.js +15 -17
  20. package/dist/server/actions/executions.d.ts +2 -1
  21. package/dist/server/actions/executions.js +48 -2
  22. package/dist/server/actions/workflows.d.ts +1 -0
  23. package/dist/server/actions/workflows.js +66 -0
  24. package/dist/server/collections/executions.js +4 -0
  25. package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.js +4 -1
  26. package/dist/server/features/delay/DelayInstruction.js +36 -36
  27. package/dist/server/features/interception/RequestInterceptionTrigger.js +81 -80
  28. package/dist/server/features/manual/ManualInstruction.js +1 -1
  29. package/dist/server/features/notice/plugin.js +0 -1
  30. package/dist/server/features/omni-trigger/CustomActionTrigger.js +122 -121
  31. package/dist/server/migrations/20241118104303-add-initAt.js +6 -3
  32. package/dist/server/migrations/20241206122842-add-createdBy.js +6 -3
  33. package/dist/server/migrations/20241220001154-bigInt.js +6 -3
  34. package/dist/server/triggers/CollectionTrigger.js +4 -1
  35. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +5 -5
  36. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +1 -1
  37. package/dist/server/triggers/ScheduleTrigger/index.js +2 -2
  38. package/dist/server/triggers/index.js +0 -1
  39. package/package.json +17 -17
  40. /package/dist/client/{ExecutionLink.d.ts → components/ExecutionLink.d.ts} +0 -0
@@ -113,6 +113,12 @@ export declare const getExecutionSchema: (params?: any) => {
113
113
  type: string;
114
114
  'x-component': string;
115
115
  };
116
+ retry: {
117
+ type: string;
118
+ title: string;
119
+ 'x-component': string;
120
+ 'x-use-component-props': string;
121
+ };
116
122
  };
117
123
  };
118
124
  };
@@ -150,7 +156,7 @@ export declare const getExecutionSchema: (params?: any) => {
150
156
  };
151
157
  };
152
158
  };
153
- executionTime: {
159
+ executionCost: {
154
160
  type: string;
155
161
  title: string;
156
162
  'x-decorator': string;
@@ -159,9 +165,8 @@ export declare const getExecutionSchema: (params?: any) => {
159
165
  width: number;
160
166
  };
161
167
  properties: {
162
- executionTime: {
168
+ executionCost: {
163
169
  type: string;
164
- 'x-decorator': string;
165
170
  'x-component': string;
166
171
  'x-read-pretty': boolean;
167
172
  };
@@ -310,6 +315,12 @@ export declare const executionSchema: {
310
315
  type: string;
311
316
  'x-component': string;
312
317
  };
318
+ retry: {
319
+ type: string;
320
+ title: string;
321
+ 'x-component': string;
322
+ 'x-use-component-props': string;
323
+ };
313
324
  };
314
325
  };
315
326
  };
@@ -347,7 +358,7 @@ export declare const executionSchema: {
347
358
  };
348
359
  };
349
360
  };
350
- executionTime: {
361
+ executionCost: {
351
362
  type: string;
352
363
  title: string;
353
364
  'x-decorator': string;
@@ -356,9 +367,8 @@ export declare const executionSchema: {
356
367
  width: number;
357
368
  };
358
369
  properties: {
359
- executionTime: {
370
+ executionCost: {
360
371
  type: string;
361
- 'x-decorator': string;
362
372
  'x-component': string;
363
373
  'x-read-pretty': boolean;
364
374
  };
@@ -1,25 +1,25 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "0.23.41",
3
+ "@tachybase/client": "0.23.47",
4
4
  "@ant-design/icons": "5.3.7",
5
5
  "antd": "5.22.5",
6
6
  "lodash": "4.17.21",
7
- "@tachybase/utils": "0.23.41",
7
+ "@tachybase/utils": "0.23.47",
8
8
  "react-i18next": "15.2.0",
9
9
  "react-router-dom": "6.28.1",
10
- "@tachybase/schema": "0.23.41",
11
- "@tachybase/database": "0.23.41",
12
- "@tachybase/logger": "0.23.41",
13
- "@tachybase/server": "0.23.41",
14
- "@tachybase/evaluators": "0.23.41",
15
- "@tachybase/components": "0.23.41",
16
- "@tachybase/actions": "0.23.41",
17
- "@tachybase/data-source": "0.23.41",
10
+ "@tachybase/schema": "0.23.47",
11
+ "@tachybase/database": "0.23.47",
12
+ "@tachybase/logger": "0.23.47",
13
+ "@tachybase/server": "0.23.47",
14
+ "@tachybase/evaluators": "0.23.47",
15
+ "@tachybase/components": "0.23.47",
16
+ "@tachybase/actions": "0.23.47",
17
+ "@tachybase/data-source": "0.23.47",
18
18
  "axios": "1.7.7",
19
19
  "sequelize": "6.37.5",
20
- "@tachybase/plugin-workflow-test": "0.23.41",
21
- "@tachybase/test": "0.23.41",
22
- "@tachybase/module-error-handler": "0.23.41",
23
- "@tachybase/resourcer": "0.23.41",
24
- "@tachybase/module-ui-schema": "0.23.41"
20
+ "@tachybase/plugin-workflow-test": "0.23.47",
21
+ "@tachybase/test": "0.23.47",
22
+ "@tachybase/module-error-handler": "0.23.47",
23
+ "@tachybase/resourcer": "0.23.47",
24
+ "@tachybase/module-ui-schema": "0.23.47"
25
25
  };
@@ -56,6 +56,7 @@
56
56
  "Assigned": "已分配",
57
57
  "Assignee": "审批人",
58
58
  "Assignees": "审批人",
59
+ "Associated workflow not found.": "未找到关联的工作流",
59
60
  "Associations to use": "待使用的关系数据",
60
61
  "Asynchronously": "异步",
61
62
  "Auto delete history when execution is on end status": "执行结束后自动删除对应状态的历史记录",
@@ -169,6 +170,7 @@
169
170
  "Executed at": "执行于",
170
171
  "Executed time": "执行时长",
171
172
  "Executed workflow cannot be modified": "已经执行过的工作流不能被修改",
173
+ "Execution ID is required": "执行 ID 是必需的",
172
174
  "Execution history": "执行历史",
173
175
  "Exit when query result is null": "查询结果为空时,退出流程",
174
176
  "Expression": "表达式",
@@ -223,6 +225,10 @@
223
225
  "Minutes": "分钟",
224
226
  "Mode": "模式",
225
227
  "Months": "月",
228
+ "Move": "移动",
229
+ "Move current version to another workflow": "将当前版本移动到另一个工作流",
230
+ "Move success": "移动成功",
231
+ "Move workflow": "移动工作流",
226
232
  "Multiple approvers can approve in any order.": "多个审批人可以任意顺序审批。",
227
233
  "Multiple approvers in sequential order.": "多个审批人按照排序审批。",
228
234
  "My Pending Tasks": "我的待办",
@@ -232,6 +238,7 @@
232
238
  "Negotiation mode": "协商模式",
233
239
  "No data yet": "暂无数据",
234
240
  "No end": "不结束",
241
+ "No execution records found for this workflow.": "未找到此工作流的执行记录",
235
242
  "No limit": "不限",
236
243
  "No repeat": "不重复",
237
244
  "Node list": "节点列表",
@@ -300,6 +307,7 @@
300
307
  "Select dynamic expression": "选择动态表达式",
301
308
  "Select fields to display in the approval summary": "选择审批摘要显示字段",
302
309
  "Select status": "选择状态",
310
+ "Select target workflow": "选择目标工作流",
303
311
  "Select the dynamic expression queried from the upstream node. You need to query it from an expression collection.": "从上游节点中选择查询出来的动态表达式。你需要从动态表达式类型的数据表中查询。",
304
312
  "Select workflow": "选择工作流",
305
313
  "Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.": "向指定 URL 发送 HTTP 请求。可以使用上游节点里的变量作为请求头、参数和请求体。",
@@ -1 +1 @@
1
- {"name":"@babel/core","version":"7.26.0","description":"Babel compiler core.","main":"./lib/index.js","author":"The Babel Team (https://babel.dev/team)","license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"https://github.com/babel/babel.git","directory":"packages/babel-core"},"homepage":"https://babel.dev/docs/en/next/babel-core","bugs":"https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen","keywords":["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],"engines":{"node":">=6.9.0"},"funding":{"type":"opencollective","url":"https://opencollective.com/babel"},"browser":{"./lib/config/files/index.js":"./lib/config/files/index-browser.js","./lib/config/resolve-targets.js":"./lib/config/resolve-targets-browser.js","./lib/transform-file.js":"./lib/transform-file-browser.js","./src/config/files/index.ts":"./src/config/files/index-browser.ts","./src/config/resolve-targets.ts":"./src/config/resolve-targets-browser.ts","./src/transform-file.ts":"./src/transform-file-browser.ts"},"dependencies":{"@ampproject/remapping":"^2.2.0","@babel/code-frame":"^7.26.0","@babel/generator":"^7.26.0","@babel/helper-compilation-targets":"^7.25.9","@babel/helper-module-transforms":"^7.26.0","@babel/helpers":"^7.26.0","@babel/parser":"^7.26.0","@babel/template":"^7.25.9","@babel/traverse":"^7.25.9","@babel/types":"^7.26.0","convert-source-map":"^2.0.0","debug":"^4.1.0","gensync":"^1.0.0-beta.2","json5":"^2.2.3","semver":"^6.3.1"},"devDependencies":{"@babel/helper-transform-fixture-test-runner":"^7.26.0","@babel/plugin-syntax-flow":"^7.26.0","@babel/plugin-transform-flow-strip-types":"^7.25.9","@babel/plugin-transform-modules-commonjs":"^7.25.9","@babel/preset-env":"^7.26.0","@babel/preset-typescript":"^7.26.0","@jridgewell/trace-mapping":"^0.3.25","@types/convert-source-map":"^2.0.0","@types/debug":"^4.1.0","@types/gensync":"^1.0.0","@types/resolve":"^1.3.2","@types/semver":"^5.4.0","rimraf":"^3.0.0","ts-node":"^11.0.0-beta.1"},"type":"commonjs","_lastModified":"2025-02-08T06:56:48.998Z"}
1
+ {"name":"@babel/core","version":"7.26.0","description":"Babel compiler core.","main":"./lib/index.js","author":"The Babel Team (https://babel.dev/team)","license":"MIT","publishConfig":{"access":"public"},"repository":{"type":"git","url":"https://github.com/babel/babel.git","directory":"packages/babel-core"},"homepage":"https://babel.dev/docs/en/next/babel-core","bugs":"https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20core%22+is%3Aopen","keywords":["6to5","babel","classes","const","es6","harmony","let","modules","transpile","transpiler","var","babel-core","compiler"],"engines":{"node":">=6.9.0"},"funding":{"type":"opencollective","url":"https://opencollective.com/babel"},"browser":{"./lib/config/files/index.js":"./lib/config/files/index-browser.js","./lib/config/resolve-targets.js":"./lib/config/resolve-targets-browser.js","./lib/transform-file.js":"./lib/transform-file-browser.js","./src/config/files/index.ts":"./src/config/files/index-browser.ts","./src/config/resolve-targets.ts":"./src/config/resolve-targets-browser.ts","./src/transform-file.ts":"./src/transform-file-browser.ts"},"dependencies":{"@ampproject/remapping":"^2.2.0","@babel/code-frame":"^7.26.0","@babel/generator":"^7.26.0","@babel/helper-compilation-targets":"^7.25.9","@babel/helper-module-transforms":"^7.26.0","@babel/helpers":"^7.26.0","@babel/parser":"^7.26.0","@babel/template":"^7.25.9","@babel/traverse":"^7.25.9","@babel/types":"^7.26.0","convert-source-map":"^2.0.0","debug":"^4.1.0","gensync":"^1.0.0-beta.2","json5":"^2.2.3","semver":"^6.3.1"},"devDependencies":{"@babel/helper-transform-fixture-test-runner":"^7.26.0","@babel/plugin-syntax-flow":"^7.26.0","@babel/plugin-transform-flow-strip-types":"^7.25.9","@babel/plugin-transform-modules-commonjs":"^7.25.9","@babel/preset-env":"^7.26.0","@babel/preset-typescript":"^7.26.0","@jridgewell/trace-mapping":"^0.3.25","@types/convert-source-map":"^2.0.0","@types/debug":"^4.1.0","@types/gensync":"^1.0.0","@types/resolve":"^1.3.2","@types/semver":"^5.4.0","rimraf":"^3.0.0","ts-node":"^11.0.0-beta.1"},"type":"commonjs","_lastModified":"2025-02-21T02:31:29.799Z"}
@@ -1 +1 @@
1
- {"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"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":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2025-02-08T06:56:49.236Z"}
1
+ {"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"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":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2025-02-21T02:31:30.044Z"}
@@ -1 +1 @@
1
- {"author":"Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)","name":"form-data","description":"A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.","version":"4.0.1","repository":{"type":"git","url":"git://github.com/form-data/form-data.git"},"main":"./lib/form_data","browser":"./lib/browser","typings":"./index.d.ts","scripts":{"pretest":"npm run lint","pretests-only":"rimraf coverage test/tmp","tests-only":"istanbul cover test/run.js","posttests-only":"istanbul report lcov text","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","lint":"eslint --ext=js,mjs .","report":"istanbul report lcov text","ci-lint":"is-node-modern 8 && npm run lint || is-node-not-modern 8","ci-test":"npm run tests-only && npm run browser && npm run report","predebug":"rimraf coverage test/tmp","debug":"verbose=1 ./test/run.js","browser":"browserify -t browserify-istanbul test/run-browser.js | obake --coverage","check":"istanbul check-coverage coverage/coverage*.json","files":"pkgfiles --sort=name","get-version":"node -e \"console.log(require('./package.json').version)\"","update-readme":"sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md","restore-readme":"mv README.md.bak README.md","prepublish":"in-publish && npm run update-readme || not-in-publish","postpublish":"npm run restore-readme"},"pre-commit":["lint","ci-test","check"],"engines":{"node":">= 6"},"dependencies":{"asynckit":"^0.4.0","combined-stream":"^1.0.8","mime-types":"^2.1.12"},"devDependencies":{"@types/node":"^12.0.10","browserify":"^13.1.1","browserify-istanbul":"^2.0.0","coveralls":"^3.0.4","cross-spawn":"^6.0.5","eslint":"^6.0.1","fake":"^0.2.2","far":"^0.0.7","formidable":"^1.0.17","in-publish":"^2.0.0","is-node-modern":"^1.0.0","istanbul":"^0.4.5","obake":"^0.1.2","puppeteer":"^1.19.0","pkgfiles":"^2.3.0","pre-commit":"^1.1.3","request":"^2.88.0","rimraf":"^2.7.1","tape":"^4.6.2","typescript":"^3.5.2"},"license":"MIT","_lastModified":"2025-02-08T06:56:44.407Z"}
1
+ {"author":"Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)","name":"form-data","description":"A library to create readable \"multipart/form-data\" streams. Can be used to submit forms and file uploads to other web applications.","version":"4.0.1","repository":{"type":"git","url":"git://github.com/form-data/form-data.git"},"main":"./lib/form_data","browser":"./lib/browser","typings":"./index.d.ts","scripts":{"pretest":"npm run lint","pretests-only":"rimraf coverage test/tmp","tests-only":"istanbul cover test/run.js","posttests-only":"istanbul report lcov text","test":"npm run tests-only","posttest":"npx npm@'>=10.2' audit --production","lint":"eslint --ext=js,mjs .","report":"istanbul report lcov text","ci-lint":"is-node-modern 8 && npm run lint || is-node-not-modern 8","ci-test":"npm run tests-only && npm run browser && npm run report","predebug":"rimraf coverage test/tmp","debug":"verbose=1 ./test/run.js","browser":"browserify -t browserify-istanbul test/run-browser.js | obake --coverage","check":"istanbul check-coverage coverage/coverage*.json","files":"pkgfiles --sort=name","get-version":"node -e \"console.log(require('./package.json').version)\"","update-readme":"sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md","restore-readme":"mv README.md.bak README.md","prepublish":"in-publish && npm run update-readme || not-in-publish","postpublish":"npm run restore-readme"},"pre-commit":["lint","ci-test","check"],"engines":{"node":">= 6"},"dependencies":{"asynckit":"^0.4.0","combined-stream":"^1.0.8","mime-types":"^2.1.12"},"devDependencies":{"@types/node":"^12.0.10","browserify":"^13.1.1","browserify-istanbul":"^2.0.0","coveralls":"^3.0.4","cross-spawn":"^6.0.5","eslint":"^6.0.1","fake":"^0.2.2","far":"^0.0.7","formidable":"^1.0.17","in-publish":"^2.0.0","is-node-modern":"^1.0.0","istanbul":"^0.4.5","obake":"^0.1.2","puppeteer":"^1.19.0","pkgfiles":"^2.3.0","pre-commit":"^1.1.3","request":"^2.88.0","rimraf":"^2.7.1","tape":"^4.6.2","typescript":"^3.5.2"},"license":"MIT","_lastModified":"2025-02-21T02:31:25.230Z"}
@@ -1 +1 @@
1
- {"name":"jsonata","version":"2.0.6","description":"JSON query and transformation language","module":"jsonata.js","main":"jsonata.js","typings":"jsonata.d.ts","homepage":"http://jsonata.org/","repository":{"type":"git","url":"https://github.com/jsonata-js/jsonata.git"},"scripts":{"pretest":"npm run lint","mocha":"nyc ./node_modules/mocha/bin/_mocha -- \"test/**/*.js\"","test":"npm run mocha","posttest":"npm run check-coverage && npm run browserify && npm run minify && npm run build-es5","build-es5":"npm run mkdir-dist && npm run regenerator && npm run browserify-es5 && npm run minify-es5","check-coverage":"nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100","browserify":"browserify src/jsonata.js --outfile jsonata.js --standalone jsonata","mkdir-dist":"mkdirp ./dist","regenerator":"babel src --out-dir dist --presets=@babel/env","browserify-es5":"regenerator --include-runtime polyfill.js > jsonata-es5.js; browserify dist/jsonata.js --standalone jsonata >> jsonata-es5.js","prepublishOnly":"npm run browserify && npm run minify && npm run build-es5","lint":"eslint src","doc":"jsdoc --configure jsdoc.json .","cover":"nyc _mocha","minify":"uglifyjs jsonata.js -o jsonata.min.js --compress --mangle","minify-es5":"uglifyjs jsonata-es5.js -o jsonata-es5.min.js --compress --mangle"},"license":"MIT","keywords":["JSON","query","transformation","transform","mapping","path"],"devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","browserify":"^16.5.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","eslint":"8.0.0","eslint-plugin-ideal":"^0.1.3","eslint-plugin-promise":"^6.0.0","jsdoc":"^3.6.3","mkdirp":"^1.0.3","mocha":"^7.0.1","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","regenerator":"^0.14.4","request":"^2.88.2","uglify-es":"^3.3.10"},"engines":{"node":">= 8"},"_lastModified":"2025-02-08T06:56:45.448Z"}
1
+ {"name":"jsonata","version":"2.0.6","description":"JSON query and transformation language","module":"jsonata.js","main":"jsonata.js","typings":"jsonata.d.ts","homepage":"http://jsonata.org/","repository":{"type":"git","url":"https://github.com/jsonata-js/jsonata.git"},"scripts":{"pretest":"npm run lint","mocha":"nyc ./node_modules/mocha/bin/_mocha -- \"test/**/*.js\"","test":"npm run mocha","posttest":"npm run check-coverage && npm run browserify && npm run minify && npm run build-es5","build-es5":"npm run mkdir-dist && npm run regenerator && npm run browserify-es5 && npm run minify-es5","check-coverage":"nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100","browserify":"browserify src/jsonata.js --outfile jsonata.js --standalone jsonata","mkdir-dist":"mkdirp ./dist","regenerator":"babel src --out-dir dist --presets=@babel/env","browserify-es5":"regenerator --include-runtime polyfill.js > jsonata-es5.js; browserify dist/jsonata.js --standalone jsonata >> jsonata-es5.js","prepublishOnly":"npm run browserify && npm run minify && npm run build-es5","lint":"eslint src","doc":"jsdoc --configure jsdoc.json .","cover":"nyc _mocha","minify":"uglifyjs jsonata.js -o jsonata.min.js --compress --mangle","minify-es5":"uglifyjs jsonata-es5.js -o jsonata-es5.min.js --compress --mangle"},"license":"MIT","keywords":["JSON","query","transformation","transform","mapping","path"],"devDependencies":{"@babel/cli":"^7.8.4","@babel/core":"^7.8.4","@babel/preset-env":"^7.8.4","browserify":"^16.5.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","eslint":"8.0.0","eslint-plugin-ideal":"^0.1.3","eslint-plugin-promise":"^6.0.0","jsdoc":"^3.6.3","mkdirp":"^1.0.3","mocha":"^7.0.1","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","regenerator":"^0.14.4","request":"^2.88.2","uglify-es":"^3.3.10"},"engines":{"node":">= 8"},"_lastModified":"2025-02-21T02:31:26.273Z"}
@@ -1 +1 @@
1
- {"type":"commonjs","_lastModified":"2025-02-08T06:56:44.146Z"}
1
+ {"type":"commonjs","_lastModified":"2025-02-21T02:31:24.925Z"}
@@ -1 +1 @@
1
- {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"2.1.35","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"1.52.0"},"devDependencies":{"eslint":"7.32.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.25.4","eslint-plugin-markdown":"2.2.1","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"5.2.0","eslint-plugin-standard":"4.1.0","mocha":"9.2.2","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-02-08T06:56:44.597Z"}
1
+ {"name":"mime-types","description":"The ultimate javascript content-type utility.","version":"2.1.35","contributors":["Douglas Christopher Wilson <doug@somethingdoug.com>","Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)","Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"],"license":"MIT","keywords":["mime","types"],"repository":"jshttp/mime-types","dependencies":{"mime-db":"1.52.0"},"devDependencies":{"eslint":"7.32.0","eslint-config-standard":"14.1.1","eslint-plugin-import":"2.25.4","eslint-plugin-markdown":"2.2.1","eslint-plugin-node":"11.1.0","eslint-plugin-promise":"5.2.0","eslint-plugin-standard":"4.1.0","mocha":"9.2.2","nyc":"15.1.0"},"files":["HISTORY.md","LICENSE","index.js"],"engines":{"node":">= 0.6"},"scripts":{"lint":"eslint .","test":"mocha --reporter spec test/test.js","test-ci":"nyc --reporter=lcov --reporter=text npm test","test-cov":"nyc --reporter=html --reporter=text npm test"},"_lastModified":"2025-02-21T02:31:25.389Z"}
@@ -1 +1 @@
1
- {"name":"qrcode","description":"QRCode / 2d Barcode api with both server side and client side support using canvas","version":"1.5.4","author":"Ryan Day <soldair@gmail.com>","contributors":["Vincenzo Greco <greco.vincenzo@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>"],"keywords":["qr","code","canvas","qrcode"],"main":"./lib/index.js","browser":{"./lib/index.js":"./lib/browser.js","fs":false},"files":["bin","build","lib","helper"],"homepage":"http://github.com/soldair/node-qrcode","license":"MIT","scripts":{"lint":"standard","pretest":"npm run lint","test":"node --throw-deprecation test.js","build":"rollup -c","prepublish":"npm run build","browser":"node examples/clientsideserver.js"},"bin":{"qrcode":"./bin/qrcode"},"dependencies":{"dijkstrajs":"^1.0.1","pngjs":"^5.0.0","yargs":"^15.3.1"},"devDependencies":{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.1.0","@rollup/plugin-node-resolve":"^7.1.3","browserify":"^16.5.1","canvas":"^2.8.0","canvasutil":"0.0.4","colors":"^1.4.0","express":"^4.17.1","htmlparser2":"^4.1.0","rollup":"^2.6.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"^5.3.0","sinon":"^9.0.2","standard":"^16.0.4","tap":"^16.2.0"},"repository":{"type":"git","url":"git://github.com/soldair/node-qrcode.git"},"engines":{"node":">=10.13.0"},"standard":{"ignore":["build/","examples/vendors/","lib/core/regex.js"]},"_lastModified":"2025-02-08T06:56:45.034Z"}
1
+ {"name":"qrcode","description":"QRCode / 2d Barcode api with both server side and client side support using canvas","version":"1.5.4","author":"Ryan Day <soldair@gmail.com>","contributors":["Vincenzo Greco <greco.vincenzo@gmail.com>","Linus Unnebäck <linus@folkdatorn.se>"],"keywords":["qr","code","canvas","qrcode"],"main":"./lib/index.js","browser":{"./lib/index.js":"./lib/browser.js","fs":false},"files":["bin","build","lib","helper"],"homepage":"http://github.com/soldair/node-qrcode","license":"MIT","scripts":{"lint":"standard","pretest":"npm run lint","test":"node --throw-deprecation test.js","build":"rollup -c","prepublish":"npm run build","browser":"node examples/clientsideserver.js"},"bin":{"qrcode":"./bin/qrcode"},"dependencies":{"dijkstrajs":"^1.0.1","pngjs":"^5.0.0","yargs":"^15.3.1"},"devDependencies":{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@rollup/plugin-commonjs":"^11.1.0","@rollup/plugin-node-resolve":"^7.1.3","browserify":"^16.5.1","canvas":"^2.8.0","canvasutil":"0.0.4","colors":"^1.4.0","express":"^4.17.1","htmlparser2":"^4.1.0","rollup":"^2.6.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-terser":"^5.3.0","sinon":"^9.0.2","standard":"^16.0.4","tap":"^16.2.0"},"repository":{"type":"git","url":"git://github.com/soldair/node-qrcode.git"},"engines":{"node":">=10.13.0"},"standard":{"ignore":["build/","examples/vendors/","lib/core/regex.js"]},"_lastModified":"2025-02-21T02:31:25.829Z"}
@@ -66,19 +66,83 @@ var import_Processor = __toESM(require("./Processor"));
66
66
  var import_CollectionTrigger = __toESM(require("./triggers/CollectionTrigger"));
67
67
  var import_ScheduleTrigger = __toESM(require("./triggers/ScheduleTrigger"));
68
68
  class PluginWorkflowServer extends import_server.Plugin {
69
- instructions = new import_utils.Registry();
70
- triggers = new import_utils.Registry();
71
- functions = new import_utils.Registry();
72
- enabledCache = /* @__PURE__ */ new Map();
73
- ready = false;
74
- executing = null;
75
- pending = [];
76
- events = [];
77
- eventsCount = 0;
78
- loggerCache;
79
- meter = null;
80
69
  constructor(app, options) {
81
70
  super(app, options);
71
+ this.instructions = new import_utils.Registry();
72
+ this.triggers = new import_utils.Registry();
73
+ this.functions = new import_utils.Registry();
74
+ this.enabledCache = /* @__PURE__ */ new Map();
75
+ this.ready = false;
76
+ this.executing = null;
77
+ this.pending = [];
78
+ this.events = [];
79
+ this.eventsCount = 0;
80
+ this.meter = null;
81
+ this.onBeforeSave = async (instance, options) => {
82
+ const Model = instance.constructor;
83
+ if (instance.enabled) {
84
+ instance.set("current", true);
85
+ } else if (!instance.current) {
86
+ const count = await Model.count({
87
+ where: {
88
+ key: instance.key
89
+ },
90
+ transaction: options.transaction
91
+ });
92
+ if (!count) {
93
+ instance.set("current", true);
94
+ }
95
+ }
96
+ if (!instance.changed("enabled") || !instance.enabled) {
97
+ return;
98
+ }
99
+ const previous = await Model.findOne({
100
+ where: {
101
+ key: instance.key,
102
+ current: true,
103
+ id: {
104
+ [import_database.Op.ne]: instance.id
105
+ }
106
+ },
107
+ transaction: options.transaction
108
+ });
109
+ if (previous) {
110
+ await previous.update(
111
+ { enabled: false, current: null },
112
+ {
113
+ transaction: options.transaction,
114
+ hooks: false
115
+ }
116
+ );
117
+ this.toggle(previous, false);
118
+ }
119
+ };
120
+ this.prepare = async () => {
121
+ if (this.executing && this.db.options.dialect === "sqlite") {
122
+ await this.executing;
123
+ }
124
+ const event = this.events.shift();
125
+ this.eventsCount = this.events.length;
126
+ if (!event) {
127
+ this.getLogger("dispatcher").warn(`events queue is empty, no need to prepare`);
128
+ return;
129
+ }
130
+ const logger = this.getLogger(event[0].id);
131
+ logger.info(`preparing execution for event`);
132
+ try {
133
+ const execution = await this.createExecution(...event);
134
+ if (execution && !this.executing && !this.pending.length) {
135
+ this.pending.push([execution]);
136
+ }
137
+ } catch (err) {
138
+ logger.error(`failed to create execution: ${err.message}`, err);
139
+ }
140
+ if (this.events.length) {
141
+ await this.prepare();
142
+ } else {
143
+ this.dispatch();
144
+ }
145
+ };
82
146
  this.addFeature(import_Plugin8.PluginSql);
83
147
  this.addFeature(import_Plugin7.PluginRequest);
84
148
  this.addFeature(import_Plugin6.PluginParallel);
@@ -119,45 +183,6 @@ class PluginWorkflowServer extends import_server.Plugin {
119
183
  }
120
184
  return trigger.sync ?? workflow.sync;
121
185
  }
122
- onBeforeSave = async (instance, options) => {
123
- const Model = instance.constructor;
124
- if (instance.enabled) {
125
- instance.set("current", true);
126
- } else if (!instance.current) {
127
- const count = await Model.count({
128
- where: {
129
- key: instance.key
130
- },
131
- transaction: options.transaction
132
- });
133
- if (!count) {
134
- instance.set("current", true);
135
- }
136
- }
137
- if (!instance.changed("enabled") || !instance.enabled) {
138
- return;
139
- }
140
- const previous = await Model.findOne({
141
- where: {
142
- key: instance.key,
143
- current: true,
144
- id: {
145
- [import_database.Op.ne]: instance.id
146
- }
147
- },
148
- transaction: options.transaction
149
- });
150
- if (previous) {
151
- await previous.update(
152
- { enabled: false, current: null },
153
- {
154
- transaction: options.transaction,
155
- hooks: false
156
- }
157
- );
158
- this.toggle(previous, false);
159
- }
160
- };
161
186
  registerTrigger(type, trigger) {
162
187
  if (typeof trigger === "function") {
163
188
  this.triggers.register(type, new trigger(this));
@@ -221,6 +246,7 @@ class PluginWorkflowServer extends import_server.Plugin {
221
246
  "executions:list",
222
247
  "executions:get",
223
248
  "executions:cancel",
249
+ "executions:retry",
224
250
  "flow_nodes:update",
225
251
  "flow_nodes:destroy"
226
252
  ]
@@ -384,32 +410,6 @@ class PluginWorkflowServer extends import_server.Plugin {
384
410
  execution.workflow = workflow;
385
411
  return execution;
386
412
  }
387
- prepare = async () => {
388
- if (this.executing && this.db.options.dialect === "sqlite") {
389
- await this.executing;
390
- }
391
- const event = this.events.shift();
392
- this.eventsCount = this.events.length;
393
- if (!event) {
394
- this.getLogger("dispatcher").warn(`events queue is empty, no need to prepare`);
395
- return;
396
- }
397
- const logger = this.getLogger(event[0].id);
398
- logger.info(`preparing execution for event`);
399
- try {
400
- const execution = await this.createExecution(...event);
401
- if (execution && !this.executing && !this.pending.length) {
402
- this.pending.push([execution]);
403
- }
404
- } catch (err) {
405
- logger.error(`failed to create execution: ${err.message}`, err);
406
- }
407
- if (this.events.length) {
408
- await this.prepare();
409
- } else {
410
- this.dispatch();
411
- }
412
- };
413
413
  dispatch() {
414
414
  if (!this.ready) {
415
415
  this.getLogger("dispatcher").warn(`app is not ready, new dispatching will be ignored`);
@@ -463,6 +463,10 @@ class PluginWorkflowServer extends import_server.Plugin {
463
463
  try {
464
464
  await (job ? processor.resume(job) : processor.start());
465
465
  logger.info(`execution (${execution.id}) finished with status: ${execution.status}`, { execution });
466
+ if (execution.status !== 0) {
467
+ const executionDuration = execution.updatedAt.getTime() - execution.createdAt.getTime();
468
+ await execution.update({ executionCost: executionDuration }, { transaction: options.transaction });
469
+ }
466
470
  if (execution.status && execution.parentNode) {
467
471
  const { database } = execution.constructor;
468
472
  const { model } = database.getCollection("executions");
@@ -28,26 +28,14 @@ class Processor {
28
28
  constructor(execution, options) {
29
29
  this.execution = execution;
30
30
  this.options = options;
31
+ this.nodes = [];
32
+ this.nodesMap = /* @__PURE__ */ new Map();
33
+ this.jobsMap = /* @__PURE__ */ new Map();
34
+ this.jobsMapByNodeKey = {};
35
+ this.lastSavedJob = null;
31
36
  this.logger = options.plugin.getLogger(execution.workflowId);
32
37
  this.transaction = options.transaction;
33
38
  }
34
- static StatusMap = {
35
- [import_constants.JOB_STATUS.PENDING]: import_constants.EXECUTION_STATUS.STARTED,
36
- [import_constants.JOB_STATUS.RESOLVED]: import_constants.EXECUTION_STATUS.RESOLVED,
37
- [import_constants.JOB_STATUS.FAILED]: import_constants.EXECUTION_STATUS.FAILED,
38
- [import_constants.JOB_STATUS.ERROR]: import_constants.EXECUTION_STATUS.ERROR,
39
- [import_constants.JOB_STATUS.ABORTED]: import_constants.EXECUTION_STATUS.ABORTED,
40
- [import_constants.JOB_STATUS.CANCELED]: import_constants.EXECUTION_STATUS.CANCELED,
41
- [import_constants.JOB_STATUS.REJECTED]: import_constants.EXECUTION_STATUS.REJECTED,
42
- [import_constants.JOB_STATUS.RETRY_NEEDED]: import_constants.EXECUTION_STATUS.RETRY_NEEDED
43
- };
44
- logger;
45
- transaction;
46
- nodes = [];
47
- nodesMap = /* @__PURE__ */ new Map();
48
- jobsMap = /* @__PURE__ */ new Map();
49
- jobsMapByNodeKey = {};
50
- lastSavedJob = null;
51
39
  // make dual linked nodes list then cache
52
40
  makeNodes(nodes = []) {
53
41
  this.nodes = nodes;
@@ -304,3 +292,13 @@ class Processor {
304
292
  return template(scope);
305
293
  }
306
294
  }
295
+ Processor.StatusMap = {
296
+ [import_constants.JOB_STATUS.PENDING]: import_constants.EXECUTION_STATUS.STARTED,
297
+ [import_constants.JOB_STATUS.RESOLVED]: import_constants.EXECUTION_STATUS.RESOLVED,
298
+ [import_constants.JOB_STATUS.FAILED]: import_constants.EXECUTION_STATUS.FAILED,
299
+ [import_constants.JOB_STATUS.ERROR]: import_constants.EXECUTION_STATUS.ERROR,
300
+ [import_constants.JOB_STATUS.ABORTED]: import_constants.EXECUTION_STATUS.ABORTED,
301
+ [import_constants.JOB_STATUS.CANCELED]: import_constants.EXECUTION_STATUS.CANCELED,
302
+ [import_constants.JOB_STATUS.REJECTED]: import_constants.EXECUTION_STATUS.REJECTED,
303
+ [import_constants.JOB_STATUS.RETRY_NEEDED]: import_constants.EXECUTION_STATUS.RETRY_NEEDED
304
+ };
@@ -1,3 +1,4 @@
1
- import { Context } from '@tachybase/actions';
1
+ import { Context, Next } from '@tachybase/actions';
2
2
  export declare function destroy(context: Context, next: any): Promise<void>;
3
3
  export declare function cancel(context: Context, next: any): Promise<never>;
4
+ export declare function retry(context: Context, next: Next): Promise<void>;
@@ -28,12 +28,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
28
28
  var executions_exports = {};
29
29
  __export(executions_exports, {
30
30
  cancel: () => cancel,
31
- destroy: () => destroy
31
+ destroy: () => destroy,
32
+ retry: () => retry
32
33
  });
33
34
  module.exports = __toCommonJS(executions_exports);
34
35
  var import_actions = __toESM(require("@tachybase/actions"));
35
36
  var import_database = require("@tachybase/database");
36
37
  var import_constants = require("../constants");
38
+ var import_Plugin = __toESM(require("../Plugin"));
37
39
  async function destroy(context, next) {
38
40
  context.action.mergeParams({
39
41
  filter: {
@@ -58,9 +60,13 @@ async function cancel(context, next) {
58
60
  if (execution.status) {
59
61
  return context.throw(400);
60
62
  }
63
+ const cancelAt = /* @__PURE__ */ new Date();
64
+ const executionDuration = cancelAt.getTime() - execution.createdAt.getTime();
61
65
  await context.db.sequelize.transaction(async (transaction) => {
62
66
  await execution.update(
63
67
  {
68
+ executionCost: executionDuration,
69
+ updatedAt: cancelAt,
64
70
  status: import_constants.EXECUTION_STATUS.CANCELED
65
71
  },
66
72
  { transaction }
@@ -80,8 +86,48 @@ async function cancel(context, next) {
80
86
  context.body = execution;
81
87
  await next();
82
88
  }
89
+ async function retry(context, next) {
90
+ const plugin = context.app.getPlugin(import_Plugin.default);
91
+ const repository = import_actions.utils.getRepositoryFromParams(context);
92
+ const { filterByTk, filter = {}, values = {} } = context.action.params;
93
+ const WorkflowRepo = context.db.getRepository("workflows");
94
+ if (!context.state) {
95
+ context.state = {};
96
+ }
97
+ if (!context.state.messages) {
98
+ context.state.messages = [];
99
+ }
100
+ if (!filterByTk) {
101
+ context.throw(400, context.t("Execution ID is required", { ns: "workflow" }));
102
+ }
103
+ const execution = await repository.findOne({
104
+ filterByTk
105
+ });
106
+ if (!execution) {
107
+ context.throw(404, context.t("No execution records found for this workflow.", { ns: "workflow" }));
108
+ }
109
+ const workflow = await WorkflowRepo.findOne({
110
+ filterByTk: execution.workflowId,
111
+ appends: ["nodes"],
112
+ context
113
+ });
114
+ if (!workflow) {
115
+ context.throw(404, context.t("Associated workflow not found.", { ns: "workflow" }));
116
+ }
117
+ try {
118
+ const result = await plugin.trigger(workflow, execution.context, { httpContext: context });
119
+ context.app.logger.info(result);
120
+ context.state.messages.push({ message: "Execute successfully" });
121
+ context.body = { executionId: execution.id };
122
+ } catch (error) {
123
+ context.app.logger.error(`Failed to retry execution ${execution.id}: ${error.message}`);
124
+ context.throw(500, "Failed to retry execution");
125
+ }
126
+ await next();
127
+ }
83
128
  // Annotate the CommonJS export names for ESM import in node:
84
129
  0 && (module.exports = {
85
130
  cancel,
86
- destroy
131
+ destroy,
132
+ retry
87
133
  });
@@ -8,3 +8,4 @@ export declare function revision(context: Context, next: Next): Promise<void>;
8
8
  export declare function retry(context: Context, next: Next): Promise<void>;
9
9
  export declare function sync(context: Context, next: any): Promise<void>;
10
10
  export declare function trigger(ctx: Context, next: Next): Promise<void>;
11
+ export declare function moveWorkflow(ctx: Context, next: Next): Promise<void>;