@nocobase/plugin-workflow 1.6.10 → 1.7.0-alpha.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.
Files changed (57) hide show
  1. package/dist/client/27734873a939f873.js +10 -0
  2. package/dist/client/42a0063e6e3f5ab2.js +10 -0
  3. package/dist/client/c8053d382167e05f.js +10 -0
  4. package/dist/client/f5735dd4ea5f2180.js +10 -0
  5. package/dist/client/index.js +1 -1
  6. package/dist/client/locale/index.d.ts +2 -1
  7. package/dist/client/schemas/executions.d.ts +126 -125
  8. package/dist/common/collections/executions.d.ts +136 -0
  9. package/dist/common/collections/executions.js +125 -0
  10. package/dist/common/collections/flow_nodes.d.ts +44 -0
  11. package/dist/common/collections/flow_nodes.js +88 -0
  12. package/dist/common/collections/jobs.d.ts +26 -0
  13. package/dist/common/collections/jobs.js +67 -0
  14. package/dist/common/collections/workflowStats.d.ts +37 -0
  15. package/dist/common/collections/workflowStats.js +59 -0
  16. package/dist/common/collections/workflowTasks.d.ts +10 -0
  17. package/dist/common/collections/workflowTasks.js +64 -0
  18. package/dist/common/collections/workflowVersionStats.d.ts +37 -0
  19. package/dist/common/collections/workflowVersionStats.js +59 -0
  20. package/dist/common/collections/workflows.d.ts +250 -0
  21. package/dist/common/collections/workflows.js +225 -0
  22. package/dist/common/constants.d.ts +9 -0
  23. package/dist/common/constants.js +36 -0
  24. package/dist/externalVersion.js +13 -13
  25. package/dist/locale/nl-NL.json +100 -0
  26. package/dist/locale/zh-CN.json +4 -0
  27. package/dist/node_modules/cron-parser/package.json +1 -1
  28. package/dist/node_modules/lru-cache/package.json +1 -1
  29. package/dist/server/Plugin.js +29 -18
  30. package/dist/server/actions/nodes.js +7 -5
  31. package/dist/server/actions/workflows.js +5 -2
  32. package/dist/server/collections/executions.js +12 -44
  33. package/dist/server/collections/flow_nodes.js +12 -57
  34. package/dist/server/collections/jobs.js +12 -36
  35. package/dist/server/collections/workflowStats.d.ts +11 -0
  36. package/dist/server/collections/workflowStats.js +43 -0
  37. package/dist/server/collections/workflowTasks.d.ts +2 -1
  38. package/dist/server/collections/workflowTasks.js +12 -33
  39. package/dist/server/collections/workflowVersionStats.d.ts +11 -0
  40. package/dist/server/collections/workflowVersionStats.js +43 -0
  41. package/dist/server/collections/workflows.d.ts +2 -1
  42. package/dist/server/collections/workflows.js +12 -101
  43. package/dist/server/migrations/20250320223415-stats.d.ts +14 -0
  44. package/dist/server/migrations/20250320223415-stats.js +75 -0
  45. package/dist/server/repositories/WorkflowRepository.js +1 -2
  46. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +1 -1
  47. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +6 -6
  48. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +1 -1
  49. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +3 -3
  50. package/dist/server/types/Workflow.d.ts +0 -2
  51. package/dist/swagger/index.d.ts +0 -14
  52. package/dist/swagger/index.js +0 -14
  53. package/package.json +3 -3
  54. package/dist/client/4d75ef32f02d7285.js +0 -10
  55. package/dist/client/56ce448358002e64.js +0 -10
  56. package/dist/client/58bb427e05b600de.js +0 -10
  57. package/dist/client/739d458621edf81f.js +0 -10
