@nocobase/plugin-workflow 2.2.0-beta.8 → 2.3.0-alpha.1

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 (252) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client/119.e7dbd037d52d1286.js +10 -0
  4. package/dist/client/142.fb4936d78fc80007.js +10 -0
  5. package/dist/client/159.cc9a0f2d92cab2c1.js +10 -0
  6. package/dist/client/276.69fb2aea13bc7c37.js +10 -0
  7. package/dist/client/346.66d060d37843d3d1.js +10 -0
  8. package/dist/client/382.d37fba14a6b91b0b.js +10 -0
  9. package/dist/client/394.a37310b78419ad7a.js +10 -0
  10. package/dist/client/438.6c6409d821d8c353.js +10 -0
  11. package/dist/client/509.88792f5bd054b2af.js +10 -0
  12. package/dist/client/54.d81b710f7b4c1cd5.js +10 -0
  13. package/dist/client/618.1aa6c21d0f2840cb.js +10 -0
  14. package/dist/client/635.ff6085589e23d39b.js +10 -0
  15. package/dist/client/67.56a3d15a55ab7d5c.js +10 -0
  16. package/dist/client/719.f011fde3ad54571e.js +10 -0
  17. package/dist/client/728.711fd4f1ed7d4e6a.js +10 -0
  18. package/dist/client/739.49407722fca8d236.js +10 -0
  19. package/dist/client/759.13aab01e6912ed8d.js +10 -0
  20. package/dist/client/772.1ebaef11a0ac8688.js +10 -0
  21. package/dist/client/782.47792ce10fc0d5fb.js +10 -0
  22. package/dist/client/828.6880ab21513b1968.js +10 -0
  23. package/dist/client/87.083467b89aaf3e53.js +10 -0
  24. package/dist/client/938.26493fc09ba1ccbc.js +10 -0
  25. package/dist/client/964.5ab736effd480a42.js +10 -0
  26. package/dist/client/972.dd7f074d5f12e171.js +10 -0
  27. package/dist/client/AddNodeContext.d.ts +1 -9
  28. package/dist/client/BranchContext.d.ts +2 -10
  29. package/dist/client/FlowContext.d.ts +10 -5
  30. package/dist/client/NodeClipboardContext.d.ts +12 -2
  31. package/dist/client/NodeDragContext.d.ts +14 -2
  32. package/dist/client/RemoveNodeContext.d.ts +16 -2
  33. package/dist/client/index.d.ts +1 -1
  34. package/dist/client/index.js +1 -1
  35. package/dist/client/nodeVariableUtils.d.ts +7 -6
  36. package/dist/client/nodes/calculation.d.ts +3 -75
  37. package/dist/client/nodes/condition.d.ts +7 -111
  38. package/dist/client/nodes/create.d.ts +3 -124
  39. package/dist/client/nodes/destroy.d.ts +2 -57
  40. package/dist/client/nodes/end.d.ts +2 -23
  41. package/dist/client/nodes/index.d.ts +2 -91
  42. package/dist/client/nodes/multi-conditions.d.ts +10 -48
  43. package/dist/client/nodes/output.d.ts +2 -44
  44. package/dist/client/nodes/query.d.ts +3 -255
  45. package/dist/client/nodes/update.d.ts +2 -117
  46. package/dist/client/style.d.ts +7 -27
  47. package/dist/client/triggers/collection.d.ts +3 -181
  48. package/dist/client/triggers/index.d.ts +2 -36
  49. package/dist/client/triggers/schedule/index.d.ts +8 -65
  50. package/dist/client/utils.d.ts +4 -5
  51. package/dist/client/variable.d.ts +7 -53
  52. package/dist/client-v2/119.81195bcd0d451279.js +10 -0
  53. package/dist/client-v2/142.a8c8df2a9abb43c5.js +10 -0
  54. package/dist/client-v2/159.cb221540c286cd32.js +10 -0
  55. package/dist/client-v2/276.7f746d899e221e2f.js +10 -0
  56. package/dist/client-v2/326.bdc99ad8e7590970.js +10 -0
  57. package/dist/client-v2/346.8c038b3c99d4fdc9.js +10 -0
  58. package/dist/client-v2/382.05f5482bb512b179.js +10 -0
  59. package/dist/client-v2/387.5e61d648d16dbf1b.js +10 -0
  60. package/dist/client-v2/394.515ed058e7f72797.js +10 -0
  61. package/dist/client-v2/438.b7df0416b66f8f64.js +10 -0
  62. package/dist/client-v2/513.617697f74783a611.js +10 -0
  63. package/dist/client-v2/54.d3daf06e53092726.js +10 -0
  64. package/dist/client-v2/635.14a6f21cf4f16345.js +10 -0
  65. package/dist/client-v2/677.7382807126d9621a.js +10 -0
  66. package/dist/client-v2/719.05cf070ef89a78f4.js +10 -0
  67. package/dist/client-v2/728.4e8322ff8fce87b9.js +10 -0
  68. package/dist/client-v2/739.5b60845103064f8d.js +10 -0
  69. package/dist/client-v2/759.7b162ad3adf450f1.js +10 -0
  70. package/dist/client-v2/772.8e5148d8c1518449.js +10 -0
  71. package/dist/client-v2/938.717e47af39485b29.js +10 -0
  72. package/dist/client-v2/ExecutionCanvas.d.ts +15 -0
  73. package/dist/client-v2/canvas/AddNodeContext.d.ts +35 -0
  74. package/dist/client-v2/canvas/AddNodeContext.shared.d.ts +33 -0
  75. package/dist/client-v2/canvas/AddNodeSlot.d.ts +20 -0
  76. package/dist/client-v2/canvas/Branch.d.ts +32 -0
  77. package/dist/client-v2/canvas/BranchContext.d.ts +29 -0
  78. package/dist/client-v2/canvas/BranchRenderContext.d.ts +14 -0
  79. package/dist/client-v2/canvas/CanvasContent.d.ts +20 -0
  80. package/dist/client-v2/canvas/DownstreamBranchIndex.d.ts +20 -0
  81. package/dist/client-v2/canvas/Instruction.d.ts +139 -0
  82. package/dist/{client/triggers/schedule/EndsByField.d.ts → client-v2/canvas/JobButton.d.ts} +3 -3
  83. package/dist/client-v2/canvas/Node.d.ts +38 -0
  84. package/dist/client-v2/canvas/NodeClipboardContext.d.ts +64 -0
  85. package/dist/client-v2/canvas/NodeConfigDrawer.d.ts +27 -0
  86. package/dist/client-v2/canvas/NodeDragContext.d.ts +83 -0
  87. package/dist/client-v2/canvas/RemoveNodeContext.d.ts +45 -0
  88. package/dist/client-v2/canvas/WorkflowTypedVariableInput.d.ts +16 -0
  89. package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +40 -0
  90. package/dist/client-v2/canvas/WorkflowVariableJsonTextArea.d.ts +15 -0
  91. package/dist/client-v2/canvas/WorkflowVariableTag.d.ts +22 -0
  92. package/dist/client-v2/canvas/WorkflowVariableTextArea.d.ts +18 -0
  93. package/dist/client-v2/canvas/adaptVariableOptionToMetaTree.d.ts +48 -0
  94. package/dist/client-v2/canvas/addNodeController.d.ts +70 -0
  95. package/dist/client-v2/canvas/collectionFieldOptions.d.ts +57 -0
  96. package/dist/client-v2/canvas/contexts.d.ts +86 -0
  97. package/dist/client-v2/canvas/dropImpact.d.ts +28 -0
  98. package/dist/client-v2/canvas/instructionAvailability.d.ts +26 -0
  99. package/dist/client-v2/canvas/nodeRenderDispatch.d.ts +79 -0
  100. package/dist/client-v2/canvas/nodeTree.d.ts +21 -0
  101. package/dist/client-v2/canvas/nodeVariableUtils.d.ts +14 -0
  102. package/dist/client-v2/canvas/removeNodeUtils.d.ts +31 -0
  103. package/dist/client-v2/canvas/style.d.ts +35 -0
  104. package/dist/client-v2/canvas/textAreaInsertion.d.ts +14 -0
  105. package/dist/client-v2/canvas/useWorkflowInstruction.d.ts +23 -0
  106. package/dist/client-v2/canvas/useWorkflowVariableOptions.d.ts +40 -0
  107. package/dist/client-v2/canvas/workflowVariableConverters.d.ts +13 -0
  108. package/dist/client-v2/components/Calculation.d.ts +18 -0
  109. package/dist/client-v2/components/ExecutionStatusIcon.d.ts +18 -0
  110. package/dist/{client/triggers/schedule/RepeatField.d.ts → client-v2/components/ExecutionStatusTag.d.ts} +3 -4
  111. package/dist/client-v2/components/ExecutionViewHeader.d.ts +29 -0
  112. package/dist/client-v2/components/ExecutionsDropdown.d.ts +25 -0
  113. package/dist/client-v2/components/FilterDynamicComponent.d.ts +28 -0
  114. package/dist/client-v2/components/HideVariableContext.d.ts +11 -0
  115. package/dist/client-v2/components/JobResultModal.d.ts +11 -0
  116. package/dist/client-v2/components/RadioWithTooltip.d.ts +23 -0
  117. package/dist/client-v2/components/SyncModeSelect.d.ts +16 -0
  118. package/dist/{client/triggers/schedule/OnField.d.ts → client-v2/components/SyncModeTag.d.ts} +3 -3
  119. package/dist/client-v2/components/TestRunButton.d.ts +36 -0
  120. package/dist/client-v2/components/TimeoutInput.d.ts +15 -0
  121. package/dist/client-v2/components/WorkflowCanvasHeader.d.ts +17 -0
  122. package/dist/client-v2/components/WorkflowDetailsModal.d.ts +25 -0
  123. package/dist/client-v2/components/WorkflowEnabledSwitch.d.ts +16 -0
  124. package/dist/client-v2/components/WorkflowMenu.d.ts +17 -0
  125. package/dist/client-v2/components/WorkflowRevisionsDropdown.d.ts +15 -0
  126. package/dist/client-v2/components/WorkflowVariableWrapper.d.ts +25 -0
  127. package/dist/client-v2/components/collection/AppendsSelect.d.ts +15 -0
  128. package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +24 -0
  129. package/dist/client-v2/components/collection/CollectionCascader.d.ts +15 -0
  130. package/dist/client-v2/components/collection/FieldsSelect.d.ts +16 -0
  131. package/dist/client-v2/components/collection/PaginationFields.d.ts +14 -0
  132. package/dist/client-v2/components/collection/SortFieldsInput.d.ts +19 -0
  133. package/dist/client-v2/components/collection/TriggerCollectionRecordSelect.d.ts +15 -0
  134. package/dist/client-v2/components/collection/index.d.ts +16 -0
  135. package/dist/client-v2/components/collection/utils.d.ts +42 -0
  136. package/dist/client-v2/components/formatResultForDisplay.d.ts +17 -0
  137. package/dist/client-v2/components/jobStatus.d.ts +27 -0
  138. package/dist/client-v2/components/renderEngineReference.d.ts +10 -0
  139. package/dist/client-v2/components/workflowCanvas.d.ts +41 -0
  140. package/dist/client-v2/constants.d.ts +19 -0
  141. package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +16 -0
  142. package/dist/client-v2/index.d.ts +48 -0
  143. package/dist/client-v2/index.js +10 -0
  144. package/dist/client-v2/locale.d.ts +41 -0
  145. package/dist/{client → client-v2}/models/NodeDetailsGridModel.d.ts +1 -1
  146. package/dist/{client → client-v2}/models/NodeDetailsModel.d.ts +1 -1
  147. package/dist/{client → client-v2}/models/NodeValueModel.d.ts +1 -1
  148. package/dist/{client → client-v2}/models/TaskCardCommonItemModel.d.ts +1 -1
  149. package/dist/client-v2/models/WorkflowTasksTopbarActionModel.d.ts +18 -0
  150. package/dist/{client → client-v2}/models/index.d.ts +2 -0
  151. package/dist/client-v2/models/triggerWorkflows.d.ts +43 -0
  152. package/dist/client-v2/nodes/calculation.d.ts +38 -0
  153. package/dist/client-v2/nodes/collectionNode.d.ts +29 -0
  154. package/dist/client-v2/nodes/components/calculation.d.ts +11 -0
  155. package/dist/client-v2/nodes/components/collection.d.ts +15 -0
  156. package/dist/client-v2/nodes/components/condition.d.ts +25 -0
  157. package/dist/client-v2/nodes/components/conditionShared.d.ts +20 -0
  158. package/dist/client-v2/nodes/components/create.d.ts +12 -0
  159. package/dist/client-v2/nodes/components/destroy.d.ts +12 -0
  160. package/dist/{client/triggers/schedule/ScheduleConfig.d.ts → client-v2/nodes/components/end.d.ts} +1 -1
  161. package/dist/client-v2/nodes/components/filter.d.ts +17 -0
  162. package/dist/client-v2/nodes/components/multi-conditions.d.ts +13 -0
  163. package/dist/client-v2/nodes/components/multiConditionsShared.d.ts +20 -0
  164. package/dist/client-v2/nodes/components/output.d.ts +10 -0
  165. package/dist/client-v2/nodes/components/query.d.ts +12 -0
  166. package/dist/client-v2/nodes/components/update.d.ts +12 -0
  167. package/dist/client-v2/nodes/condition.d.ts +46 -0
  168. package/dist/client-v2/nodes/create.d.ts +30 -0
  169. package/dist/client-v2/nodes/destroy.d.ts +24 -0
  170. package/dist/client-v2/nodes/end.d.ts +21 -0
  171. package/dist/client-v2/nodes/multi-conditions.d.ts +34 -0
  172. package/dist/client-v2/nodes/output.d.ts +29 -0
  173. package/dist/client-v2/nodes/query.d.ts +32 -0
  174. package/dist/client-v2/nodes/update.d.ts +25 -0
  175. package/dist/client-v2/pages/ExecutionHistoryDrawer.d.ts +13 -0
  176. package/dist/client-v2/pages/ExecutionViewPage.d.ts +10 -0
  177. package/dist/client-v2/pages/WorkflowCanvasPage.d.ts +10 -0
  178. package/dist/client-v2/pages/WorkflowCategoryTabs.d.ts +25 -0
  179. package/dist/client-v2/pages/WorkflowFormDrawer.d.ts +40 -0
  180. package/dist/client-v2/pages/WorkflowPane.d.ts +10 -0
  181. package/dist/client-v2/pages/WorkflowTasksPage.d.ts +10 -0
  182. package/dist/client-v2/plugin.d.ts +119 -0
  183. package/dist/client-v2/taskCenter.d.ts +105 -0
  184. package/dist/client-v2/triggers/ExecuteWorkflowButton.d.ts +35 -0
  185. package/dist/client-v2/triggers/TriggerConfig.d.ts +22 -0
  186. package/dist/client-v2/triggers/TriggerExecutionButton.d.ts +13 -0
  187. package/dist/client-v2/triggers/collection/CollectionConfig.d.ts +14 -0
  188. package/dist/client-v2/triggers/collection/TriggerCollectionConfig.d.ts +11 -0
  189. package/dist/client-v2/triggers/collection/constants.d.ts +28 -0
  190. package/dist/client-v2/triggers/collection/index.d.ts +40 -0
  191. package/dist/client-v2/triggers/index.d.ts +63 -0
  192. package/dist/client-v2/triggers/schedule/EndsByField.d.ts +17 -0
  193. package/dist/client-v2/triggers/schedule/OnField.d.ts +20 -0
  194. package/dist/client-v2/triggers/schedule/RepeatField.d.ts +23 -0
  195. package/dist/client-v2/triggers/schedule/ScheduleConfig.d.ts +17 -0
  196. package/dist/client-v2/triggers/schedule/ScheduleModes.d.ts +41 -0
  197. package/dist/{client → client-v2}/triggers/schedule/TriggerScheduleConfig.d.ts +1 -0
  198. package/dist/{client → client-v2}/triggers/schedule/constants.d.ts +8 -5
  199. package/dist/client-v2/triggers/schedule/index.d.ts +40 -0
  200. package/dist/client-v2/triggers/schedule/locale/Cron.zh-CN.d.ts +11 -0
  201. package/dist/client-v2/utils/contextSingleton.d.ts +9 -0
  202. package/dist/common/collections/workflows.d.ts +16 -0
  203. package/dist/common/collections/workflows.js +5 -0
  204. package/dist/common/defaultWorkflowFilter.d.ts +21 -0
  205. package/dist/common/defaultWorkflowFilter.js +38 -0
  206. package/dist/common/executionStatus.d.ts +44 -0
  207. package/dist/common/executionStatus.js +133 -0
  208. package/dist/externalVersion.js +16 -13
  209. package/dist/locale/de-DE.json +15 -1
  210. package/dist/locale/en-US.json +26 -1
  211. package/dist/locale/es-ES.json +15 -1
  212. package/dist/locale/fr-FR.json +15 -1
  213. package/dist/locale/hu-HU.json +15 -1
  214. package/dist/locale/id-ID.json +15 -1
  215. package/dist/locale/it-IT.json +15 -1
  216. package/dist/locale/ja-JP.json +15 -1
  217. package/dist/locale/ko-KR.json +15 -1
  218. package/dist/locale/nl-NL.json +15 -1
  219. package/dist/locale/pt-BR.json +15 -1
  220. package/dist/locale/ru-RU.json +15 -1
  221. package/dist/locale/tr-TR.json +15 -1
  222. package/dist/locale/uk-UA.json +15 -1
  223. package/dist/locale/vi-VN.json +15 -1
  224. package/dist/locale/zh-CN.json +25 -1
  225. package/dist/locale/zh-TW.json +21 -1
  226. package/dist/node_modules/cron-parser/package.json +1 -1
  227. package/dist/node_modules/joi/package.json +1 -1
  228. package/dist/node_modules/lru-cache/package.json +1 -1
  229. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  230. package/dist/server/Dispatcher.d.ts +3 -2
  231. package/dist/server/Dispatcher.js +59 -40
  232. package/dist/server/ExecutionTimeoutManager.js +2 -1
  233. package/dist/server/Plugin.d.ts +1 -1
  234. package/dist/server/actions/workflows.d.ts +1 -0
  235. package/dist/server/actions/workflows.js +17 -2
  236. package/dist/server/migrations/20260713000000-remove-workflow-validation.d.ts +13 -0
  237. package/dist/server/migrations/20260713000000-remove-workflow-validation.js +56 -0
  238. package/dist/server/triggers/CollectionTrigger.d.ts +1 -1
  239. package/dist/server/triggers/CollectionTrigger.js +3 -0
  240. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +1 -1
  241. package/dist/server/triggers/index.d.ts +1 -1
  242. package/dist/server/types/Workflow.d.ts +1 -0
  243. package/dist/server/utils.d.ts +1 -1
  244. package/dist/server/utils.js +14 -1
  245. package/dist/swagger/index.d.ts +1 -0
  246. package/dist/swagger/index.js +4 -2
  247. package/package.json +4 -2
  248. package/dist/client/618.c91be3f6e4d73501.js +0 -10
  249. package/dist/client/67.61e70b8b777f8638.js +0 -10
  250. package/dist/client/964.ffbf5b47ed12bbdc.js +0 -10
  251. package/dist/client/triggers/schedule/ScheduleModes.d.ts +0 -170
  252. package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -42
