@tachybase/module-workflow 0.23.41 → 0.23.48

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 (41) 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/en-US.json +2 -0
  11. package/dist/locale/zh-CN.json +10 -0
  12. package/dist/node_modules/@babel/core/package.json +1 -1
  13. package/dist/node_modules/cron-parser/package.json +1 -1
  14. package/dist/node_modules/form-data/package.json +1 -1
  15. package/dist/node_modules/jsonata/package.json +1 -1
  16. package/dist/node_modules/lru-cache/package.json +1 -1
  17. package/dist/node_modules/mime-types/package.json +1 -1
  18. package/dist/node_modules/qrcode/package.json +1 -1
  19. package/dist/server/Plugin.js +80 -76
  20. package/dist/server/Processor.js +15 -17
  21. package/dist/server/actions/executions.d.ts +2 -1
  22. package/dist/server/actions/executions.js +48 -2
  23. package/dist/server/actions/workflows.d.ts +1 -0
  24. package/dist/server/actions/workflows.js +66 -0
  25. package/dist/server/collections/executions.js +4 -0
  26. package/dist/server/features/_deprecated-json-parse/JSONParse.instruction.js +4 -1
  27. package/dist/server/features/delay/DelayInstruction.js +36 -36
  28. package/dist/server/features/interception/RequestInterceptionTrigger.js +84 -80
  29. package/dist/server/features/manual/ManualInstruction.js +1 -1
  30. package/dist/server/features/notice/plugin.js +0 -1
  31. package/dist/server/features/omni-trigger/CustomActionTrigger.js +125 -121
  32. package/dist/server/migrations/20241118104303-add-initAt.js +6 -3
  33. package/dist/server/migrations/20241206122842-add-createdBy.js +6 -3
  34. package/dist/server/migrations/20241220001154-bigInt.js +6 -3
  35. package/dist/server/triggers/CollectionTrigger.js +4 -1
  36. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +5 -5
  37. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +1 -1
  38. package/dist/server/triggers/ScheduleTrigger/index.js +2 -2
  39. package/dist/server/triggers/index.js +0 -1
  40. package/package.json +17 -17
  41. /package/dist/client/{ExecutionLink.d.ts → components/ExecutionLink.d.ts} +0 -0
@@ -24,9 +24,12 @@ var import_server = require("@tachybase/server");
24
24
  var import_sequelize = require("sequelize");
25
25
  var import_constants = require("../constants");