@@ -0,0 +1,225 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var workflows_exports = {};
28
+ __export(workflows_exports, {
29
+ default: () => workflows_default
30
+ });
31
+ module.exports = __toCommonJS(workflows_exports);
32
+ var import_constants = require("../constants");
33
+ var workflows_default = {
34
+ dumpRules: "required",
35
+ migrationRules: ["overwrite", "schema-only"],
36
+ name: "workflows",
37
+ shared: true,
38
+ repository: "WorkflowRepository",
39
+ fields: [
40
+ {
41
+ name: "key",
42
+ type: "uid"
43
+ },
44
+ {
45
+ type: "string",
46
+ name: "title",
47
+ interface: "input",
48
+ uiSchema: {
49
+ title: '{{t("Name")}}',
50
+ type: "string",
51
+ "x-component": "Input",
52
+ required: true
53
+ }
54
+ },
55
+ {
56
+ type: "boolean",
57
+ name: "enabled",
58
+ defaultValue: false,
59
+ interface: "radioGroup",
60
+ uiSchema: {
61
+ title: `{{t("Status", { ns: "${import_constants.NAMESPACE}" })}}`,
62
+ type: "string",
63
+ enum: [
64
+ { label: `{{t("On", { ns: "${import_constants.NAMESPACE}" })}}`, value: true, color: "#52c41a" },
65
+ { label: `{{t("Off", { ns: "${import_constants.NAMESPACE}" })}}`, value: false }
66
+ ],
67
+ "x-component": "Radio.Group",
68
+ "x-decorator": "FormItem",
69
+ default: false
70
+ }
71
+ },
72
+ {
73
+ type: "text",
74
+ name: "description",
75
+ interface: "textarea",
76
+ uiSchema: {
77
+ title: '{{t("Description")}}',
78
+ type: "string",
79
+ "x-component": "Input.TextArea"
80
+ }
81
+ },
82
+ {
83
+ type: "string",
84
+ name: "type",
85
+ required: true,
86
+ interface: "select",
87
+ uiSchema: {
88
+ title: `{{t("Trigger type", { ns: "${import_constants.NAMESPACE}" })}}`,
89
+ type: "string",
90
+ "x-decorator": "FormItem",
91
+ "x-component": "Select",
92
+ enum: "{{useTriggersOptions()}}",
93
+ "x-component-props": {
94
+ optionRender: "{{TriggerOptionRender}}",
95
+ popupMatchSelectWidth: true,
96
+ listHeight: 300
97
+ },
98
+ required: true
99
+ }
100
+ },
101
+ {
102
+ type: "string",
103
+ name: "triggerTitle"
104
+ },
105
+ {
106
+ type: "jsonb",
107
+ name: "config",
108
+ required: true,
109
+ defaultValue: {}
110
+ },
111
+ {
112
+ type: "hasMany",
113
+ name: "nodes",
114
+ target: "flow_nodes",
115
+ onDelete: "CASCADE"
116
+ },
117
+ {
118
+ type: "hasMany",
119
+ name: "executions"
120
+ },
121
+ {
122
+ type: "integer",
123
+ name: "executed",
124
+ defaultValue: 0
125
+ },
126
+ {
127
+ type: "integer",
128
+ name: "allExecuted",
129
+ defaultValue: 0
130
+ },
131
+ {
132
+ type: "boolean",
133
+ name: "current"
134
+ },
135
+ {
136
+ type: "boolean",
137
+ name: "sync",
138
+ defaultValue: false,
139
+ interface: "radioGroup",
140
+ uiSchema: {
141
+ title: `{{t("Mode", { ns: "${import_constants.NAMESPACE}" })}}`,
142
+ type: "boolean",
143
+ "x-decorator": "FormItem",
144
+ "x-component": "Radio.Group",
145
+ enum: [
146
+ {
147
+ label: `{{ t("Asynchronously", { ns: "${import_constants.NAMESPACE}" }) }}`,
148
+ value: false,
149
+ color: "cyan"
150
+ },
151
+ {
152
+ label: `{{ t("Synchronously", { ns: "${import_constants.NAMESPACE}" }) }}`,
153
+ value: true,
154
+ color: "orange"
155
+ }
156
+ ],
157
+ required: true
158
+ }
159
+ },
160
+ {
161
+ type: "hasMany",
162
+ name: "revisions",
163
+ target: "workflows",
164
+ foreignKey: "key",
165
+ sourceKey: "key",
166
+ // NOTE: no constraints needed here because tricky self-referencing
167
+ constraints: false,
168
+ onDelete: "NO ACTION"
169
+ },
170
+ {
171
+ type: "jsonb",
172
+ name: "options",
173
+ defaultValue: {}
174
+ },
175
+ {
176
+ type: "hasOne",
177
+ name: "stats",
178
+ target: "workflowStats",
179
+ foreignKey: "key",
180
+ sourceKey: "key",
181
+ constraints: false,
182
+ onDelete: "CASCADE",
183
+ interface: "oho",
184
+ uiSchema: {
185
+ type: "object",
186
+ "x-component": "AssociationField",
187
+ "x-component-props": {
188
+ fieldNames: {
189
+ label: "executed",
190
+ value: "key"
191
+ }
192
+ },
193
+ "x-read-pretty": true
194
+ }
195
+ },
196
+ {
197
+ type: "hasOne",
198
+ name: "versionStats",
199
+ target: "workflowVersionStats",
200
+ foreignKey: "id",
201
+ sourceKey: "id",
202
+ constraints: false,
203
+ onDelete: "CASCADE",
204
+ interface: "oho",
205
+ uiSchema: {
206
+ type: "object",
207
+ "x-component": "AssociationField",
208
+ "x-component-props": {
209
+ fieldNames: {
210
+ label: "executed",
211
+ value: "id"
212
+ }
213
+ },
214
+ "x-read-pretty": true
215
+ }
216
+ }
217
+ ],
218
+ // NOTE: use unique index for avoiding deadlock in mysql when setCurrent
219
+ indexes: [
220
+ {
221
+ unique: true,
222
+ fields: ["key", "current"]
223
+ }
224
+ ]
225
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const NAMESPACE = "workflow";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
14
+ var __export = (target, all) => {
15
+ for (var name in all)
16
+ __defProp(target, name, { get: all[name], enumerable: true });
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") {
20
+ for (let key of __getOwnPropNames(from))
21
+ if (!__hasOwnProp.call(to, key) && key !== except)
22
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
+ }
24
+ return to;
25
+ };
26
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
+ var constants_exports = {};
28
+ __export(constants_exports, {
29
+ NAMESPACE: () => NAMESPACE
30
+ });
31
+ module.exports = __toCommonJS(constants_exports);
32
+ const NAMESPACE = "workflow";
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ NAMESPACE
36
+ });
@@ -11,24 +11,24 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "@formily/core": "2.3.0",
13
13
  "@formily/react": "2.3.0",