@@ -102,6 +102,9 @@
102
102
  "Executed at": "Executed at",
103
103
  "Executed workflow cannot be modified. Could be copied to a new version to modify.": "Executed workflow cannot be modified. Could be copied to a new version to modify.",
104
104
  "Execution history": "Execution history",
105
+ "Version ID": "Version ID",
106
+ "Parent execution ID": "Parent execution ID",
107
+ "Triggered manually": "Triggered manually",
105
108
  "Timeout settings": "逾時設定",
106
109
  "0 means unlimited. If you set any other value and the execution is still not completed when the timeout is reached, the execution plan will be terminated and the remaining nodes will not be executed. Time spent in queue is not counted; timing starts only after it first enters a processor.": "0 表示不限制,設定其他任意值在到期仍未執行完成時,執行計畫將被終止,剩餘節點不再執行。處於佇列中的執行計畫不計時,僅在首次進入處理器後開始計時。",
107
110
  "Exit when query result is null": "Exit when query result is null",
@@ -111,6 +114,7 @@
111
114
  "Failed to satisfy node configurations.": "Failed to satisfy node configurations.",
112
115
  "False": "False",
113
116
  "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.",
117
+ "Failed to save trigger": "保存觸發器失敗",
114
118
  "First condition": "First condition",
115
119
  "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.": "For user actions that require immediate feedback. Can not use asynchronous nodes in such mode, and it is not recommended to perform time-consuming operations under synchronous mode.",