26
26
  class add_initAt_default extends import_server.Migration {
27
- on = "afterLoad";
28
- // 'beforeLoad' or 'afterLoad'
29
- appVersion = "<0.22.38";
27
+ constructor() {
28
+ super(...arguments);
29
+ this.on = "afterLoad";
30
+ // 'beforeLoad' or 'afterLoad'
31
+ this.appVersion = "<0.22.38";
32
+ }
30
33
  async up() {
31
34
  const result = await this.app.db.sequelize.query(
32
35
  `
@@ -22,9 +22,12 @@ __export(add_createdBy_exports, {
22
22
  module.exports = __toCommonJS(add_createdBy_exports);
23
23
  var import_server = require("@tachybase/server");
24
24
  class add_createdBy_default extends import_server.Migration {
25
- on = "afterLoad";
26
- // 'beforeLoad' or 'afterLoad'
27
- appVersion = "<0.22.59";
25
+ constructor() {
26
+ super(...arguments);
27
+ this.on = "afterLoad";
28
+ // 'beforeLoad' or 'afterLoad'
29
+ this.appVersion = "<0.22.59";
30
+ }
28
31
  async up() {
29
32
  const userRepo = this.context.db.getRepository("users");
30
33
  const workflowRepo = this.context.db.getRepository("workflows");
@@ -23,9 +23,12 @@ module.exports = __toCommonJS(bigInt_exports);
23
23
  var import_server = require("@tachybase/server");
24
24
  var import_sequelize = require("sequelize");
25
25
  class bigInt_default extends import_server.Migration {
26
- on = "afterLoad";
27
- // 'beforeLoad' or 'afterLoad'
28
- appVersion = "<0.22.86";
26
+ constructor() {
27
+ super(...arguments);
28
+ this.on = "afterLoad";
29
+ // 'beforeLoad' or 'afterLoad'
30
+ this.appVersion = "<0.22.86";
31
+ }
29
32
  async up() {
30
33
  const queryInterface = this.db.sequelize.getQueryInterface();
31
34
  await queryInterface.changeColumn("executions", "parentNode", {
@@ -116,7 +116,10 @@ async function handler(workflow, data, options) {
116
116
  }
117
117
  }
118
118
  class CollectionTrigger extends import__.default {
119
- events = /* @__PURE__ */ new Map();
119
+ constructor() {
120
+ super(...arguments);
121
+ this.events = /* @__PURE__ */ new Map();
122
+ }
120
123
  on(workflow) {
121
124
  var _a, _b;
122
125
  const { collection, mode } = workflow.config;
@@ -89,6 +89,11 @@ function getHookId(workflow, type) {
89
89
  class ScheduleTrigger {
90
90
  constructor(workflow) {
91
91
  this.workflow = workflow;
92
+ this.events = /* @__PURE__ */ new Map();
93
+ this.timer = null;
94
+ this.cache = /* @__PURE__ */ new Map();
95
+ // caching workflows in range, default to 5min
96
+ this.cacheCycle = 3e5;
92
97
  workflow.app.on("afterStart", async () => {
93
98
  if (this.timer) {
94
99
  return;
@@ -106,11 +111,6 @@ class ScheduleTrigger {
106
111
  }
107
112
  });
108
113
  }
109
- events = /* @__PURE__ */ new Map();
110
- timer = null;
111
- cache = /* @__PURE__ */ new Map();
112
- // caching workflows in range, default to 5min
113
- cacheCycle = 3e5;
114
114
  async reload() {
115
115
  const WorkflowRepo = this.workflow.app.db.getRepository("workflows");
116
116
  const workflows = await WorkflowRepo.find({
@@ -36,6 +36,7 @@ const MAX_SAFE_INTERVAL = 2147483647;
36
36
  class StaticScheduleTrigger {
37
37
  constructor(workflow) {
38
38
  this.workflow = workflow;
39
+ this.timers = /* @__PURE__ */ new Map();
39
40
  workflow.app.on("afterStart", async () => {
40
41
  const WorkflowRepo = this.workflow.app.db.getRepository("workflows");
41
42
  const workflows = await WorkflowRepo.find({
@@ -49,7 +50,6 @@ class StaticScheduleTrigger {
49
50
  }
50
51
  });
51
52
  }
52
- timers = /* @__PURE__ */ new Map();
53
53
  inspect(workflows) {
54
54
  const now = /* @__PURE__ */ new Date();
55
55
  workflows.forEach((workflow) => {
@@ -35,10 +35,10 @@ var import_DateFieldScheduleTrigger = __toESM(require("./DateFieldScheduleTrigge
35
35
  var import_StaticScheduleTrigger = __toESM(require("./StaticScheduleTrigger"));
36
36
  var import_utils = require("./utils");
37
37
  class ScheduleTrigger extends import__.default {
38
- sync = false;
39
- modes = /* @__PURE__ */ new Map();
40
38
  constructor(workflow) {
41
39
  super(workflow);
40
+ this.sync = false;
41
+ this.modes = /* @__PURE__ */ new Map();
42
42
  this.modes.set(import_utils.SCHEDULE_MODE.STATIC, new import_StaticScheduleTrigger.default(workflow));
43
43
  this.modes.set(import_utils.SCHEDULE_MODE.DATE_FIELD, new import_DateFieldScheduleTrigger.default(workflow));
44
44
  }
@@ -28,7 +28,6 @@ class Trigger {
28
28
  validateEvent(workflow, context, options) {
29
29
  return true;
30
30
  }
31
- sync;
32
31
  }
33
32
  var triggers_default = Trigger;
34
33
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/module-workflow",
3
3
  "displayName": "Workflow",
4
- "version": "0.23.41",
4
+ "version": "0.23.48",
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
  "keywords": [
7
7
  "Workflow"
@@ -35,24 +35,24 @@
35
35
  "react-js-cron": "^3.2.0",
36
36
  "react-router-dom": "6.28.1",
37
37
  "sequelize": "^6.37.5",
38
- "@tachybase/components": "0.23.41",
39
- "@tachybase/plugin-workflow-test": "0.23.41"
38
+ "@tachybase/plugin-workflow-test": "0.23.48",
39
+ "@tachybase/components": "0.23.48"
40
40
  },
41
41
  "peerDependencies": {
42
- "@tachybase/client": "0.23.41",
43
- "@tachybase/data-source": "0.23.41",
44
- "@tachybase/database": "0.23.41",
45
- "@tachybase/evaluators": "0.23.41",
46
- "@tachybase/actions": "0.23.41",
47
- "@tachybase/logger": "0.23.41",
48
- "@tachybase/module-error-handler": "0.23.41",
49
- "@tachybase/module-user": "0.23.41",
50
- "@tachybase/module-collection": "0.23.41",
51
- "@tachybase/schema": "0.23.41",
52
- "@tachybase/resourcer": "0.23.41",
53
- "@tachybase/test": "0.23.41",
54
- "@tachybase/server": "0.23.41",
55
- "@tachybase/utils": "0.23.41"
42
+ "@tachybase/actions": "0.23.48",
43
+ "@tachybase/database": "0.23.48",
44
+ "@tachybase/client": "0.23.48",
45
+ "@tachybase/evaluators": "0.23.48",
46
+ "@tachybase/logger": "0.23.48",
47
+ "@tachybase/data-source": "0.23.48",
48
+ "@tachybase/module-collection": "0.23.48",
49
+ "@tachybase/module-user": "0.23.48",
50
+ "@tachybase/resourcer": "0.23.48",
51
+ "@tachybase/module-error-handler": "0.23.48",
52
+ "@tachybase/server": "0.23.48",
53
+ "@tachybase/schema": "0.23.48",
54
+ "@tachybase/test": "0.23.48",
55
+ "@tachybase/utils": "0.23.48"
56
56
  },
57
57
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
58
58
  "displayName.zh-CN": "工作流",