14
- "@nocobase/client": "1.6.10",
15
- "@nocobase/utils": "1.6.10",
16
- "antd": "5.12.8",
14
+ "@nocobase/client": "1.7.0-alpha.10",
15
+ "@nocobase/utils": "1.7.0-alpha.10",
16
+ "antd": "5.24.2",
17
17
  "@ant-design/icons": "5.6.1",
18
18
  "react-router-dom": "6.28.1",
19
19
  "react-i18next": "11.18.6",
20
20
  "lodash": "4.17.21",
21
21
  "sequelize": "6.35.2",
22
- "@nocobase/database": "1.6.10",
23
- "@nocobase/server": "1.6.10",
24
- "@nocobase/data-source-manager": "1.6.10",
25
- "@nocobase/logger": "1.6.10",
26
- "@nocobase/evaluators": "1.6.10",
27
- "@formily/antd-v5": "1.1.9",
22
+ "@nocobase/database": "1.7.0-alpha.10",
23
+ "@nocobase/server": "1.7.0-alpha.10",
24
+ "@nocobase/data-source-manager": "1.7.0-alpha.10",
25
+ "@nocobase/logger": "1.7.0-alpha.10",
26
+ "@nocobase/evaluators": "1.7.0-alpha.10",
27
+ "@formily/antd-v5": "1.2.3",
28
28
  "@formily/reactive": "2.3.0",
29
29
  "@formily/shared": "2.3.2",
30
- "@nocobase/actions": "1.6.10",
31
- "dayjs": "1.11.10",
32
- "@nocobase/plugin-workflow-test": "1.6.10",
33
- "@nocobase/test": "1.6.10"
30
+ "@nocobase/actions": "1.7.0-alpha.10",
31
+ "dayjs": "1.11.13",
32
+ "@nocobase/plugin-workflow-test": "1.7.0-alpha.10",
33
+ "@nocobase/test": "1.7.0-alpha.10"
34
34
  };