116
120
  "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.": "From left to right, attempt each branch sequentially based on the configured conditions. Only branches that meet the conditions will be executed. Otherwise, the next branch will be attempted. If none of the branches meet the conditions, it can either exit the process or continue to the next node based on configuration.",
@@ -183,6 +187,7 @@
183
187
  "Scope variables": "Scope variables",
184
188
  "Seconds": "秒",
185
189
  "Select context": "Select context",
190
+ "Select field": "選擇欄位",
186
191
  "Select users": "Select users",
187
192
  "Select workflow": "Select workflow",
188
193
  "Single record": "Single record",
@@ -251,7 +256,10 @@
251
256
  "When no condition matches": "When no condition matches",
252
257
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
253
258
  "Workflow": "Workflow",
259
+ "Workflow title": "工作流名稱",
260
+ "Workflow not executed": "工作流未執行",
254
261
  "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>": "Workflow executed, the result status is <1>{{statusText}}</1><2>View the execution</2>",
262
+ "Workflow was not triggered because the current request did not meet the trigger requirements.": "目前請求未滿足觸發要求,工作流未觸發。",
255
263
  "Workflow of execution is not existed": "Workflow of execution is not existed",
256
264
  "Workflow tasks": "Workflow tasks",
257
265
  "Workflow todos": "Workflow todos",