@@ -0,0 +1,100 @@
1
+ {
2
+ "Workflow": "Workflow",
3
+ "Execution history": "Execution history",
4
+ "Executed": "Executed",
5
+ "Trigger type": "Trigger type",
6
+ "Status": "Status",
7
+ "On": "Aan",
8
+ "Off": "Uit",
9
+ "Version": "Versie",
10
+ "Copy to new version": "Copy to new version",
11
+ "Duplicate": "Dupliceren",
12
+ "Loading": "Loading",
13
+ "Load failed": "Load failed",
14
+ "Trigger": "Trigger",
15
+ "Trigger variables": "Trigger variables",
16
+ "Trigger data": "Trigger data",
17
+ "Trigger time": "Trigger time",
18
+ "Triggered at": "Triggered at",
19
+ "Collection event": "Collection event",
20
+ "Trigger on": "Trigger on",
21
+ "After record added": "After record added",
22
+ "After record updated": "After record updated",
23
+ "After record added or updated": "After record added or updated",
24
+ "After record deleted": "After record deleted",
25
+ "Changed fields": "Changed fields",
26
+ "Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.": "Triggered only if one of the selected fields changes. If unselected, it means that it will be triggered when any field changes. When record is added or deleted, any field is considered to have been changed.",
27
+ "Only triggers when match conditions": "Only triggers when match conditions",
28
+ "Schedule event": "Schedule event",
29
+ "Trigger mode": "Trigger mode",
30
+ "Based on certain date": "Based on certain date",
31
+ "Based on date field of collection": "Based on date field of collection",
32
+ "Starts on": "Starts on",
33
+ "Ends on": "Ends on",
34
+ "No end": "No end",
35
+ "Exactly at": "Exactly at",
36
+ "Repeat mode": "Repeat mode",
37
+ "Repeat limit": "Repeat limit",
38
+ "No limit": "No limit",
39
+ "Seconds": "Seconds",
40
+ "Minutes": "Minutes",
41
+ "Hours": "Hours",
42
+ "Days": "Days",
43
+ "Weeks": "Weeks",
44
+ "Months": "Months",
45
+ "No repeat": "No repeat",
46
+ "Every": "Every",
47
+ "By minute": "By minute",
48
+ "By hour": "By hour",
49
+ "By day": "By day",
50
+ "By week": "By week",
51
+ "By month": "By month",
52
+ "By field": "By field",
53
+ "By custom date": "By custom date",
54
+ "Advanced": "Advanced",
55
+ "End": "End",
56
+ "Node result": "Node result",
57
+ "Constant": "Constant",
58
+ "Null": "Null",
59
+ "Boolean": "Boolean",
60
+ "String": "String",
61
+ "Operator": "Operator",
62
+ "Arithmetic calculation": "Arithmetic calculation",
63
+ "String operation": "String operation",
64
+ "Executed at": "Executed at",
65
+ "Queueing": "Queueing",
66
+ "On going": "On going",
67
+ "Succeeded": "Succeeded",
68
+ "Failed": "Failed",
69
+ "Pending": "Pending",
70
+ "Canceled": "Canceled",
71
+ "This node contains branches, deleting will also be preformed to them, are you sure?": "This node contains branches, deleting will also be preformed to them, are you sure?",
72
+ "Control": "Control",
73
+ "Collection operations": "Collection operations",
74
+ "Extended types": "Extended types",
75
+ "Node type": "Node type",
76
+ "Calculation": "Calculation",
77
+ "Configure calculation": "Configure calculation",
78
+ "Calculation result": "Calculation result",
79
+ "True": "True",
80
+ "False": "False",
81
+ "concat": "concat",
82
+ "Condition": "Voorwaarde",
83
+ "Mode": "Mode",
84
+ "Continue when \"Yes\"": "Continue when \"Yes\"",
85
+ "Branch into \"Yes\" and \"No\"": "Branch into \"Yes\" and \"No\"",
86
+ "Conditions": "Conditions",
87
+ "Create record": "Create record",
88
+ "Update record": "Record bijwerken",
89
+ "Query record": "Query record",
90
+ "Multiple records": "Multiple records",
91
+ "Please select collection first": "Please select collection first",
92
+ "Only update records matching conditions": "Only update records matching conditions",
93
+ "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
94
+ "Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
95
+ "Node in executed workflow cannot be modified": "Node in executed workflow cannot be modified",
96
+ "Can not delete": "Can not delete",
97
+ "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.",
98
+ "Maximum number of loop calls": "Maximum number of loop calls",
99
+ "If the number of loop calls is too large, there will be performance issues.": "If the number of loop calls is too large, there will be performance issues."
100
+ }
@@ -33,6 +33,10 @@
33
33
  "Auto delete history when execution is on end status": "执行结束后自动删除对应状态的历史记录",
34
34
  "Maximum number of cycling triggers": "最大循环触发次数",
35
35
  "The triggers of same workflow by some node (create, update and sub-flow etc.) more than this number will be ignored. Large number may cause performance issues. Please use with caution.": "由某个节点(创建、更新和子流程等)触发同一个工作流超过这个次数时将被忽略。设置过高的次数可能会导致性能问题,请谨慎使用。",
36
+
37
+ "Continue when disabled or upgraded": "工作流被禁用或升级到新版本继续处理在途流程",
38
+ "If checked, all nodes in-progress could continue to be processed in execution of disabled workflow. Otherwise, all nodes in-progress will be aborted automatically.": "如果选中,在途的节点在禁用或升级到新版本的工作流中将继续处理。否则将自动取消执行。",
39
+
36
40
  "Trigger": "触发器",
37
41
  "Unknown trigger": "未知触发器",
38
42
  "Workflow with unknown type will cause error. Please delete it or check plugin which provide this type.": "未知类型的工作流会导致错误,请删除或检查提供该类型的插件。",
@@ -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-03-25T07:06:49.440Z"}
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-03-27T04:34:56.815Z"}
@@ -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-03-25T07:06:49.087Z"}
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-03-27T04:34:56.431Z"}
@@ -76,6 +76,9 @@ class PluginWorkflowServer extends import_server.Plugin {
76
76
  checker = null;
77
77
  onBeforeSave = async (instance, { transaction }) => {
78
78
  const Model = instance.constructor;
79
+ if (!instance.key) {
80
+ instance.set("key", (0, import_utils.uid)());
81
+ }
79
82
  if (instance.enabled) {
80
83
  instance.set("current", true);
81
84
  }
@@ -247,15 +250,24 @@ class PluginWorkflowServer extends import_server.Plugin {
247
250
  }
248
251
  });
249
252
  db.on("workflows.beforeSave", this.onBeforeSave);