@@ -266,5 +274,17 @@
266
274
  "Impacted dependent node variables": "引用目前節點變數的節點",
267
275
  "Keep variable references": "保留變數引用",
268
276
  "Keeping variable references requires manual adjustment, otherwise workflow may fail.": "已保留變數引用,請手動調整,否則工作流執行可能出錯。",
269
- "Failed to update node variables": "更新節點變數失敗"
277
+ "Failed to update node variables": "更新節點變數失敗",
278
+ "Unsupported node": "Unsupported node",
279
+ "This node type is not available in the new canvas yet.": "This node type is not available in the new canvas yet.",
280
+ "This node's configuration has not been migrated to the new canvas yet.": "This node's configuration has not been migrated to the new canvas yet.",
281
+ "This trigger type is not available in the new canvas yet.": "此觸發器類型尚未在新畫布中支援。",
282
+ "This trigger's configuration has not been migrated to the new canvas yet.": "此觸發器的配置尚未遷移到新畫布。",
283
+ "Node title": "Node title",
284
+ "Trigger title": "觸發器標題",
285
+ "Failed to add node": "Failed to add node",
286
+ "Failed to delete node": "Failed to delete node",
287
+ "Failed to save node": "Failed to save node",
288
+ "Failed to run": "Failed to run",
289
+ "Copied node": "Copied node"
270
290
  }