250
- db.on("workflows.afterCreate", (model, { transaction }) => {
253
+ db.on("workflows.afterCreate", async (model, { transaction }) => {
254
+ const WorkflowStatsModel = this.db.getModel("workflowStats");
255
+ const [stats, created] = await WorkflowStatsModel.findOrCreate({
256
+ where: { key: model.key },
257
+ defaults: { key: model.key },
258
+ transaction
259
+ });
260
+ model.stats = stats;
261
+ model.versionStats = await model.createVersionStats({ id: model.id }, { transaction });
251
262
  if (model.enabled) {
252
263
  this.toggle(model, true, { transaction });
253
264
  }
254
265
  });
255
- db.on(
256
- "workflows.afterUpdate",
257
- (model, { transaction }) => this.toggle(model, model.enabled, { transaction })
258
- );
266
+ db.on("workflows.afterUpdate", async (model, { transaction }) => {
267
+ model.stats = await model.getStats({ transaction });
268
+ model.versionStats = await model.getVersionStats({ transaction });
269
+ this.toggle(model, model.enabled, { transaction });
270
+ });
259
271
  db.on("workflows.afterDestroy", async (model, { transaction }) => {
260
272
  this.toggle(model, false, { transaction });
261
273
  const TaskRepo = this.db.getRepository("workflowTasks");
@@ -470,21 +482,20 @@ class PluginWorkflowServer extends import_server.Plugin {
470
482
  throw err;
471
483
  }
472
484
  this.getLogger(workflow.id).info(`execution of workflow ${workflow.id} created as ${execution.id}`);
473
- await workflow.increment(["executed", "allExecuted"], { transaction });
485
+ if (!workflow.stats) {
486
+ workflow.stats = await workflow.getStats({ transaction });
487
+ }
488
+ await workflow.stats.increment("executed", { transaction });
474
489
  if (this.db.options.dialect !== "postgres") {
475
- await workflow.reload({ transaction });
490
+ await workflow.stats.reload({ transaction });
491
+ }
492
+ if (!workflow.versionStats) {
493
+ workflow.versionStats = await workflow.getVersionStats({ transaction });
494
+ }
495
+ await workflow.versionStats.increment("executed", { transaction });
496
+ if (this.db.options.dialect !== "postgres") {
497
+ await workflow.versionStats.reload({ transaction });
476
498
  }
477
- await workflow.constructor.update(
478
- {
479
- allExecuted: workflow.allExecuted
480
- },
481
- {
482
- where: {
483
- key: workflow.key
484
- },
485
- transaction
486
- }
487
- );
488
499
  if (!sameTransaction) {
489
500
  await transaction.commit();
490
501
  }
@@ -51,7 +51,9 @@ async function create(context, next) {
51
51
  const { whitelist, blacklist, updateAssociationValues, values, associatedIndex: workflowId } = context.action.params;
52
52
  context.body = await db.sequelize.transaction(async (transaction) => {
53
53
  const workflow = await repository.getSourceModel(transaction);
54
- if (workflow.executed) {
54
+ workflow.versionStats = await workflow.getVersionStats({ transaction });
55
+ const { executed } = workflow.versionStats;
56
+ if (executed) {
55
57
  context.throw(400, "Node could not be created in executed workflow");
56
58
  }
57
59
  const instance = await repository.create({
@@ -143,9 +145,9 @@ async function destroy(context, next) {
143
145
  const instance = await repository.findOne({
144
146
  filterByTk,
145
147
  fields: [...fields, "workflowId"],
146
- appends: ["upstream", "downstream", "workflow"]
148
+ appends: ["upstream", "downstream", "workflow.versionStats.executed"]
147
149
  });
148
- if (instance.workflow.executed) {
150
+ if (instance.workflow.versionStats.executed) {
149
151
  context.throw(400, "Nodes in executed workflow could not be deleted");
150
152
  }
151
153
  await db.sequelize.transaction(async (transaction) => {
@@ -202,10 +204,10 @@ async function update(context, next) {
202
204
  context.body = await db.sequelize.transaction(async (transaction) => {
203
205
  const { workflow } = await repository.findOne({
204
206
  filterByTk,
205
- appends: ["workflow.executed"],
207
+ appends: ["workflow.versionStats.executed"],
206
208
  transaction
207
209
  });
208
- if (workflow.executed) {
210
+ if (workflow.versionStats.executed) {
209
211
  context.throw(400, "Nodes in executed workflow could not be reconfigured");
210
212
  }
211
213
  return repository.update({
@@ -53,8 +53,11 @@ async function update(context, next) {
53
53
  whitelist: ["title", "description", "enabled", "triggerTitle", "config", "options"]
54
54
  });
55
55
  if (Object.keys(values).includes("config")) {
56
- const workflow = await repository.findById(filterByTk);
57
- if (workflow.get("executed")) {
56
+ const workflow = await repository.findOne({
57
+ filterByTk,
58
+ appends: ["versionStats"]
59
+ });
60
+ if (workflow.versionStats.executed) {
58
61
  return context.throw(400, "config of executed workflow can not be updated");
59
62
  }
60
63
  }
@@ -7,9 +7,11 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
+ var __create = Object.create;
10
11
  var __defProp = Object.defineProperty;
11
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
13
  var __getOwnPropNames = Object.getOwnPropertyNames;
14
+ var __getProtoOf = Object.getPrototypeOf;
13
15
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
16
  var __export = (target, all) => {
15
17
  for (var name in all)
@@ -23,53 +25,19 @@ var __copyProps = (to, from, except, desc) => {
23
25
  }
24
26
  return to;
25
27
  };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
+ // If the importer is in node compatibility mode or this is not an ESM
30
+ // file that has been converted to a CommonJS file using a Babel-
31
+ // compatible transform (i.e. "__esModule" has not been set), then set
32
+ // "default" to the CommonJS "module.exports" for node compatibility.
33
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
+ mod
35
+ ));
26
36
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
37
  var executions_exports = {};
28
38
  __export(executions_exports, {
29
39
  default: () => executions_default
30
40
  });
31
41
  module.exports = __toCommonJS(executions_exports);
32
- var executions_default = {
33
- dumpRules: {
34
- group: "log"
35
- },
36
- migrationRules: ["schema-only"],
37
- name: "executions",
38
- shared: true,
39
- fields: [
40
- {
41
- type: "belongsTo",
42
- name: "workflow"
43
- },
44
- {
45
- type: "string",
46
- name: "key"
47
- },
48
- {
49
- type: "string",
50
- name: "eventKey",
51
- unique: true
52
- },
53
- {
54
- type: "hasMany",
55
- name: "jobs",
56
- onDelete: "CASCADE"
57
- },
58
- {
59
- type: "json",
60
- name: "context"
61
- },
62
- {
63
- type: "integer",
64
- name: "status"
65
- },
66
- {
67
- type: "json",
68
- name: "stack"
69
- },
70
- {
71
- type: "json",
72
- name: "output"
73
- }
74
- ]
75
- };
42
+ var import_executions = __toESM(require("../../common/collections/executions"));
43
+ var executions_default = import_executions.default;