@@ -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":"2026-06-29T01:54:37.029Z"}
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":"2026-07-16T12:58:10.170Z"}
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-29T01:54:36.774Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-07-16T12:58:09.879Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/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","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-06-29T01:54:36.055Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"11.3.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","prepare":"tshy && bash scripts/build.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig ./.tshy/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","lint":"oxlint --fix src test","postsnap":"npm run lint","postlint":"npm run format"},"main":"./dist/commonjs/index.min.js","types":"./dist/commonjs/index.d.ts","tshy":{"esmDialects":["node","browser"],"exports":{"./raw":"./src/index.ts",".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"selfLink":false},"repository":{"type":"git","url":"git+ssh://git@github.com/isaacs/node-lru-cache.git"},"devDependencies":{"benchmark":"^2.1.4","esbuild":"^0.25.9","marked":"^4.2.12","mkdirp":"^3.0.1","oxlint":"^1.58.0","oxlint-tsgolint":"^0.19.0","prettier":"^3.8.1","tap":"^21.6.3","tshy":"^4.1.1","typedoc":"^0.28.18"},"license":"BlueOak-1.0.0","files":["dist"],"engines":{"node":"20 || >=22"},"exports":{"./raw":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},".":{"import":{"node":{"types":"./dist/esm/node/index.d.ts","default":"./dist/esm/node/index.min.js"},"browser":{"types":"./dist/esm/browser/index.d.ts","default":"./dist/esm/browser/index.min.js"},"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.min.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.min.js"}}},"type":"module","module":"./dist/esm/index.min.js","_lastModified":"2026-07-16T12:58:09.110Z"}
@@ -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":"2026-06-29T01:54:35.895Z"}
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":"2026-07-16T12:58:08.932Z"}
@@ -26,7 +26,7 @@ export type EventOptions = {
26
26
  force?: boolean;
27
27
  stack?: Array<number | string>;
28
28
  parentExecutionId?: number | string;
29
- onTriggerFail?: Function;
29
+ onTriggerFail?: (workflow: WorkflowModel, context: object, options: EventOptions, error?: unknown) => void | Promise<void>;
30
30
  [key: string]: any;
31
31
  } & Transactionable;
32
32
  export default class Dispatcher {
@@ -42,7 +42,7 @@ export default class Dispatcher {
42
42
  readonly onQueueExecution: QueueEventOptions['process'];
43
43
  setReady(ready: boolean): void;
44
44
  getEventsCount(): number;
45
- trigger(workflow: WorkflowModel, context: object, options?: EventOptions): void | Promise<Processor | null>;
45
+ trigger(workflow: WorkflowModel, context: object, options?: EventOptions): void | Promise<Processor | null | void>;
46
46
  private saveEvent;
47
47
  resume(job: JobModel): Promise<void>;
48
48
  start(execution: ExecutionModel): Promise<void>;
@@ -51,6 +51,7 @@ export default class Dispatcher {
51
51
  run(pending: Pending): Promise<void>;
52
52
  private triggerSync;
53
53
  private validateEvent;
54
+ private handleTriggerFail;
54
55
  private createExecution;
55
56
  private prepare;
56
57
  private acquireExecution;
@@ -54,7 +54,7 @@ class Dispatcher {
54
54
  const execution = await ExecutionRepo.findOne({
55
55
  filterByTk: event.executionId
56
56
  });
57
- if (!execution || execution.dispatched) {
57
+ if (!execution || execution.dispatched || execution.status !== import_constants.EXECUTION_STATUS.QUEUEING) {
58
58
  return;
59
59
  }
60
60
  this.plugin.getLogger(execution.workflowId).info(`execution (${execution.id}) received from queue, adding to pending list`);
@@ -71,7 +71,7 @@ class Dispatcher {
71
71
  if (!this.ready) {
72
72
  logger.warn(`app is not ready, event of workflow ${workflow.id} will be ignored`);
73
73
  logger.debug(`ignored event data:`, context);
74
- return;
74
+ return this.handleTriggerFail(workflow, context, options, new Error("app is not ready"));
75
75
  }
76
76
  if (!options.force && !options.manually && !workflow.enabled) {
77
77
  logger.warn(`workflow ${workflow.id} is not enabled, event will be ignored`);
@@ -88,7 +88,7 @@ class Dispatcher {
88
88
  }
89
89
  if (context == null) {
90
90
  logger.warn(`workflow ${workflow.id} event data context is null, event will be ignored`);
91
- return;
91
+ return this.handleTriggerFail(workflow, context, options, new Error("event context is null"));
92
92
  }
93
93
  if (options.manually || this.plugin.isWorkflowSync(workflow)) {
94
94
  return this.triggerSync(workflow, context, options);
@@ -303,8 +303,15 @@ class Dispatcher {
303
303
  }
304
304
  return valid;
305
305
  }
306
- async createExecution(workflow, context, options) {
306
+ async handleTriggerFail(workflow, context, options, error) {
307
307
  var _a;
308
+ try {
309
+ await ((_a = options.onTriggerFail) == null ? void 0 : _a.call(options, workflow, context, options, error));
310
+ } catch (triggerFailError) {
311
+ this.plugin.getLogger(workflow.id).error(`trigger failure callback failed`, { error: triggerFailError });
312
+ }
313
+ }
314
+ async createExecution(workflow, context, options) {
308
315
  const { deferred } = options;
309
316
  let stack = options.stack;
310
317
  if (options.parentExecutionId && !stack) {
@@ -313,21 +320,34 @@ class Dispatcher {
313
320
  });
314
321
  stack = parentExecution ? [...parentExecution.stack ?? [], parentExecution.id] : [];
315
322
  }
316
- const valid = await this.validateEvent(workflow, context, { ...options, stack });
323
+ let valid;
324
+ try {
325
+ valid = await this.validateEvent(workflow, context, { ...options, stack });
326
+ } catch (error) {
327
+ await this.handleTriggerFail(workflow, context, options, error);
328
+ throw error;
329
+ }
317
330
  if (!valid) {
318
- (_a = options.onTriggerFail) == null ? void 0 : _a.call(options, workflow, context, options);
319
- throw new Error("event is not valid");
320
- }
321
- const execution = await workflow.createExecution({
322
- context,
323
- key: workflow.key,
324
- eventKey: options.eventKey ?? (0, import_node_crypto.randomUUID)(),
325
- stack,
326
- parentExecutionId: options.parentExecutionId ?? null,
327
- dispatched: deferred ?? false,
328
- status: deferred ? import_constants.EXECUTION_STATUS.STARTED : import_constants.EXECUTION_STATUS.QUEUEING,
329
- manually: options.manually
330
- });
331
+ const error = new Error("event is not valid");
332
+ await this.handleTriggerFail(workflow, context, options, error);
333
+ throw error;
334
+ }
335
+ let execution;
336
+ try {
337
+ execution = await workflow.createExecution({
338
+ context,
339
+ key: workflow.key,
340
+ eventKey: options.eventKey ?? (0, import_node_crypto.randomUUID)(),
341
+ stack,
342
+ parentExecutionId: options.parentExecutionId ?? null,
343
+ dispatched: deferred ?? false,
344
+ status: deferred ? import_constants.EXECUTION_STATUS.STARTED : import_constants.EXECUTION_STATUS.QUEUEING,
345
+ manually: options.manually
346
+ });
347
+ } catch (error) {
348
+ await this.handleTriggerFail(workflow, context, options, error);
349
+ throw error;
350
+ }
331
351
  this.plugin.getLogger(workflow.id).info(`execution of workflow ${workflow.id} created as ${execution.id}`);
332
352
  if (!workflow.stats) {
333
353
  workflow.stats = await workflow.getStats();
@@ -350,8 +370,7 @@ class Dispatcher {
350
370
  const logger = input ? this.plugin.getLogger(input.workflowId) : this.plugin.getLogger("dispatcher");
351
371
  if (options.transaction) {
352
372
  try {
353
- const { execution } = await this.acquireExecution(input, options, options.transaction);
354
- return execution;
373
+ return await this.acquireExecution(input, options, options.transaction);
355
374
  } catch (error) {
356
375
  if (error instanceof Error) {
357
376
  logger.error(`entering execution failed: ${error.message}`, { error });
@@ -364,13 +383,12 @@ class Dispatcher {
364
383
  await this.acquireWithRetry(
365
384
  async () => {
366
385
  const tx = await this.plugin.db.sequelize.transaction({
367
- isolationLevel: this.plugin.db.options.dialect === "sqlite" ? void 0 : import_sequelize.Transaction.ISOLATION_LEVELS.REPEATABLE_READ
386
+ isolationLevel: this.plugin.db.options.dialect === "sqlite" ? void 0 : import_sequelize.Transaction.ISOLATION_LEVELS.READ_COMMITTED
368
387
  });
369
388
  try {
370
- const { execution, shouldRetry } = await this.acquireExecution(input, options, tx);
389
+ const execution = await this.acquireExecution(input, options, tx);
371
390
  await tx.commit();
372
391
  result = execution;
373
- return shouldRetry;
374
392
  } catch (error) {
375
393
  await tx.rollback();
376
394
  if (this.isConcurrentAcquireError(error)) {
@@ -380,7 +398,6 @@ class Dispatcher {
380
398
  logger.error(`entering execution failed: ${error.message}`, { error });
381
399
  }
382
400
  result = null;
383
- return false;
384
401
  }
385
402
  },
386
403
  {
@@ -404,10 +421,17 @@ class Dispatcher {
404
421
  await execution.reload({ transaction });
405
422
  }
406
423
  } else {
424
+ const workflowIds = [...this.plugin.enabledCache.keys()];
425
+ if (!workflowIds.length) {
426
+ this.plugin.getLogger("dispatcher").debug(`no enabled workflow to process`);
427
+ return null;
428
+ }
407
429
  execution = await this.plugin.db.getRepository("executions").findOne({
408
430
  filter: {
409
431
  dispatched: false,
410
- "workflow.enabled": true
432
+ status: import_constants.EXECUTION_STATUS.QUEUEING,
433
+ startedAt: null,
434
+ workflowId: workflowIds
411
435
  },
412
436
  sort: "id",
413
437
  transaction,
@@ -421,30 +445,24 @@ class Dispatcher {
421
445
  }
422
446
  }
423
447
  if (!execution) {
424
- return { execution: null, shouldRetry: false };
448
+ return null;
425
449
  }
426
- const entered = await this.enter(execution, transaction);
427
- const shouldRetry = !input && !entered;
428
- return { execution: entered, shouldRetry };
450
+ return this.enter(execution, transaction);
429
451
  }
430
452
  async acquireWithRetry(acquire, options) {
431
453
  for (let attempt = 1; attempt <= EXECUTION_ACQUIRE_MAX_ATTEMPTS; attempt++) {
432
- let shouldRetry = false;
433
454
  try {
434
- shouldRetry = await acquire();
455
+ await acquire();
456
+ break;
435
457
  } catch (error) {
436
458
  if (!this.isConcurrentAcquireError(error)) {
437
459
  throw error;
438
460
  }
439
- shouldRetry = true;
440
461
  options.logger.warn(options.conflictMessage, { error });
441
- }
442
- if (!shouldRetry) {
443
- break;
444
- }
445
- if (attempt >= EXECUTION_ACQUIRE_MAX_ATTEMPTS) {
446
- options.logger.warn(options.maxAttemptsMessage);
447
- break;
462
+ if (attempt >= EXECUTION_ACQUIRE_MAX_ATTEMPTS) {
463
+ options.logger.warn(options.maxAttemptsMessage);
464
+ break;
465
+ }
448
466
  }
449
467
  }
450
468
  }
@@ -529,7 +547,8 @@ class Dispatcher {
529
547
  }
530
548
  return processor;
531
549
  };
532
- const lock = await this.plugin.app.lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(execution.id), 6e4);
550
+ const lockManager = this.plugin.app.lockManager;
551
+ const lock = await lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(execution.id), 6e4);
533
552
  try {
534
553
  return await lock.runExclusive(run, 6e4);
535
554
  } catch (error) {
@@ -108,7 +108,8 @@ class ExecutionTimeoutManager {
108
108
  }
109
109
  async abortExecutionIfExpiredWithLock(executionOrId) {
110
110
  const executionId = typeof executionOrId === "object" ? executionOrId.id : executionOrId;
111
- const lock = await this.plugin.app.lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(executionId), EXECUTION_LOCK_TIMEOUT);
111
+ const lockManager = this.plugin.app.lockManager;
112
+ const lock = await lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(executionId), EXECUTION_LOCK_TIMEOUT);
112
113
  return lock.runExclusive(async () => {
113
114
  const execution = await this.plugin.db.getRepository("executions").findOne({
114
115
  filterByTk: executionId
@@ -74,7 +74,7 @@ export default class PluginWorkflowServer extends Plugin {
74
74
  */
75
75
  load(): Promise<void>;
76
76
  private toggle;
77
- trigger(workflow: WorkflowModel, context: object, options?: EventOptions): void | Promise<Processor | null>;
77
+ trigger(workflow: WorkflowModel, context: object, options?: EventOptions): void | Promise<Processor | null | void>;
78
78
  run(pending: Parameters<Dispatcher['run']>[0]): Promise<void>;
79
79
  dispatch(): void;
80
80
  resume(job: any): Promise<void>;
@@ -12,6 +12,7 @@ export declare class WorkflowValidationError extends Error {
12
12
  errors: Record<string, string>;
13
13
  constructor(errors: Record<string, string>);
14
14
  }
15
+ export declare function list(context: Context, next: any): Promise<void>;
15
16
  export declare function create(context: Context, next: any): Promise<void>;
16
17
  export declare function update(context: Context, next: any): Promise<void>;
17
18
  export declare function destroy(context: Context, next: any): Promise<void>;
@@ -40,6 +40,7 @@ __export(workflows_exports, {
40
40
  create: () => create,
41
41
  destroy: () => destroy,
42
42
  execute: () => execute,
43
+ list: () => list,
43
44
  revision: () => revision,
44
45
  sync: () => sync,
45
46
  update: () => update
@@ -72,9 +73,14 @@ function validateWorkflow(context, plugin, { type, config }) {
72
73
  }
73
74
  }
74
75
  }
76
+ async function list(context, next) {
77
+ return import_actions.default.list(context, next);
78
+ }
75
79
  async function create(context, next) {
76
80
  const plugin = context.app.pm.get(import_Plugin.default);
77
- const { values } = context.action.params;
81
+ const values = { ...context.action.params.values || {} };
82
+ delete values.invalid;
83
+ context.action.mergeParams({ values }, { values: "overwrite" });
78
84
  validateWorkflow(context, plugin, values);
79
85
  return import_actions.default.create(context, next);
80
86
  }
@@ -139,10 +145,12 @@ async function destroy(context, next) {
139
145
  async function revision(context, next) {
140
146
  const repository = import_actions.utils.getRepositoryFromParams(context);
141
147
  const { filterByTk, filter = {}, values = {} } = context.action.params;
148
+ const revisionValues = { ...values };
149
+ delete revisionValues.invalid;
142
150
  context.body = await repository.revision({
143
151
  filterByTk,
144
152
  filter,
145
- values,
153
+ values: revisionValues,
146
154
  context
147
155
  });
148
156
  await next();
@@ -184,6 +192,12 @@ async function execute(context, next) {
184
192
  let processor;
185
193
  try {
186
194
  processor = await plugin.execute(workflow, values, { manually: true });
195
+ if (processor === null) {
196
+ context.body = {
197
+ execution: null
198
+ };
199
+ return next();
200
+ }
187
201
  if (!processor) {
188
202
  return context.throw(400, "workflow not triggered");
189
203
  }
@@ -220,6 +234,7 @@ async function execute(context, next) {
220
234
  create,
221
235
  destroy,
222
236
  execute,
237
+ list,
223
238
  revision,
224
239
  sync,
225
240
  update
@@ -0,0 +1,13 @@
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
+ import { Migration } from '@nocobase/server';
10
+ export default class extends Migration {
11
+ on: string;
12
+ up(): Promise<void>;
13
+ }
@@ -0,0 +1,56 @@
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 remove_workflow_validation_exports = {};
28
+ __export(remove_workflow_validation_exports, {
29
+ default: () => remove_workflow_validation_default
30
+ });
31
+ module.exports = __toCommonJS(remove_workflow_validation_exports);
32
+ var import_server = require("@nocobase/server");
33
+ class remove_workflow_validation_default extends import_server.Migration {
34
+ on = "afterSync";
35
+ async up() {
36
+ const { db } = this.context;
37
+ const workflows = db.getCollection("workflows");
38
+ const tableInfo = workflows.getTableNameWithSchema();
39
+ await db.sequelize.transaction(async (transaction) => {
40
+ const tableExists = await this.queryInterface.tableExists(tableInfo, { transaction });
41
+ if (!tableExists) {
42
+ return;
43
+ }
44
+ const describeTable = this.queryInterface.describeTable.bind(this.queryInterface);
45
+ const columns = await describeTable(tableInfo, { transaction });
46
+ if (!columns.validation) {
47
+ return;
48
+ }
49
+ await this.queryInterface.removeColumn(tableInfo, "validation", { transaction });
50
+ if (db.sequelize.getDialect() === "sqlite") {
51
+ const syncOptions = { hooks: false, transaction };
52
+ await workflows.model.sync(syncOptions);
53
+ }
54
+ });
55
+ }
56
+ }
@@ -30,7 +30,7 @@ export default class CollectionTrigger extends Trigger {
30
30
  code?: string;
31
31
  };
32
32
  prepare(workflow: WorkflowModel, data: Model | Record<string, any> | string | number, options: any): Promise<{
33
- data: any;
33
+ data: string | number | Record<string, any> | Model<any, any>;
34
34
  }>;
35
35
  on(workflow: WorkflowModel): void;
36
36
  off(workflow: WorkflowModel): void;
@@ -305,6 +305,9 @@ class CollectionTrigger extends import__.default {
305
305
  // }
306
306
  async execute(workflow, values, options) {
307
307
  const ctx = await this.prepare(workflow, values == null ? void 0 : values.data, options);
308
+ if (!ctx) {
309
+ return null;
310
+ }
308
311
  const [dataSourceName] = (0, import_data_source_manager.parseCollectionName)(workflow.config.collection);
309
312
  const { transaction } = options;
310
313
  return this.workflow.trigger(workflow, ctx, {
@@ -20,5 +20,5 @@ export default class StaticScheduleTrigger {
20
20
  trigger(workflow: WorkflowModel, time: number): Promise<void>;
21
21
  on(workflow: any): void;
22
22
  off(workflow: any): void;
23
- execute(workflow: any, values: any, options: any): void | Promise<import("../..").Processor>;
23
+ execute(workflow: any, values: any, options: any): void | Promise<void | import("../..").Processor>;
24
24
  }
@@ -26,6 +26,6 @@ export declare abstract class Trigger {
26
26
  [key: string]: string;
27
27
  };
28
28
  sync?: boolean;
29
- execute?(workflow: WorkflowModel, values: any, options: Transactionable): void | Processor | Promise<void | Processor>;
29
+ execute?(workflow: WorkflowModel, values: any, options: Transactionable): void | Processor | null | Promise<void | Processor | null>;
30
30
  }
31
31
  export default Trigger;
@@ -19,6 +19,7 @@ export default class WorkflowModel extends Model {
19
19
  description?: string;
20
20
  type: string;
21
21
  config: any;
22
+ invalid: boolean;
22
23
  options: {
23
24
  timeout?: number;
24
25
  stackLimit?: number;
@@ -32,5 +32,5 @@ export declare function getWorkflowExecutionLogMeta(workflow: WorkflowModel, pro
32
32
  lastJobStatus: number;
33
33
  };
34
34
  export declare function abortExecution(plugin: PluginWorkflowServer, execution: ExecutionModel, options?: AbortOptions): Promise<boolean>;
35
- export declare function toJSON(data: any): any;
35
+ export declare function toJSON<T>(data: T): T;
36
36
  export {};
@@ -164,6 +164,16 @@ async function abortExecution(plugin, execution, options = {}) {
164
164
  throw error;
165
165
  }
166
166
  }
167
+ function getHiddenFieldNames(model) {
168
+ const { collection } = model.constructor;
169
+ if (!(collection == null ? void 0 : collection.fields)) {
170
+ return [];
171
+ }
172
+ return Array.from(collection.fields.values()).filter((field) => {
173
+ var _a;
174
+ return (_a = field == null ? void 0 : field.options) == null ? void 0 : _a.hidden;
175
+ }).map((field) => field.options.name).filter((name) => typeof name === "string");
176
+ }
167
177
  function toJSON(data) {
168
178
  if (Array.isArray(data)) {
169
179
  return data.map(toJSON);
@@ -171,7 +181,10 @@ function toJSON(data) {
171
181
  if (!(data instanceof import_database.Model) || !data) {
172
182
  return data;
173
183
  }
174
- const result = data.get();
184
+ const result = { ...data.get() };
185
+ for (const fieldName of getHiddenFieldNames(data)) {
186
+ delete result[fieldName];
187
+ }
175
188
  Object.keys(data.constructor.associations).forEach((key) => {
176
189
  if (result[key] != null && typeof result[key] === "object") {
177
190
  result[key] = toJSON(result[key]);
@@ -428,6 +428,7 @@ declare const _default: {
428
428
  properties: {
429
429
  execution: {
430
430
  type: string;
431
+ nullable: boolean;
431
432
  properties: {
432
433
  id: {
433
434
  type: string;
@@ -394,7 +394,8 @@ var swagger_default = {
394
394
  "**autoRevision:** When set to `1`, if the workflow has never been executed",
395
395
  "(`executed === 0`), a new revision is created automatically after execution.",
396
396
  "",
397
- "**Returns:** `{ execution: { id, status }, newVersionId? }`"
397
+ "**Returns:** `{ execution: { id, status } | null, newVersionId? }`.",
398
+ "`execution` is `null` when the request is valid but no execution is started."
398
399
  ].join("\n"),
399
400
  parameters: [
400
401
  {
@@ -433,6 +434,7 @@ var swagger_default = {
433
434
  properties: {
434
435
  execution: {
435
436
  type: "object",
437
+ nullable: true,
436
438
  properties: {
437
439
  id: { type: "integer", description: "Execution ID" },
438
440
  status: { type: "integer", description: "Execution status code" }
@@ -449,7 +451,7 @@ var swagger_default = {
449
451
  }
450
452
  },
451
453
  400: {
452
- description: "Bad Request. Request body or `filterByTk` is missing/invalid, or workflow not triggered."
454
+ description: "Bad Request. Request body or `filterByTk` is missing/invalid."
453
455
  },
454
456
  404: { description: "Not Found. Workflow does not exist." }
455
457
  }