@nocobase/plugin-workflow 2.2.0-alpha.7 → 2.2.0-beta.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 (240) hide show
  1. package/dist/client/618.c91be3f6e4d73501.js +10 -0
  2. package/dist/client/67.61e70b8b777f8638.js +10 -0
  3. package/dist/client/964.5e11e1820fece37b.js +10 -0
  4. package/dist/client/AddNodeContext.d.ts +9 -1
  5. package/dist/client/BranchContext.d.ts +10 -2
  6. package/dist/client/FlowContext.d.ts +5 -10
  7. package/dist/client/NodeClipboardContext.d.ts +2 -12
  8. package/dist/client/NodeDragContext.d.ts +2 -14
  9. package/dist/client/RemoveNodeContext.d.ts +2 -16
  10. package/dist/client/index.d.ts +1 -1
  11. package/dist/client/index.js +1 -1
  12. package/dist/{client-v2 → client}/models/NodeDetailsGridModel.d.ts +1 -1
  13. package/dist/{client-v2 → client}/models/NodeDetailsModel.d.ts +1 -1
  14. package/dist/{client-v2 → client}/models/NodeValueModel.d.ts +1 -1
  15. package/dist/{client-v2 → client}/models/TaskCardCommonItemModel.d.ts +1 -1
  16. package/dist/{client-v2 → client}/models/index.d.ts +0 -2
  17. package/dist/client/nodeVariableUtils.d.ts +6 -7
  18. package/dist/client/nodes/calculation.d.ts +75 -3
  19. package/dist/client/nodes/condition.d.ts +111 -7
  20. package/dist/client/nodes/create.d.ts +124 -3
  21. package/dist/client/nodes/destroy.d.ts +57 -2
  22. package/dist/client/nodes/end.d.ts +23 -2
  23. package/dist/client/nodes/index.d.ts +91 -2
  24. package/dist/client/nodes/multi-conditions.d.ts +48 -10
  25. package/dist/client/nodes/output.d.ts +44 -2
  26. package/dist/client/nodes/query.d.ts +255 -3
  27. package/dist/client/nodes/update.d.ts +117 -2
  28. package/dist/client/style.d.ts +27 -7
  29. package/dist/client/triggers/collection.d.ts +181 -3
  30. package/dist/client/triggers/index.d.ts +36 -2
  31. package/dist/{client-v2/canvas/JobButton.d.ts → client/triggers/schedule/EndsByField.d.ts} +3 -3
  32. package/dist/{client-v2/components/SyncModeTag.d.ts → client/triggers/schedule/OnField.d.ts} +3 -3
  33. package/dist/{client-v2/components/ExecutionStatusTag.d.ts → client/triggers/schedule/RepeatField.d.ts} +4 -3
  34. package/dist/{client-v2/pages/WorkflowPane.d.ts → client/triggers/schedule/ScheduleConfig.d.ts} +1 -1
  35. package/dist/client/triggers/schedule/ScheduleModes.d.ts +170 -0
  36. package/dist/{client-v2 → client}/triggers/schedule/TriggerScheduleConfig.d.ts +0 -1
  37. package/dist/{client-v2 → client}/triggers/schedule/constants.d.ts +5 -8
  38. package/dist/client/triggers/schedule/index.d.ts +65 -8
  39. package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +42 -0
  40. package/dist/client/utils.d.ts +5 -4
  41. package/dist/client/variable.d.ts +53 -7
  42. package/dist/common/collections/workflows.d.ts +0 -18
  43. package/dist/common/collections/workflows.js +0 -5
  44. package/dist/externalVersion.js +13 -16
  45. package/dist/locale/de-DE.json +1 -13
  46. package/dist/locale/en-US.json +1 -23
  47. package/dist/locale/es-ES.json +1 -13
  48. package/dist/locale/fr-FR.json +1 -13
  49. package/dist/locale/hu-HU.json +1 -13
  50. package/dist/locale/id-ID.json +1 -13
  51. package/dist/locale/it-IT.json +1 -13
  52. package/dist/locale/ja-JP.json +1 -13
  53. package/dist/locale/ko-KR.json +1 -13
  54. package/dist/locale/nl-NL.json +1 -13
  55. package/dist/locale/pt-BR.json +1 -13
  56. package/dist/locale/ru-RU.json +1 -13
  57. package/dist/locale/tr-TR.json +1 -13
  58. package/dist/locale/uk-UA.json +1 -13
  59. package/dist/locale/vi-VN.json +1 -13
  60. package/dist/locale/zh-CN.json +1 -22
  61. package/dist/locale/zh-TW.json +1 -19
  62. package/dist/node_modules/cron-parser/package.json +1 -1
  63. package/dist/node_modules/joi/package.json +1 -1
  64. package/dist/node_modules/lru-cache/package.json +1 -1
  65. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  66. package/dist/server/Dispatcher.js +1 -2
  67. package/dist/server/ExecutionTimeoutManager.js +1 -2
  68. package/dist/server/actions/workflows.d.ts +0 -1
  69. package/dist/server/actions/workflows.js +0 -5
  70. package/dist/server/types/Workflow.d.ts +0 -1
  71. package/package.json +2 -4
  72. package/client-v2.d.ts +0 -2
  73. package/client-v2.js +0 -1
  74. package/dist/client/119.e7dbd037d52d1286.js +0 -10
  75. package/dist/client/142.fb4936d78fc80007.js +0 -10
  76. package/dist/client/159.cc9a0f2d92cab2c1.js +0 -10
  77. package/dist/client/276.69fb2aea13bc7c37.js +0 -10
  78. package/dist/client/346.66d060d37843d3d1.js +0 -10
  79. package/dist/client/382.d37fba14a6b91b0b.js +0 -10
  80. package/dist/client/394.a37310b78419ad7a.js +0 -10
  81. package/dist/client/438.6c6409d821d8c353.js +0 -10
  82. package/dist/client/509.e8d543f308a5823c.js +0 -10
  83. package/dist/client/54.d81b710f7b4c1cd5.js +0 -10
  84. package/dist/client/618.1aa6c21d0f2840cb.js +0 -10
  85. package/dist/client/635.ff6085589e23d39b.js +0 -10
  86. package/dist/client/67.ea0c78153b4842ef.js +0 -10
  87. package/dist/client/719.cd8ca7c9f00584be.js +0 -10
  88. package/dist/client/728.711fd4f1ed7d4e6a.js +0 -10
  89. package/dist/client/739.49407722fca8d236.js +0 -10
  90. package/dist/client/759.13aab01e6912ed8d.js +0 -10
  91. package/dist/client/772.1ebaef11a0ac8688.js +0 -10
  92. package/dist/client/782.e058403fcb6b1750.js +0 -10
  93. package/dist/client/828.78ff0c90212276c0.js +0 -10
  94. package/dist/client/87.083467b89aaf3e53.js +0 -10
  95. package/dist/client/938.26493fc09ba1ccbc.js +0 -10
  96. package/dist/client/964.5ab736effd480a42.js +0 -10
  97. package/dist/client/972.600a190e71978122.js +0 -10
  98. package/dist/client-v2/119.81195bcd0d451279.js +0 -10
  99. package/dist/client-v2/142.fe4f9b7869876ff1.js +0 -10
  100. package/dist/client-v2/159.cb221540c286cd32.js +0 -10
  101. package/dist/client-v2/276.8ca10542a0424df3.js +0 -10
  102. package/dist/client-v2/326.bdc99ad8e7590970.js +0 -10
  103. package/dist/client-v2/346.8c038b3c99d4fdc9.js +0 -10
  104. package/dist/client-v2/382.05f5482bb512b179.js +0 -10
  105. package/dist/client-v2/387.fd0a379e808b069f.js +0 -10
  106. package/dist/client-v2/394.515ed058e7f72797.js +0 -10
  107. package/dist/client-v2/438.b7df0416b66f8f64.js +0 -10
  108. package/dist/client-v2/513.19fe2e75d7cb18f8.js +0 -10
  109. package/dist/client-v2/54.d3daf06e53092726.js +0 -10
  110. package/dist/client-v2/635.20680bb5710698d0.js +0 -10
  111. package/dist/client-v2/677.a8c841cd3c3a6f7d.js +0 -10
  112. package/dist/client-v2/719.05cf070ef89a78f4.js +0 -10
  113. package/dist/client-v2/728.4e8322ff8fce87b9.js +0 -10
  114. package/dist/client-v2/739.5b60845103064f8d.js +0 -10
  115. package/dist/client-v2/759.7b162ad3adf450f1.js +0 -10
  116. package/dist/client-v2/772.8e5148d8c1518449.js +0 -10
  117. package/dist/client-v2/938.717e47af39485b29.js +0 -10
  118. package/dist/client-v2/ExecutionCanvas.d.ts +0 -15
  119. package/dist/client-v2/canvas/AddNodeContext.d.ts +0 -35
  120. package/dist/client-v2/canvas/AddNodeContext.shared.d.ts +0 -33
  121. package/dist/client-v2/canvas/AddNodeSlot.d.ts +0 -20
  122. package/dist/client-v2/canvas/Branch.d.ts +0 -32
  123. package/dist/client-v2/canvas/BranchContext.d.ts +0 -29
  124. package/dist/client-v2/canvas/BranchRenderContext.d.ts +0 -14
  125. package/dist/client-v2/canvas/CanvasContent.d.ts +0 -20
  126. package/dist/client-v2/canvas/DownstreamBranchIndex.d.ts +0 -20
  127. package/dist/client-v2/canvas/Instruction.d.ts +0 -139
  128. package/dist/client-v2/canvas/Node.d.ts +0 -38
  129. package/dist/client-v2/canvas/NodeClipboardContext.d.ts +0 -64
  130. package/dist/client-v2/canvas/NodeConfigDrawer.d.ts +0 -27
  131. package/dist/client-v2/canvas/NodeDragContext.d.ts +0 -83
  132. package/dist/client-v2/canvas/RemoveNodeContext.d.ts +0 -45
  133. package/dist/client-v2/canvas/WorkflowTypedVariableInput.d.ts +0 -16
  134. package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +0 -40
  135. package/dist/client-v2/canvas/WorkflowVariableJsonTextArea.d.ts +0 -15
  136. package/dist/client-v2/canvas/WorkflowVariableTag.d.ts +0 -22
  137. package/dist/client-v2/canvas/WorkflowVariableTextArea.d.ts +0 -18
  138. package/dist/client-v2/canvas/adaptVariableOptionToMetaTree.d.ts +0 -48
  139. package/dist/client-v2/canvas/addNodeController.d.ts +0 -70
  140. package/dist/client-v2/canvas/collectionFieldOptions.d.ts +0 -57
  141. package/dist/client-v2/canvas/contexts.d.ts +0 -86
  142. package/dist/client-v2/canvas/dropImpact.d.ts +0 -28
  143. package/dist/client-v2/canvas/instructionAvailability.d.ts +0 -26
  144. package/dist/client-v2/canvas/nodeRenderDispatch.d.ts +0 -79
  145. package/dist/client-v2/canvas/nodeTree.d.ts +0 -21
  146. package/dist/client-v2/canvas/nodeVariableUtils.d.ts +0 -14
  147. package/dist/client-v2/canvas/removeNodeUtils.d.ts +0 -31
  148. package/dist/client-v2/canvas/style.d.ts +0 -35
  149. package/dist/client-v2/canvas/textAreaInsertion.d.ts +0 -14
  150. package/dist/client-v2/canvas/useWorkflowInstruction.d.ts +0 -23
  151. package/dist/client-v2/canvas/useWorkflowVariableOptions.d.ts +0 -40
  152. package/dist/client-v2/canvas/workflowVariableConverters.d.ts +0 -13
  153. package/dist/client-v2/components/Calculation.d.ts +0 -18
  154. package/dist/client-v2/components/ExecutionStatusIcon.d.ts +0 -18
  155. package/dist/client-v2/components/ExecutionViewHeader.d.ts +0 -29
  156. package/dist/client-v2/components/ExecutionsDropdown.d.ts +0 -25
  157. package/dist/client-v2/components/FilterDynamicComponent.d.ts +0 -27
  158. package/dist/client-v2/components/HideVariableContext.d.ts +0 -11
  159. package/dist/client-v2/components/JobResultModal.d.ts +0 -11
  160. package/dist/client-v2/components/RadioWithTooltip.d.ts +0 -23
  161. package/dist/client-v2/components/SyncModeSelect.d.ts +0 -16
  162. package/dist/client-v2/components/TestRunButton.d.ts +0 -36
  163. package/dist/client-v2/components/TimeoutInput.d.ts +0 -15
  164. package/dist/client-v2/components/WorkflowCanvasHeader.d.ts +0 -17
  165. package/dist/client-v2/components/WorkflowDetailsModal.d.ts +0 -25
  166. package/dist/client-v2/components/WorkflowEnabledSwitch.d.ts +0 -16
  167. package/dist/client-v2/components/WorkflowMenu.d.ts +0 -17
  168. package/dist/client-v2/components/WorkflowRevisionsDropdown.d.ts +0 -15
  169. package/dist/client-v2/components/WorkflowVariableWrapper.d.ts +0 -25
  170. package/dist/client-v2/components/collection/AppendsSelect.d.ts +0 -15
  171. package/dist/client-v2/components/collection/AssignedFieldsEditor.d.ts +0 -24
  172. package/dist/client-v2/components/collection/CollectionCascader.d.ts +0 -15
  173. package/dist/client-v2/components/collection/FieldsSelect.d.ts +0 -16
  174. package/dist/client-v2/components/collection/PaginationFields.d.ts +0 -14
  175. package/dist/client-v2/components/collection/SortFieldsInput.d.ts +0 -19
  176. package/dist/client-v2/components/collection/TriggerCollectionRecordSelect.d.ts +0 -15
  177. package/dist/client-v2/components/collection/index.d.ts +0 -16
  178. package/dist/client-v2/components/collection/utils.d.ts +0 -42
  179. package/dist/client-v2/components/formatResultForDisplay.d.ts +0 -17
  180. package/dist/client-v2/components/jobStatus.d.ts +0 -27
  181. package/dist/client-v2/components/renderEngineReference.d.ts +0 -10
  182. package/dist/client-v2/components/workflowCanvas.d.ts +0 -41
  183. package/dist/client-v2/constants.d.ts +0 -19
  184. package/dist/client-v2/hooks/useWorkflowRuntimePaths.d.ts +0 -16
  185. package/dist/client-v2/index.d.ts +0 -48
  186. package/dist/client-v2/index.js +0 -10
  187. package/dist/client-v2/locale.d.ts +0 -41
  188. package/dist/client-v2/models/WorkflowTasksTopbarActionModel.d.ts +0 -18
  189. package/dist/client-v2/models/triggerWorkflows.d.ts +0 -43
  190. package/dist/client-v2/nodes/calculation.d.ts +0 -38
  191. package/dist/client-v2/nodes/collectionNode.d.ts +0 -29
  192. package/dist/client-v2/nodes/components/calculation.d.ts +0 -11
  193. package/dist/client-v2/nodes/components/collection.d.ts +0 -15
  194. package/dist/client-v2/nodes/components/condition.d.ts +0 -25
  195. package/dist/client-v2/nodes/components/conditionShared.d.ts +0 -20
  196. package/dist/client-v2/nodes/components/create.d.ts +0 -12
  197. package/dist/client-v2/nodes/components/destroy.d.ts +0 -12
  198. package/dist/client-v2/nodes/components/end.d.ts +0 -10
  199. package/dist/client-v2/nodes/components/filter.d.ts +0 -17
  200. package/dist/client-v2/nodes/components/multi-conditions.d.ts +0 -13
  201. package/dist/client-v2/nodes/components/multiConditionsShared.d.ts +0 -20
  202. package/dist/client-v2/nodes/components/output.d.ts +0 -10
  203. package/dist/client-v2/nodes/components/query.d.ts +0 -12
  204. package/dist/client-v2/nodes/components/update.d.ts +0 -12
  205. package/dist/client-v2/nodes/condition.d.ts +0 -46
  206. package/dist/client-v2/nodes/create.d.ts +0 -30
  207. package/dist/client-v2/nodes/destroy.d.ts +0 -24
  208. package/dist/client-v2/nodes/end.d.ts +0 -21
  209. package/dist/client-v2/nodes/multi-conditions.d.ts +0 -34
  210. package/dist/client-v2/nodes/output.d.ts +0 -29
  211. package/dist/client-v2/nodes/query.d.ts +0 -32
  212. package/dist/client-v2/nodes/update.d.ts +0 -25
  213. package/dist/client-v2/pages/ExecutionHistoryDrawer.d.ts +0 -13
  214. package/dist/client-v2/pages/ExecutionViewPage.d.ts +0 -10
  215. package/dist/client-v2/pages/WorkflowCanvasPage.d.ts +0 -10
  216. package/dist/client-v2/pages/WorkflowCategoryTabs.d.ts +0 -25
  217. package/dist/client-v2/pages/WorkflowFormDrawer.d.ts +0 -39
  218. package/dist/client-v2/pages/WorkflowTasksPage.d.ts +0 -10
  219. package/dist/client-v2/plugin.d.ts +0 -119
  220. package/dist/client-v2/taskCenter.d.ts +0 -105
  221. package/dist/client-v2/triggers/ExecuteWorkflowButton.d.ts +0 -35
  222. package/dist/client-v2/triggers/TriggerConfig.d.ts +0 -22
  223. package/dist/client-v2/triggers/TriggerExecutionButton.d.ts +0 -13
  224. package/dist/client-v2/triggers/collection/CollectionConfig.d.ts +0 -14
  225. package/dist/client-v2/triggers/collection/TriggerCollectionConfig.d.ts +0 -11
  226. package/dist/client-v2/triggers/collection/constants.d.ts +0 -28
  227. package/dist/client-v2/triggers/collection/index.d.ts +0 -40
  228. package/dist/client-v2/triggers/index.d.ts +0 -63
  229. package/dist/client-v2/triggers/schedule/EndsByField.d.ts +0 -17
  230. package/dist/client-v2/triggers/schedule/OnField.d.ts +0 -20
  231. package/dist/client-v2/triggers/schedule/RepeatField.d.ts +0 -23
  232. package/dist/client-v2/triggers/schedule/ScheduleConfig.d.ts +0 -17
  233. package/dist/client-v2/triggers/schedule/ScheduleModes.d.ts +0 -41
  234. package/dist/client-v2/triggers/schedule/index.d.ts +0 -40
  235. package/dist/client-v2/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -11
  236. package/dist/client-v2/utils/contextSingleton.d.ts +0 -9
  237. package/dist/common/defaultWorkflowFilter.d.ts +0 -21
  238. package/dist/common/defaultWorkflowFilter.js +0 -38
  239. package/dist/common/executionStatus.d.ts +0 -44
  240. package/dist/common/executionStatus.js +0 -133
@@ -102,9 +102,6 @@
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",
108
105
  "Timeout settings": "逾時設定",
109
106
  "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 表示不限制,設定其他任意值在到期仍未執行完成時,執行計畫將被終止,剩餘節點不再執行。處於佇列中的執行計畫不計時,僅在首次進入處理器後開始計時。",
110
107
  "Exit when query result is null": "Exit when query result is null",
@@ -114,7 +111,6 @@
114
111
  "Failed to satisfy node configurations.": "Failed to satisfy node configurations.",
115
112
  "False": "False",
116
113
  "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": "保存觸發器失敗",
118
114
  "First condition": "First condition",
119
115
  "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.",
120
116
  "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.",
@@ -187,7 +183,6 @@
187
183
  "Scope variables": "Scope variables",
188
184
  "Seconds": "秒",
189
185
  "Select context": "Select context",
190
- "Select field": "選擇欄位",
191
186
  "Select users": "Select users",
192
187
  "Select workflow": "Select workflow",
193
188
  "Single record": "Single record",
@@ -256,7 +251,6 @@
256
251
  "When no condition matches": "When no condition matches",
257
252
  "Will be executed in the background as a queued task.": "Will be executed in the background as a queued task.",
258
253
  "Workflow": "Workflow",
259
- "Workflow title": "工作流名稱",
260
254
  "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>",
261
255
  "Workflow of execution is not existed": "Workflow of execution is not existed",
262
256
  "Workflow tasks": "Workflow tasks",
@@ -272,17 +266,5 @@
272
266
  "Impacted dependent node variables": "引用目前節點變數的節點",
273
267
  "Keep variable references": "保留變數引用",
274
268
  "Keeping variable references requires manual adjustment, otherwise workflow may fail.": "已保留變數引用,請手動調整,否則工作流執行可能出錯。",
275
- "Failed to update node variables": "更新節點變數失敗",
276
- "Unsupported node": "Unsupported node",
277
- "This node type is not available in the new canvas yet.": "This node type is not available in the new canvas yet.",
278
- "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.",
279
- "This trigger type is not available in the new canvas yet.": "此觸發器類型尚未在新畫布中支援。",
280
- "This trigger's configuration has not been migrated to the new canvas yet.": "此觸發器的配置尚未遷移到新畫布。",
281
- "Node title": "Node title",
282
- "Trigger title": "觸發器標題",
283
- "Failed to add node": "Failed to add node",
284
- "Failed to delete node": "Failed to delete node",
285
- "Failed to save node": "Failed to save node",
286
- "Failed to run": "Failed to run",
287
- "Copied node": "Copied node"
269
+ "Failed to update node variables": "更新節點變數失敗"
288
270
  }
@@ -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-07-09T09:54:10.400Z"}
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-09T02:56:20.804Z"}
@@ -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-07-09T09:54:10.076Z"}
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-09T02:56:20.542Z"}
@@ -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-07-09T09:54:09.237Z"}
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-09T02:56:19.824Z"}
@@ -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-07-09T09:54:09.048Z"}
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-09T02:56:19.661Z"}
@@ -527,8 +527,7 @@ class Dispatcher {
527
527
  }
528
528
  return processor;
529
529
  };
530
- const lockManager = this.plugin.app.lockManager;
531
- const lock = await lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(execution.id), 6e4);
530
+ const lock = await this.plugin.app.lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(execution.id), 6e4);
532
531
  try {
533
532
  return await lock.runExclusive(run, 6e4);
534
533
  } catch (error) {
@@ -108,8 +108,7 @@ class ExecutionTimeoutManager {
108
108
  }
109
109
  async abortExecutionIfExpiredWithLock(executionOrId) {
110
110
  const executionId = typeof executionOrId === "object" ? executionOrId.id : executionOrId;
111
- const lockManager = this.plugin.app.lockManager;
112
- const lock = await lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(executionId), EXECUTION_LOCK_TIMEOUT);
111
+ const lock = await this.plugin.app.lockManager.tryAcquire((0, import_utils.getExecutionLockKey)(executionId), EXECUTION_LOCK_TIMEOUT);
113
112
  return lock.runExclusive(async () => {
114
113
  const execution = await this.plugin.db.getRepository("executions").findOne({
115
114
  filterByTk: executionId
@@ -12,7 +12,6 @@ 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>;
16
15
  export declare function create(context: Context, next: any): Promise<void>;
17
16
  export declare function update(context: Context, next: any): Promise<void>;
18
17
  export declare function destroy(context: Context, next: any): Promise<void>;
@@ -40,7 +40,6 @@ __export(workflows_exports, {
40
40
  create: () => create,
41
41
  destroy: () => destroy,
42
42
  execute: () => execute,
43
- list: () => list,
44
43
  revision: () => revision,
45
44
  sync: () => sync,
46
45
  update: () => update
@@ -73,9 +72,6 @@ function validateWorkflow(context, plugin, { type, config }) {
73
72
  }
74
73
  }
75
74
  }
76
- async function list(context, next) {
77
- return import_actions.default.list(context, next);
78
- }
79
75
  async function create(context, next) {
80
76
  const plugin = context.app.pm.get(import_Plugin.default);
81
77
  const { values } = context.action.params;
@@ -224,7 +220,6 @@ async function execute(context, next) {
224
220
  create,
225
221
  destroy,
226
222
  execute,
227
- list,
228
223
  revision,
229
224
  sync,
230
225
  update
@@ -19,7 +19,6 @@ export default class WorkflowModel extends Model {
19
19
  description?: string;
20
20
  type: string;
21
21
  config: any;
22
- validation?: Record<string, any>;
23
22
  options: {
24
23
  timeout?: number;
25
24
  stackLimit?: number;
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "A powerful BPM tool that provides foundational support for business automation, with the capability to extend unlimited triggers and nodes.",
7
7
  "description.zh-CN": "一个强大的 BPM 工具,为业务自动化提供基础支持,并且可任意扩展更多的触发器和节点。",
8
8
  "description.ru-RU": "Мощный инструмент BPM, обеспечивающий базовую поддержку автоматизации бизнес-процессов с возможностью неограниченного расширения триггеров и узлов.",
9
- "version": "2.2.0-alpha.7",
9
+ "version": "2.2.0-beta.10",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow",
@@ -18,7 +18,6 @@
18
18
  "@formily/core": "2.x",
19
19
  "@formily/react": "2.x",
20
20
  "@types/ejs": "^3.1.1",
21
- "ahooks": "^3.7.2",
22
21
  "antd": "5.x",
23
22
  "classnames": "^2.3.1",
24
23
  "cron-parser": "4.4.0",
@@ -37,7 +36,6 @@
37
36
  "peerDependencies": {
38
37
  "@nocobase/actions": "2.x",
39
38
  "@nocobase/client": "2.x",
40
- "@nocobase/client-v2": "2.x",
41
39
  "@nocobase/database": "2.x",
42
40
  "@nocobase/evaluators": "2.x",
43
41
  "@nocobase/logger": "2.x",
@@ -51,7 +49,7 @@
51
49
  "@nocobase/test": "2.x",
52
50
  "@nocobase/utils": "2.x"
53
51
  },
54
- "gitHead": "34ba02960fca9ab0b6881d3db7040a8a64067bba",
52
+ "gitHead": "d572beec24de46df948f28db72b25303a63bf62d",
55
53
  "keywords": [
56
54
  "Workflow"
57
55
  ]
package/client-v2.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './dist/client-v2';
2
- export { default } from './dist/client-v2';
package/client-v2.js DELETED
@@ -1 +0,0 @@
1
- module.exports = require('./dist/client-v2/index.js');
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["119"],{9082:function(e,n,t){t.d(n,{ConditionCanvasComponent:function(){return b},ConditionFieldset:function(){return m},ConditionPresetFieldset:function(){return f}});var a=t(9155),l=t.n(a),r=t(2059),o=t(1611),i=t(1541),c=t(2235),s=t(5980),u=t(8101),d=t(9488);function m(){var e=(0,d.kj)();return l().createElement(l().Fragment,null,l().createElement(r.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode")},l().createElement(r.Radio.Group,{disabled:!0,options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]})),l().createElement(u.FW,{prefix:["config"]}))}function f(){var e=(0,d.kj)();return l().createElement(r.Form.Item,{name:["config","rejectOnFalse"],label:e("Mode"),rules:[{required:!0}],initialValue:!0},l().createElement(r.Radio.Group,{options:[{value:!0,label:e('Continue when "Yes"')},{value:!1,label:e('Branch into "Yes" and "No"')}]}))}function b(e){var n,t=e.data,a=(0,d.kj)(),r=(0,s.A)().styles,u=(null!=(n=(0,c.$K)())?n:{}).nodes,m=t.id,f=t.config,b=(void 0===f?{}:f).rejectOnFalse,p=(null!=u?u:[]).find(function(e){return e.upstreamId===m&&1===e.branchIndex}),E=(null!=u?u:[]).find(function(e){return e.upstreamId===m&&0===e.branchIndex});return l().createElement(i.z,{data:t},b?null:l().createElement("div",{className:r.nodeSubtreeClass},l().createElement("div",{className:r.branchBlockClass},l().createElement(o.l,{from:t,entry:E,branchIndex:0}),l().createElement(o.l,{from:t,entry:p,branchIndex:1})),l().createElement("div",{className:r.conditionClass},l().createElement("span",{style:{right:"4em"}},a("No")),l().createElement("span",{style:{left:"4em"}},a("Yes")))))}}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["142"],{693:function(e,n,t){t.d(n,{QueryFieldset:function(){return d},QueryPresetFieldset:function(){return p}});var l=t(9155),o=t.n(l),a=t(2059),r=t(2235),c=t(8198),i=t(9785),s=t(9488),u=t(5329),m=t(6855);function f(){var e=(0,s.kj)(),n=a.Form.useWatch(["config","collection"]);return n?o().createElement(o().Fragment,null,o().createElement(m.F,{collection:n,required:!1}),o().createElement(a.Form.Item,{name:["config","params","sort"],label:e("Sort")},o().createElement(c.o5,{collection:n})),o().createElement(c.uc,{pageName:["config","params","page"],pageSizeName:["config","params","pageSize"]}),o().createElement(a.Form.Item,{name:["config","params","appends"],label:e("Preload associations"),extra:e("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},o().createElement(c.Kr,{collection:n}))):null}function d(){var e,n,t=(0,s.kj)(),c=(0,r.TA)(),m=a.Form.useFormInstance(),d=[{label:(e=(0,s.kj)())("Single record"),value:!1,tooltip:e("The result will be an object of the first matching record only, or null if no matched record.")},{label:e("Multiple records"),value:!0,tooltip:e("The result will be an array containing matched records, or an empty one if no matching records. This can be used to be processed in a loop node.")}];return(0,l.useEffect)(function(){void 0===m.getFieldValue(["config","multiple"])&&m.setFieldValue(["config","multiple"],!1)},[m]),o().createElement(o().Fragment,null,o().createElement(u.F,{disabled:!!(null==c||null==(n=c.config)?void 0:n.collection),onCollectionChanged:function(){m.setFieldValue(["config","params"],{})}}),o().createElement(a.Form.Item,{name:["config","multiple"],label:t("Result type")},o().createElement(i.$,{options:d})),o().createElement(f,null),o().createElement(a.Form.Item,{name:["config","failOnEmpty"],valuePropName:"checked"},o().createElement(a.Checkbox,null,t("Exit when query result is null"))))}function p(){return o().createElement(u.F,null)}}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["159"],{3210:function(e,n,r){r.d(n,{s:function(){return i}});var t=r(5477),a=r(8275),o=r(9155),l=r.n(o);function u(){var e,n,r=(e=["\n &:after {\n content: ':';\n }\n & + a {\n margin-left: 0.25em;\n }\n "],n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}})));return u=function(){return r},r}var i=function(e,n){var r=a.evaluators.get(e);return r&&r.link?l().createElement(l().Fragment,null,l().createElement("span",{className:(0,t.css)(u())},n("Syntax references")),l().createElement("a",{href:n(r.link),target:"_blank",rel:"noreferrer"},r.label)):null}},2066:function(e,n,r){r.d(n,{CalculationFieldset:function(){return p}});var t=r(9155),a=r.n(t),o=r(2059),l=r(8275),u=r(9785),i=r(3210),c=r(5606),s=r(9488);function f(e,n,r,t,a,o,l){try{var u=e[o](l),i=u.value}catch(e){r(e);return}u.done?n(i):Promise.resolve(i).then(t,a)}function p(){var e,n=(0,s.kj)(),r=null!=(e=o.Form.useWatch(["config","engine"]))?e:"formula.js";return a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","engine"],label:n("Calculation engine"),rules:[{required:!0}],initialValue:"formula.js"},a().createElement(u.$,{options:(0,l.getOptions)()})),a().createElement(o.Form.Item,{name:["config","expression"],label:n("Calculation expression"),dependencies:[["config","engine"]],validateTrigger:["onChange","onBlur"],rules:[{required:!0},{validator:function(e,t){var a;return(a=function(){var e,a;return function(e,n){var r,t,a,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:i(0)}),u(l,"throw",{value:i(1)}),u(l,"return",{value:i(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(o=0)),o;)try{if(r=1,t&&(a=2&c[0]?t.return:c[0]?t.throw||((a=t.return)&&a.call(t),0):t.next)&&!(a=a.call(t,c[1])).done)return a;switch(t=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,t=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(a=(a=o.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){o=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(6===c[0]&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=n.call(e,o)}catch(e){c=[6,e],t=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){if(!t||!(e=l.evaluators.get(r)))return[2];a=String(t).trim().replace(/{{([^{}]+)}}/g,' "1" ');try{e.evaluate(a)}catch(e){throw Error(n("Expression syntax error"))}return[2]})},function(){var e=this,n=arguments;return new Promise(function(r,t){var o=a.apply(e,n);function l(e){f(o,r,t,l,u,"next",e)}function u(e){f(o,r,t,l,u,"throw",e)}l(void 0)})})()}}],extra:(0,i.s)(r,n)},a().createElement(c.M,null)))}}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["276"],{9671:function(e,n,t){t.d(n,{DestroyFieldset:function(){return s},DestroyPresetFieldset:function(){return f}});var l=t(9155),o=t.n(l),r=t(2059),c=t(2235),u=t(5329),i=t(6855);function a(){var e=r.Form.useWatch(["config","collection"]);return e?o().createElement(i.F,{collection:e}):null}function s(){var e,n=(0,c.TA)(),t=r.Form.useFormInstance();return o().createElement(o().Fragment,null,o().createElement(u.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){t.setFieldValue(["config","params","filter"],{})}}),o().createElement(a,null))}function f(){return o().createElement(u.F,null)}}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["346"],{3253:function(e,n,t){var r=t(9168),o=t.n(r),a=t(8433),i=t.n(a)()(o());i.push([e.id,".react-js-cron {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: flex-start;\n flex-wrap: wrap;\n}\n.react-js-cron > div,\n.react-js-cron-field {\n display: -webkit-box;\n display: -webkit-flex;\n display: -moz-box;\n display: flex;\n align-items: center;\n}\n.react-js-cron-field {\n margin-bottom: 10px;\n}\n.react-js-cron-field > span {\n margin-left: 5px;\n}\ndiv.react-js-cron-select {\n margin-left: 5px;\n}\n.react-js-cron-select.react-js-cron-select-no-prefix {\n margin-left: 0;\n}\ndiv.react-js-cron-error .react-js-cron-select .ant-select-selector {\n border-color: #ff4d4f;\n background: #fff6f6;\n}\ndiv.react-js-cron-custom-select {\n min-width: 70px;\n z-index: 1;\n}\ndiv.react-js-cron-error div.react-js-cron-custom-select {\n background: #fff6f6;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-left: 11px;\n padding-right: 30px;\n}\n.react-js-cron-read-only\n div.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector {\n padding-right: 11px;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-search {\n width: 0 !important;\n margin: 0 !important;\n}\ndiv.react-js-cron-custom-select .ant-select-selection-placeholder {\n position: static;\n top: 50%;\n right: auto;\n left: auto;\n transform: none;\n transition: none;\n opacity: 1;\n color: inherit;\n}\n.react-js-cron-week-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder,\n.react-js-cron-month-days-placeholder\n .react-js-cron-custom-select\n .ant-select-selection-placeholder {\n opacity: 0.4;\n}\n.react-js-cron-custom-select-dropdown {\n min-width: 0 !important;\n width: 170px !important;\n}\n.react-js-cron-custom-select-dropdown .rc-virtual-list {\n max-height: none !important;\n}\n.react-js-cron-custom-select-dropdown-grid .rc-virtual-list-holder-inner {\n display: grid !important;\n grid-template-columns: repeat(4, 1fr);\n}\n.react-js-cron-custom-select-dropdown-grid\n .rc-virtual-list-holder-inner\n .ant-select-item-option-content {\n text-align: center;\n}\n.react-js-cron-custom-select-dropdown-hours-twelve-hour-clock {\n width: 260px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large {\n width: 300px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-large\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(7, 1fr);\n}\n.react-js-cron-custom-select-dropdown-minutes-medium {\n width: 215px !important;\n}\n.react-js-cron-custom-select-dropdown-minutes-medium\n .rc-virtual-list-holder-inner {\n grid-template-columns: repeat(5, 1fr);\n}\n.react-js-cron-period > span:first-child {\n margin-left: 0 !important;\n}\n.react-js-cron-period\n .react-js-cron-select.ant-select-single.ant-select-open\n .ant-select-selection-item {\n opacity: 1;\n}\n.react-js-cron-select-dropdown-period {\n min-width: 0 !important;\n width: auto !important;\n}\n.react-js-cron-clear-button {\n margin-left: 10px;\n margin-bottom: 10px;\n}\n.react-js-cron-disabled .react-js-cron-select.ant-select-disabled {\n background: #f5f5f5;\n}\ndiv.react-js-cron-select.react-js-cron-custom-select.ant-select\n div.ant-select-selector\n > .ant-select-selection-overflow {\n align-items: center;\n flex: initial;\n}\n",""]),n.A=i},2837:function(e,n,t){t.d(n,{l4:function(){return E}});var r=t(2295),o=t(2059),a=t(9155),i=function(){return(i=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function l(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function c(e,n,t){if(t||2==arguments.length)for(var r,o=0,a=n.length;o<a;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var s=[{name:"@yearly",value:"0 0 1 1 *"},{name:"@annually",value:"0 0 1 1 *"},{name:"@monthly",value:"0 0 1 * *"},{name:"@weekly",value:"0 0 * * 0"},{name:"@daily",value:"0 0 * * *"},{name:"@midnight",value:"0 0 * * *"},{name:"@hourly",value:"0 * * * *"}],u=[{type:"minutes",min:0,max:59,total:60},{type:"hours",min:0,max:23,total:24},{type:"month-days",min:1,max:31,total:31},{type:"months",min:1,max:12,total:12,alt:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{type:"week-days",min:0,max:6,total:7,alt:["SUN","MON","TUE","WED","THU","FRI","SAT"]}],d={everyText:"every",emptyMonths:"every month",emptyMonthDays:"every day of the month",emptyMonthDaysShort:"day of the month",emptyWeekDays:"every day of the week",emptyWeekDaysShort:"day of the week",emptyHours:"every hour",emptyMinutes:"every minute",emptyMinutesForHourPeriod:"every",yearOption:"year",monthOption:"month",weekOption:"week",dayOption:"day",hourOption:"hour",minuteOption:"minute",rebootOption:"reboot",prefixPeriod:"Every",prefixMonths:"in",prefixMonthDays:"on",prefixWeekDays:"on",prefixWeekDaysForMonthAndYearPeriod:"and",prefixHours:"at",prefixMinutes:":",prefixMinutesForHourPeriod:"at",suffixMinutesForHourPeriod:"minute(s)",errorInvalidCron:"Invalid cron expression",clearButtonText:"Clear",weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],altWeekDays:["SUN","MON","TUE","WED","THU","FRI","SAT"],altMonths:["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]};function p(e,n){for(var t=[],r=e;r<=n;r++)t.push(r);return t}function m(e){return e.sort(function(e,n){return e-n}),e}function f(e){var n=[];return e.forEach(function(e){0>n.indexOf(e)&&n.push(e)}),n}function h(e){return Object.entries(e).filter(function(e){var n=e[0],t=e[1];return n&&t}).map(function(e){return e[0]}).join(" ")}function y(e,n){e&&e({type:"invalid_cron",description:n.errorInvalidCron||d.errorInvalidCron})}function v(e){var n=parseInt(e,10),t=Number(e);return n===t?t:NaN}function g(e,n,t,r,o,a,i,l,c,d,h,g,b,x){t&&t(void 0),n(!1);var j=!1;if(!e){if("always"===r||a&&"for-default-value"===r)return;j=!0}if(!j){if(l&&(!0===l||l.includes(e))){if("@reboot"===e)return void x("reboot");var w=s.find(function(n){return n.name===e});w&&(e=w.value)}try{var M=function(e){if("string"!=typeof e)throw Error("Invalid cron string");var n=e.replace(/\s+/g," ").trim().split(" ");if(5===n.length)return n.map(function(e,n){var t=u[n];if("*"===e||"*/1"===e)return[];var r=m(f(k((function(e,n,t){if(t){e=e.toUpperCase();for(var r=0;r<t.length;r++)e=e.replace(t[r],"".concat(r+n))}return e})(e,t.min,t.alt).split(",").map(function(n){var r,o=n.split("/");if(o.length>2)throw Error('Invalid value "'.concat(e,' for "').concat(t.type,'"'));var a=o[0],i=o[1];r="*"===a?p(t.min,t.max):function(e,n,t){var r=e.split("-");if(1===r.length){var o=v(r[0]);if(isNaN(o))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));return[o]}if(2===r.length){var a=v(r[0]),i=v(r[1]);if(isNaN(a)||isNaN(i))throw Error('Invalid value "'.concat(n,'" for ').concat(t.type));if(i<a)throw Error('Max range is less than min range in "'.concat(e,'" for ').concat(t.type));return p(a,i)}throw Error('Invalid value "'.concat(e,'" for ').concat(t.type))}(a,e,t);var l=function(e,n){if(void 0!==e){var t=v(e);if(isNaN(t)||t<1)throw Error('Invalid interval step value "'.concat(e,'" for ').concat(n.type));return t}}(i,t),c=r,s=l;if(s){var u=c[0];c=c.filter(function(e){return e%s==u%s||e===u})}return c}).flat(),t))),o=O(r,t);if(void 0!==o)throw Error('Value "'.concat(o,'" out of range for ').concat(t.type));return r.length===t.total?[]:r});throw Error("Invalid cron string format")}(e),N=M[3].length>0?"year":M[2].length>0?"month":M[4].length>0?"week":M[1].length>0?"day":M[0].length>0?"hour":"minute";x(N),c(M[0]),d(M[1]),h(M[2]),g(M[3]),b(M[4])}catch(e){j=!0}}j&&(o.current=e,n(!0),y(t,i))}function b(e,n,t,r,o,a,i){return"reboot"===e?"@reboot":["minute"!==e&&a?a:[],"minute"!==e&&"hour"!==e&&o?o:[],("year"===e||"month"===e)&&t?t:[],"year"===e&&n?n:[],("year"===e||"month"===e||"week"===e)&&r?r:[]].map(function(e,n){var t=u[n];return x(w(e,t),t,i)}).join(" ")}function x(e,n,t,r,o){var a="";if(e.length===n.max-n.min+1||0===e.length)a="*";else{var i,l,c,s,u,d=function(e){if(e.length>2){var n=e[1]-e[0];if(n>1)return n}}(e);a=d&&function(e,n){for(var t=1;t<e.length;t++){var r=e[t-1];if(e[t]-r!==n)return!1}return!0}(e,d)?(i=e[0],l=M(e),c=e.length===(l-i)/d+1,i===n.min&&l+d>n.max&&c||0)?"*/".concat(d):"".concat(j(e[0],n,t,r,o),"-").concat(j(M(e),n,t,r,o),"/").concat(d):(s=[],u=null,e.forEach(function(e,n,t){e!==t[n+1]-1?null!==u?(s.push([u,e]),u=null):s.push(e):null===u&&(u=e)}),s).map(function(e){return Array.isArray(e)?"".concat(j(e[0],n,t,r,o),"-").concat(j(e[1],n,t,r,o)):j(e,n,t,r,o)}).join(",")}return a}function j(e,n,t,r,o){var a=e.toString(),i=n.type,l=n.alt,c=n.min,s=r&&(!0===r||r.includes(i)),u="24-hour-clock"===o&&("hours"===i||"minutes"===i);if(t&&"week-days"===i||t&&"months"===i?a=l[e-c]:e<10&&(s||u)&&(a=a.padStart(2,"0")),"hours"===i&&"12-hour-clock"===o){var d=e>=12?"PM":"AM",p=e%12||12;p<10&&s&&(p=p.toString().padStart(2,"0")),a="".concat(p).concat(d)}return a}function w(e,n){var t=m(f(k(e,n)));if(0===t.length)return t;var r=O(t,n);if(void 0!==r)throw Error('Value "'.concat(r,'" out of range for ').concat(n.type));return t}function k(e,n){return"week-days"===n.type&&(e=e.map(function(e){return 7===e?0:e})),e}function O(e,n){var t=e[0],r=e[e.length-1];return t<n.min?t:r>n.max?r:void 0}function M(e){return e[e.length-1]}function N(e){var n=e.value,t=e.grid,s=void 0===t||t,u=e.optionsList,p=e.setValue,f=e.locale,y=e.className,v=e.humanizeLabels,g=e.disabled,b=e.readOnly,k=e.leadingZero,O=e.clockFormat,M=e.period,N=e.unit,D=e.periodicityOnDoubleClick,S=e.mode,C=l(e,["value","grid","optionsList","setValue","locale","className","humanizeLabels","disabled","readOnly","leadingZero","clockFormat","period","unit","periodicityOnDoubleClick","mode"]),A=(0,a.useMemo)(function(){if(n&&Array.isArray(n))return n.map(function(e){return e.toString()})},[n]),P=(0,a.useMemo)(function(){return u?u.map(function(e,n){return{value:(0===N.min?n:n+1).toString(),label:e}}):c([],Array(N.total),!0).map(function(e,n){var t=0===N.min?n:n+1;return{value:t.toString(),label:j(t,N,v,k,O)}})},[u,k,v,O]),F=JSON.stringify(f),E=(0,a.useCallback)(function(e){var t=e.value;if(!n||n[0]!==Number(t))return(0,r.jsx)(r.Fragment,{});var o=x(w(n,N),N,v,k,O),a=o.match(/^\*\/([0-9]+),?/)||[];return(0,r.jsx)("div",{children:a[1]?"".concat(f.everyText||d.everyText," ").concat(a[1]):o})},[n,F,v,k,O]),V=(0,a.useCallback)(function(e){var t=Array.isArray(e)?m(e):[e],r=t;n&&(r="single"===S?[]:c([],n,!0),t.forEach(function(e){var t=Number(e);r=n.some(function(e){return e===t})?r.filter(function(e){return e!==t}):m(c(c([],r,!0),[t],!1))})),r.length===N.total?p([]):p(r)},[p,n]),T=(0,a.useCallback)(function(e){if(0!==e&&1!==e){for(var t=N.total+N.min,r=[],o=N.min;o<t;o++)o%e==0&&r.push(o);var a=n&&r&&n.length===r.length&&n.every(function(e,n){return e===r[n]});p(r.length===P.length||a?[]:r)}else p([])},[n,P,p]),W=(0,a.useRef)([]),H=(0,a.useCallback)(function(e){if(!b){var n=W.current;n.push({time:(new Date).getTime(),value:Number(e)});var t=window.setTimeout(function(){D&&n.length>1&&n[n.length-1].time-n[n.length-2].time<300?n[n.length-1].value===n[n.length-2].value?T(Number(e)):V([n[n.length-2].value,n[n.length-1].value]):V(Number(e)),W.current=[]},300);return function(){window.clearTimeout(t)}}},[W,V,T,b,D]),I=(0,a.useCallback)(function(){b||p([])},[p,b]),J=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-custom-select":!0})["".concat(y,"-select")]=!!y,e))},[y]),L=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0})["react-js-cron-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown"]=!0,e["react-js-cron-custom-select-dropdown-".concat(N.type)]=!0,e["react-js-cron-custom-select-dropdown-minutes-large"]="minutes"===N.type&&"hour"!==M&&"day"!==M,e["react-js-cron-custom-select-dropdown-minutes-medium"]="minutes"===N.type&&("day"===M||"hour"===M),e["react-js-cron-custom-select-dropdown-hours-twelve-hour-clock"]="hours"===N.type&&"12-hour-clock"===O,e["react-js-cron-custom-select-dropdown-grid"]=!!s,e["".concat(y,"-select-dropdown")]=!!y,e["".concat(y,"-select-dropdown-").concat(N.type)]=!!y,e))},[y,s,O,M]);return(0,r.jsx)(o.Select,i({mode:"single"!==S||D?"multiple":void 0,allowClear:!b,virtual:!1,open:!b&&void 0,value:A,onClear:I,tagRender:E,className:J,popupClassName:L,options:P,showSearch:!1,showArrow:!b,menuItemSelectedIcon:null,dropdownMatchSelectWidth:!1,onSelect:H,onDeselect:H,disabled:g,dropdownAlign:"minutes"!==N.type&&"hours"!==N.type||"day"===M||"hour"===M?void 0:{points:["tr","br"]},"data-testid":"custom-select-".concat(N.type)},C))}function D(e){var n=e.value,t=e.setValue,o=e.locale,l=e.className,c=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-hours":!0})["".concat(l,"-field")]=!!l,e["".concat(l,"-hours")]=!!l,e))},[l]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixHours&&(0,r.jsx)("span",{children:o.prefixHours||d.prefixHours}),(0,r.jsx)(N,{placeholder:o.emptyHours||d.emptyHours,value:n,unit:u[1],setValue:t,locale:o,className:l,disabled:c,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function S(e){var n=e.value,t=e.setValue,o=e.locale,l=e.className,c=e.disabled,s=e.readOnly,p=e.leadingZero,m=e.clockFormat,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-minutes":!0})["".concat(l,"-field")]=!!l,e["".concat(l,"-minutes")]=!!l,e))},[l]);return(0,r.jsxs)("div",i({className:g},{children:["hour"===f?""!==o.prefixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.prefixMinutesForHourPeriod||d.prefixMinutesForHourPeriod}):""!==o.prefixMinutes&&(0,r.jsx)("span",{children:o.prefixMinutes||d.prefixMinutes}),(0,r.jsx)(N,{placeholder:"hour"===f?o.emptyMinutesForHourPeriod||d.emptyMinutesForHourPeriod:o.emptyMinutes||d.emptyMinutes,value:n,unit:u[0],setValue:t,locale:o,className:l,disabled:c,readOnly:s,leadingZero:p,clockFormat:m,period:f,periodicityOnDoubleClick:y,mode:v}),"hour"===f&&""!==o.suffixMinutesForHourPeriod&&(0,r.jsx)("span",{children:o.suffixMinutesForHourPeriod||d.suffixMinutesForHourPeriod})]}))}function C(e){var n=e.value,t=e.setValue,o=e.locale,l=e.className,c=e.weekDays,s=e.disabled,p=e.readOnly,m=e.leadingZero,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=!c||0===c.length,b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-month-days":!0,"react-js-cron-month-days-placeholder":!g})["".concat(l,"-field")]=!!l,e["".concat(l,"-month-days")]=!!l,e))},[l,g]),x=JSON.stringify(o),j=(0,a.useMemo)(function(){return g?o.emptyMonthDays||d.emptyMonthDays:o.emptyMonthDaysShort||d.emptyMonthDaysShort},[g,x]);return p&&(!n||!(n.length>0))&&(n&&0!==n.length||c&&0!==c.length)?null:(0,r.jsxs)("div",i({className:b},{children:[""!==o.prefixMonthDays&&(0,r.jsx)("span",{children:o.prefixMonthDays||d.prefixMonthDays}),(0,r.jsx)(N,{placeholder:j,value:n,setValue:t,unit:u[2],locale:o,className:l,disabled:s,readOnly:p,leadingZero:m,period:f,periodicityOnDoubleClick:y,mode:v})]}))}function A(e){var n=e.value,t=e.setValue,o=e.locale,l=e.className,c=e.humanizeLabels,s=e.disabled,p=e.readOnly,m=e.period,f=e.periodicityOnDoubleClick,y=e.mode,v=o.months||d.months,g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-months":!0})["".concat(l,"-field")]=!!l,e["".concat(l,"-months")]=!!l,e))},[l]);return(0,r.jsxs)("div",i({className:g},{children:[""!==o.prefixMonths&&(0,r.jsx)("span",{children:o.prefixMonths||d.prefixMonths}),(0,r.jsx)(N,{placeholder:o.emptyMonths||d.emptyMonths,optionsList:v,grid:!1,value:n,unit:i(i({},u[3]),{alt:o.altMonths||d.altMonths}),setValue:t,locale:o,className:l,humanizeLabels:c,disabled:s,readOnly:p,period:m,periodicityOnDoubleClick:f,mode:y})]}))}function P(e){var n=e.value,t=e.setValue,l=e.locale,c=e.className,s=e.disabled,u=e.readOnly,p=e.shortcuts,m=e.allowedPeriods,f=[];m.includes("year")&&f.push({value:"year",label:l.yearOption||d.yearOption}),m.includes("month")&&f.push({value:"month",label:l.monthOption||d.monthOption}),m.includes("week")&&f.push({value:"week",label:l.weekOption||d.weekOption}),m.includes("day")&&f.push({value:"day",label:l.dayOption||d.dayOption}),m.includes("hour")&&f.push({value:"hour",label:l.hourOption||d.hourOption}),m.includes("minute")&&f.push({value:"minute",label:l.minuteOption||d.minuteOption}),m.includes("reboot")&&p&&(!0===p||p.includes("@reboot"))&&f.push({value:"reboot",label:l.rebootOption||d.rebootOption});var y=(0,a.useCallback)(function(e){u||t(e)},[t,u]),v=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-period":!0})["".concat(c,"-field")]=!!c,e["".concat(c,"-period")]=!!c,e))},[c]),g=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select":!0,"react-js-cron-select-no-prefix":""===l.prefixPeriod})["".concat(c,"-select")]=!!c,e))},[c,l.prefixPeriod]),b=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-select-dropdown":!0,"react-js-cron-select-dropdown-period":!0})["".concat(c,"-select-dropdown")]=!!c,e["".concat(c,"-select-dropdown-period")]=!!c,e))},[c]);return(0,r.jsxs)("div",i({className:v},{children:[""!==l.prefixPeriod&&(0,r.jsx)("span",{children:l.prefixPeriod||d.prefixPeriod}),(0,r.jsx)(o.Select,{defaultValue:n,value:n,onChange:y,options:f,className:g,popupClassName:b,disabled:s,showArrow:!u,open:!u&&void 0,"data-testid":"select-period"},JSON.stringify(l))]}))}function F(e){var n=e.value,t=e.setValue,o=e.locale,l=e.className,c=e.humanizeLabels,s=e.monthDays,p=e.disabled,m=e.readOnly,f=e.period,y=e.periodicityOnDoubleClick,v=e.mode,g=o.weekDays||d.weekDays,b="week"===f||!s||0===s.length,x=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-field":!0,"react-js-cron-week-days":!0,"react-js-cron-week-days-placeholder":!b})["".concat(l,"-field")]=!!l,e["".concat(l,"-week-days")]=!!l,e))},[l,b]),j=JSON.stringify(o),w=(0,a.useMemo)(function(){return b?o.emptyWeekDays||d.emptyWeekDays:o.emptyWeekDaysShort||d.emptyWeekDaysShort},[b,j]),k="week"===f||!m||n&&n.length>0||(!n||0===n.length)&&(!s||0===s.length),O=!m||s&&s.length>0||(!s||0===s.length)&&(!n||0===n.length);return k?(0,r.jsxs)("div",i({className:x},{children:[""!==o.prefixWeekDays&&("week"===f||!O)&&(0,r.jsx)("span",{children:o.prefixWeekDays||d.prefixWeekDays}),""!==o.prefixWeekDaysForMonthAndYearPeriod&&"week"!==f&&O&&(0,r.jsx)("span",{children:o.prefixWeekDaysForMonthAndYearPeriod||d.prefixWeekDaysForMonthAndYearPeriod}),(0,r.jsx)(N,{placeholder:w,optionsList:g,grid:!1,value:n,unit:i(i({},u[4]),{alt:o.altWeekDays||d.altWeekDays}),setValue:t,locale:o,className:l,humanizeLabels:c,disabled:p,readOnly:m,period:f,periodicityOnDoubleClick:y,mode:v})]})):null}function E(e){var n,t=e.clearButton,c=void 0===t||t,s=e.clearButtonProps,u=void 0===s?{}:s,p=e.clearButtonAction,m=void 0===p?"fill-with-every":p,f=e.locale,v=void 0===f?d:f,x=e.value,j=void 0===x?"":x,w=e.setValue,k=e.displayError,O=void 0===k||k,M=e.onError,N=e.className,E=e.defaultPeriod,V=e.allowEmpty,T=void 0===V?"for-default-value":V,W=e.humanizeLabels,H=void 0===W||W,I=e.humanizeValue,J=void 0!==I&&I,L=e.disabled,z=void 0!==L&&L,U=e.readOnly,Z=void 0!==U&&U,R=e.leadingZero,_=void 0!==R&&R,B=e.shortcuts,Y=void 0===B?["@yearly","@annually","@monthly","@weekly","@daily","@midnight","@hourly"]:B,G=e.clockFormat,q=e.periodicityOnDoubleClick,K=void 0===q||q,Q=e.mode,X=void 0===Q?"multiple":Q,$=e.allowedDropdowns,ee=void 0===$?["period","months","month-days","week-days","hours","minutes"]:$,en=e.allowedPeriods,et=(0,a.useRef)(j),er=(0,a.useRef)(void 0===E?"day":E),eo=(0,a.useState)(),ea=eo[0],ei=eo[1],el=(0,a.useState)(),ec=el[0],es=el[1],eu=(0,a.useState)(),ed=eu[0],ep=eu[1],em=(0,a.useState)(),ef=em[0],eh=em[1],ey=(0,a.useState)(),ev=ey[0],eg=ey[1],eb=(0,a.useState)(),ex=eb[0],ej=eb[1],ew=(0,a.useState)(!1),ek=ew[0],eO=ew[1],eM=(0,a.useState)(!1),eN=eM[0],eD=eM[1],eS=(n=(0,a.useRef)(eN),(0,a.useEffect)(function(){n.current=eN},[eN]),n.current),eC=JSON.stringify(v);(0,a.useEffect)(function(){g(j,eO,M,T,et,!0,v,Y,ej,eg,es,ep,eh,ei)},[]),(0,a.useEffect)(function(){j!==et.current&&g(j,eO,M,T,et,!1,v,Y,ej,eg,es,ep,eh,ei)},[j,et,eC,T,Y]),(0,a.useEffect)(function(){if(!(ea||ex||ed||ec||ef||ev)||eN||eS)eN&&eD(!1);else{var e=ea||er.current,n=b(e,ed,ec,ef,ev,ex,J);w(n,{selectedPeriod:e}),et.current=n,M&&M(void 0),eO(!1)}},[ea,ec,ed,ef,ev,ex,J,eN]);var eA=(0,a.useCallback)(function(){es(void 0),ep(void 0),eh(void 0),eg(void 0),ej(void 0);var e="",n="reboot"!==ea&&ea?ea:er.current;n!==ea&&ei(n),"fill-with-every"===m&&(e=b(n,void 0,void 0,void 0,void 0,void 0)),w(e,{selectedPeriod:n}),et.current=e,eD(!0),"never"===T&&"empty"===m?(eO(!0),y(M,v)):(M&&M(void 0),eO(!1))},[ea,w,M,m]),eP=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron":!0,"react-js-cron-error":ek&&O,"react-js-cron-disabled":z,"react-js-cron-read-only":Z})["".concat(N)]=!!N,e["".concat(N,"-error")]=ek&&O&&!!N,e["".concat(N,"-disabled")]=z&&!!N,e["".concat(N,"-read-only")]=Z&&!!N,e))},[N,ek,O,z,Z]),eF=u.className,eE=l(u,["className"]),eV=(0,a.useMemo)(function(){var e;return h(((e={"react-js-cron-clear-button":!0})["".concat(N,"-clear-button")]=!!N,e["".concat(eF)]=!!eF,e))},[N,eF]),eT=JSON.stringify(eE),eW=(0,a.useMemo)(function(){return c&&!Z?(0,r.jsx)(o.Button,i({className:eV,danger:!0,type:"primary",disabled:z},eE,{onClick:eA},{children:v.clearButtonText||d.clearButtonText})):null},[c,Z,eC,eV,z,eT,eA]),eH=ea||er.current;return(0,r.jsxs)("div",i({className:eP},{children:[ee.includes("period")&&(0,r.jsx)(P,{value:eH,setValue:ei,locale:v,className:N,disabled:z,readOnly:Z,shortcuts:Y,allowedPeriods:void 0===en?["year","month","week","day","hour","minute","reboot"]:en}),"reboot"===eH?eW:(0,r.jsxs)(r.Fragment,{children:["year"===eH&&ee.includes("months")&&(0,r.jsx)(A,{value:ed,setValue:ep,locale:v,className:N,humanizeLabels:H,disabled:z,readOnly:Z,period:eH,periodicityOnDoubleClick:K,mode:X}),("year"===eH||"month"===eH)&&ee.includes("month-days")&&(0,r.jsx)(C,{value:ec,setValue:es,locale:v,className:N,weekDays:ef,disabled:z,readOnly:Z,leadingZero:_,period:eH,periodicityOnDoubleClick:K,mode:X}),("year"===eH||"month"===eH||"week"===eH)&&ee.includes("week-days")&&(0,r.jsx)(F,{value:ef,setValue:eh,locale:v,className:N,humanizeLabels:H,monthDays:ec,disabled:z,readOnly:Z,period:eH,periodicityOnDoubleClick:K,mode:X}),(0,r.jsxs)("div",{children:["minute"!==eH&&"hour"!==eH&&ee.includes("hours")&&(0,r.jsx)(D,{value:ev,setValue:eg,locale:v,className:N,disabled:z,readOnly:Z,leadingZero:_,clockFormat:G,period:eH,periodicityOnDoubleClick:K,mode:X}),"minute"!==eH&&ee.includes("minutes")&&(0,r.jsx)(S,{value:ex,setValue:ej,locale:v,period:eH,className:N,disabled:z,readOnly:Z,leadingZero:_,clockFormat:G,periodicityOnDoubleClick:K,mode:X}),eW]})]})]}))}Object.freeze({__proto__:null,setValuesFromCronString:g,getCronStringFromValues:b,partToString:x,formatValue:j,parsePartArray:w})},4693:function(e,n,t){var r=t(4673),o=t.n(r),a=t(8598),i=t.n(a),l=t(9262),c=t.n(l),s=t(8657),u=t.n(s),d=t(1357),p=t.n(d),m=t(1626),f=t.n(m),h=t(3253),y={};y.styleTagTransform=f(),y.setAttributes=u(),y.insert=c().bind(null,"head"),y.domAPI=i(),y.insertStyleElement=p(),o()(h.A,y),h.A&&h.A.locals&&h.A.locals}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["382"],{8765:function(e,r,o){o.r(r),o.d(r,{TriggerCollectionConfig:function(){return i}});var n=o(2059),t=o(9155),a=o.n(t),l=o(8198),c=o(9488);function i(){var e=(0,c.kj)();return a().createElement(n.Form.Item,{name:"data",label:e("Trigger data"),extra:e("Choose a record or primary key of a record in the collection to trigger."),rules:[{required:!0}]},a().createElement(l.g4,null))}r.default=i}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["394"],{4137:function(e,l,r){r.r(l),r.d(l,{TriggerScheduleConfig:function(){return s}});var n=r(2059),t=r(9185),a=r.n(t),o=r(9155),i=r.n(o),u=r(2235),d=r(8198),c=r(9488),h=r(4869),f=r(1993);function m(e){var l=e.value,r=e.onChange,t=e.placeholder;return i().createElement(n.DatePicker,{showTime:!0,value:l?a()(l):null,placeholder:t,style:{width:"100%"},onChange:function(e){return null==r?void 0:r(e?e.toDate():null)}})}function s(){var e,l=(0,u.Zt)(),r=(0,c.kj)();if((null==l||null==(e=l.config)?void 0:e.mode)===f.a.DATE_FIELD){var t=h.th[f.a.DATE_FIELD].data;return i().createElement(n.Form.Item,{name:"data",label:r(t.title),extra:t.description?r(t.description):void 0,rules:t.required?[{required:!0}]:void 0},i().createElement(d.g4,null))}var a=h.th[f.a.STATIC].date;return i().createElement(n.Form.Item,{name:"date",label:r(a.title),initialValue:new Date,rules:a.required?[{required:!0}]:void 0},i().createElement(m,{placeholder:a.placeholder?r(a.placeholder):void 0}))}l.default=s}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["438"],{1736:function(e,t,n){n.d(t,{i:function(){return E}});var r=n(9155),o=n.n(r),l=n(2059),a=n(7375),i=n(5477),u=n(7694),c=n(5980),s=n(1611),f=n(2235),d=n(3052),m=n(9488),p=n(8743),y=n(3284);function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function b(){var e,t=(0,c.A)().styles,n=(0,m.kj)(),r=(0,u.useFlowEngine)(),i=(0,d.x)(),s=null==i?void 0:i.clipboard;if(!s)return null;var f=r.context.app.pm.get(p.q),y=null==f?void 0:f.getInstruction(s.type),v=y?n(y.title):s.type;return o().createElement("div",{className:t.clipboardPreviewClass},o().createElement("div",{className:"workflow-clipboard-header"},o().createElement("span",null,n("Copied node")),o().createElement(l.Button,{type:"text",size:"small",icon:o().createElement(a.CloseOutlined,null),onClick:function(){return null==i?void 0:i.clearClipboard()}})),o().createElement("div",{className:"workflow-clipboard-card"},o().createElement("div",{className:"workflow-clipboard-type"},v),o().createElement("div",{className:"workflow-clipboard-title"},null!=(e=s.title)?e:s.type)))}function E(e){var t,n,a=e.entry,u=(0,c.A)(),d=u.styles,p=u.cx,E=(0,m.kj)(),h=(0,f.S8)();(null!=(n=(0,f.$K)())?n:{}).workflow;var w=function(e){if(Array.isArray(e))return e}(t=(0,r.useState)(100))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return v(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return v(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),g=w[0],k=w[1];return o().createElement("div",{className:p(d.workflowPageClass,(0,i.css)({height:"100%"}))},o().createElement("div",{className:"workflow-canvas-wrapper"},o().createElement("div",{className:"workflow-canvas",style:{zoom:g/100}},o().createElement("div",{className:p(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement("div",{className:d.branchClass},h?o().createElement(l.Alert,{type:"warning",showIcon:!0,message:E("Executed workflow cannot be modified. Could be copied to a new version to modify."),style:{marginBottom:"1em"}}):null,o().createElement(y.Vo,null),o().createElement("div",{className:p(d.branchBlockClass,(0,i.css)({marginTop:"0 !important"}))},o().createElement(s.l,{entry:a})),o().createElement("div",{className:d.terminalClass},E("End"))))),o().createElement(b,null),o().createElement("div",{className:"workflow-canvas-zoomer"},o().createElement(l.Slider,{vertical:!0,reverse:!0,defaultValue:100,step:10,min:10,value:g,onChange:k}))))}},7653:function(e,t,n){n.r(t),n.d(t,{default:function(){return _}});var r,o=n(7694),l=n(2625),a=n(2059),i=n(9155),u=n.n(i),c=n(4442),s=n(1736),f=n(2235),d=n(8761),m=n(7375),p=n(9239),y=n(7001),v=n(9488),b=n(8401);function E(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var h=(E(r={},p.GO.QUEUEING,u().createElement(m.HourglassOutlined,null)),E(r,p.GO.STARTED,u().createElement(m.LoadingOutlined,null)),E(r,p.GO.RESOLVED,u().createElement(m.CheckOutlined,null)),E(r,p.GO.FAILED,u().createElement(m.ExclamationOutlined,null)),E(r,p.GO.ERROR,u().createElement(m.CloseOutlined,null)),E(r,p.GO.ABORTED,u().createElement(m.MinusOutlined,{rotate:90})),E(r,p.GO.CANCELED,u().createElement(m.MinusOutlined,{rotate:45})),E(r,p.GO.REJECTED,u().createElement(m.MinusOutlined,null)),E(r,p.GO.RETRY_NEEDED,u().createElement(m.RedoOutlined,null)),r);function w(e){var t,n=e.value,r=(0,v.kj)(),o=a.theme.useToken().token,l=p.m2[n];if(!l)return null;var i=null!=(t=h[n])?t:u().createElement(m.ClockCircleOutlined,null),c=o.controlHeightSM;return u().createElement(a.Tooltip,{title:r(l.label)},u().createElement(a.Tag,{color:l.color,style:{marginInlineEnd:o.marginXS,borderRadius:"50%",padding:0,width:c,height:c,lineHeight:"".concat(c,"px"),textAlign:"center"}},i))}var g=n(2404);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||x(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||x(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}function A(e){var t=e.execution,n=e.refresh,r=(0,o.useFlowContext)(),c=a.theme.useToken().token,s=r.api.resource("executions"),f=(0,l.useRequest)(function(){var e;return(e=function(){var e,n,r,o,l,a,i,u;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:return[4,Promise.all([s.list({filter:{key:t.key,id:{$lt:t.id}},sort:"-id",pageSize:10,fields:["id","status","createdAt"]}),s.list({filter:{key:t.key,id:{$gt:t.id}},sort:"id",pageSize:10,fields:["id","status","createdAt"]})])];case 1:return a=(l=S.apply(void 0,[c.sent(),2]))[0],i=l[1],u=null!=(e=null==a||null==(r=a.data)?void 0:r.data)?e:[],[2,C((null!=(n=null==i||null==(o=i.data)?void 0:o.data)?n:[]).slice().reverse()).concat([t],C(u))]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){O(l,r,o,a,i,"next",e)}function i(e){O(l,r,o,a,i,"throw",e)}a(void 0)})})()},{manual:!0}),d=f.data,p=f.run,y=(0,l.useMemoizedFn)(function(e){var n=e.key;String(n)!==String(t.id)&&r.router.navigate((0,b.Pq)(n))}),v=(0,i.useMemo)(function(){return(null!=d?d:[t]).map(function(e){var t;return{key:"".concat(e.id),icon:u().createElement(w,{value:null!=(t=e.status)?t:null}),label:u().createElement("span",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:c.marginXL,minWidth:5*c.sizeXXL}},u().createElement("span",null,"#".concat(e.id)),u().createElement("time",{style:{fontSize:c.fontSizeSM,color:c.colorTextTertiary}},(0,g.fU)(e.createdAt)))}})},[d,t,c]);return u().createElement(a.Space,{size:c.marginXXS},u().createElement(a.Dropdown,{trigger:["click"],onOpenChange:function(e){return e&&p()},menu:{onClick:y,selectedKeys:["".concat(t.id)],items:v}},u().createElement(a.Space,{style:{cursor:"pointer"}},u().createElement("strong",null,"#".concat(t.id)),u().createElement(m.DownOutlined,null))),n?u().createElement(a.Button,{type:"link",size:"small",icon:u().createElement(m.ReloadOutlined,null),onClick:n}):null)}function T(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function j(e){var t,n=e.execution,r=(0,v.kj)(),o=p.m2[n.status];if(!o)return null;var l=n.reason?p.QQ[n.reason]:void 0;return u().createElement(a.Tag,{color:o.color},u().createElement(a.Space,{size:4},r(o.label),n.reason?u().createElement(a.Tooltip,{title:r(null!=(t=null==l?void 0:l.label)?t:n.reason),placement:"bottom"},u().createElement(m.QuestionCircleOutlined,null)):null))}function R(e){var t=e.execution,n=e.resource,r=e.refresh,o=(0,v.ec)().t,i=(0,v.kj)(),s=(0,y.TD)().getWorkflowCanvasPath,f=a.theme.useToken().token,d=a.App.useApp(),b=d.modal,E=d.message,h=t.workflow,w=t.status===p.GO.STARTED||t.status===p.GO.QUEUEING,k=(0,l.useMemoizedFn)(function(){b.confirm({title:o("Cancel the execution"),content:o("Are you sure you want to cancel the execution?"),onOk:function(){var e;return(e=function(){return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(e){switch(e.label){case 0:return[4,n.cancel({filterByTk:t.id})];case 1:return e.sent(),E.success(o("Operation succeeded")),r(),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){T(l,r,o,a,i,"next",e)}function i(e){T(l,r,o,a,i,"throw",e)}a(void 0)})})()}})});return u().createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:f.margin,flexWrap:"wrap",padding:"".concat(f.paddingSM,"px ").concat(f.padding,"px"),background:f.colorBgContainer,borderBottom:"1px solid ".concat(f.colorBorderSecondary)}},u().createElement(a.Breadcrumb,{items:[{title:u().createElement(c.Link,{to:"/admin/settings/workflow"},o("Workflow"))},{title:(null==h?void 0:h.id)!=null?u().createElement(a.Tooltip,{title:"Key: ".concat(h.key)},u().createElement(c.Link,{to:s(h.id)},i(h.title||""))):i((null==h?void 0:h.title)||"")},{title:u().createElement(A,{execution:{id:t.id,key:t.key,status:t.status,createdAt:t.createdAt},refresh:r})}]}),u().createElement("div",{style:{display:"flex",alignItems:"center",gap:f.marginXS}},u().createElement(j,{execution:t}),w?u().createElement(a.Tooltip,{title:o("Cancel the execution")},u().createElement(a.Button,{type:"link",danger:!0,shape:"circle",size:"small",icon:u().createElement(m.StopOutlined,null),onClick:k})):null,u().createElement("time",{style:{opacity:.65}},(0,g.fU)(t.updatedAt))))}var I=n(2723),D=n(7060),N=n(5980),P=n(8364);function B(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function G(e){var t,n=e.jobId,r=(0,o.useFlowContext)(),i=(0,v.kj)(),c=(0,N.A)().styles,s=(0,l.useRequest)(function(){var e;return(e=function(){var e,t,o;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(l){switch(l.label){case 0:return[4,r.api.resource("jobs").get({filterByTk:n})];case 1:return[2,null!=(e=null==(o=l.sent())||null==(t=o.data)?void 0:t.data)?e:null]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){B(l,r,o,a,i,"next",e)}function i(e){B(l,r,o,a,i,"throw",e)}a(void 0)})})()}),f=s.data;return s.loading?u().createElement(a.Spin,null):u().createElement(u().Fragment,null,u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Status"),":"),u().createElement(D._T,{value:null!=(t=null==f?void 0:f.status)?t:null})),u().createElement("div",{style:{marginBottom:16}},u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Executed at"),":"),u().createElement("div",null,(0,g.fU)(null==f?void 0:f.updatedAt))),u().createElement("div",{style:{fontWeight:500,marginBottom:8}},i("Node result"),":"),u().createElement(a.Input.TextArea,{value:(0,P.S)(null==f?void 0:f.result),disabled:!0,autoSize:{minRows:4,maxRows:20},className:c.nodeJobResultClass,style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}}),(null==f?void 0:f.log)?u().createElement(u().Fragment,null,u().createElement("div",{style:{marginTop:16,marginBottom:8,fontWeight:500}},i("Log")),u().createElement(a.Input.TextArea,{value:f.log,disabled:!0,autoSize:{minRows:4,maxRows:20},style:{whiteSpace:"pre",fontFamily:"monospace",fontSize:"80%"}})):null)}function M(){var e,t,n,r,o=null!=(e=(0,f.$K)())?e:{},l=o.viewJob,i=o.setViewJob,c=(0,v.kj)(),s=(0,I.Y)(null==l||null==(t=l.node)?void 0:t.type),d=(0,N.A)().styles;return u().createElement(a.Modal,{open:!!l,onCancel:function(){return null==i?void 0:i(null)},footer:null,width:980,title:u().createElement("div",{className:d.nodeTitleClass},u().createElement(a.Tag,null,s?c(s.title):null==l||null==(n=l.node)?void 0:n.type),u().createElement("strong",null,null==l||null==(r=l.node)?void 0:r.title)),destroyOnClose:!0,modalRender:function(e){return u().createElement("div",{onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()}},e)}},(null==l?void 0:l.id)!=null?u().createElement(G,{jobId:l.id}):null)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}}var F=function(e){var t,n=e.record,r=e.resource,o=e.refresh,l=(0,v.ec)().t,m=(0,c.useNavigate)(),p=function(e){if(Array.isArray(e))return e}(t=(0,i.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||L(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),y=p[0],b=p[1],E=null!=n?n:{},h=E.jobs,w=void 0===h?[]:h,g=E.workflow,k=function(e,t){if(null==e)return{};var n,r,o,l={};if("u">typeof Reflect&&Reflect.ownKeys){for(o=0,n=Reflect.ownKeys(Object(e));o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}if(l=function(e,t){if(null==e)return{};var n,r,o={},l=Object.getOwnPropertyNames(e);for(r=0;r<l.length;r++)n=l[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}(e,t),Object.getOwnPropertySymbols)for(o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)r=n[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(l[r]=e[r]);return l}(E,["jobs","workflow"]),O=(0,i.useMemo)(function(){var e,t,n=function(e){if(Array.isArray(e))return z(e)}(e=null!=(t=null==g?void 0:g.nodes)?t:[])||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||L(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();return(0,d.K)(n),!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;e.forEach(function(e){e.jobs=[],n.set(e.id,e)}),t.forEach(function(e){var t=n.get(e.nodeId);t&&(t.jobs.push(e),e.node={id:t.id,key:t.key,title:t.title,type:t.type})}),e.forEach(function(e){e.jobs=e.jobs.sort(function(e,t){return e.id-t.id})})}(n,w),n},[w,null==g?void 0:g.nodes]),S=(0,i.useMemo)(function(){var e;return null!=(e=O.find(function(e){return!e.upstream}))?e:null},[O]);return((0,i.useEffect)(function(){if(null==y?void 0:y.id){var e=w.find(function(e){return String(e.id)===String(y.id)});e&&b(e)}},[w,null==y?void 0:y.id]),g)?u().createElement(f.cB.Provider,{value:{workflow:g.type?g:null,nodes:O,execution:k,viewJob:y,setViewJob:b}},u().createElement(R,{execution:n,resource:r,refresh:o}),u().createElement(s.i,{entry:S}),u().createElement(M,null)):u().createElement(a.Result,{status:"404",title:l("Not found"),subTitle:l("Workflow of execution is not existed"),extra:u().createElement(a.Button,{onClick:function(){m(-1)}},l("Go back"))})};function U(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function _(){(0,v.ec)();var e=(0,o.useFlowContext)(),t=a.theme.useToken().token,n=(0,c.useParams)().id,r=e.api.resource("executions"),i=(0,l.useRequest)(function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){switch(t.label){case 0:if(!n)return[2,null];return[4,r.get({filterByTk:n,appends:["jobs","workflow","workflow.nodes","workflow.versionStats","workflow.stats"],except:["jobs.result","workflow.options"]})];case 1:return e=t.sent(),[2,(0,g.iD)(e)]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){U(l,r,o,a,i,"next",e)}function i(e){U(l,r,o,a,i,"throw",e)}a(void 0)})})()},{refreshDeps:[n]}),s=i.data,f=i.refresh,d=(null==s?void 0:s.id)!=null&&String(s.id)===String(n)?s:null;return n?d?u().createElement("div",{style:{display:"flex",flexDirection:"column",height:"100dvh",minHeight:0,overflow:"hidden",width:"100%",boxSizing:"border-box",background:t.colorBgLayout}},u().createElement("div",{style:{flex:1,minHeight:0,overflow:"hidden",position:"relative",width:"100%"}},u().createElement(F,{record:d,resource:r,refresh:f}))):u().createElement(a.Spin,null):null}},7001:function(e,t,n){n.d(t,{TD:function(){return i}});var r=n(2625),o=n(3485),l=n(8401);function a(){return"modern"===(0,o.getRouteRuntimeVersion)()}function i(){var e=(0,r.useMemoizedFn)(function(e){return a()?(0,l.JG)(e):"/admin/settings/workflow/workflows/".concat(e)}),t=(0,r.useMemoizedFn)(function(e){return a()?(0,l.Pq)(e):"/admin/settings/workflow/executions/".concat(e)});return{isV2Runtime:a(),getWorkflowCanvasPath:e,getWorkflowExecutionPath:t}}},9239:function(e,t,n){n.d(t,{GO:function(){return l},QQ:function(){return u},hi:function(){return a},m2:function(){return i}});var r=n(358);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l={QUEUEING:null,STARTED:0,RESOLVED:1,FAILED:-1,ERROR:-2,ABORTED:-3,CANCELED:-4,REJECTED:-5,RETRY_NEEDED:-6},a=[{value:l.QUEUEING,label:'{{t("Queueing", { ns: "'.concat(r.C,'" })}}'),color:"blue",description:'{{t("Triggered but still waiting in queue to execute.", { ns: "'.concat(r.C,'" })}}')},{value:l.STARTED,label:'{{t("On going", { ns: "'.concat(r.C,'" })}}'),color:"gold",description:'{{t("Started and executing, maybe waiting for an async callback (manual, delay etc.).", { ns: "'.concat(r.C,'" })}}')},{value:l.RESOLVED,label:'{{t("Resolved", { ns: "'.concat(r.C,'" })}}'),color:"green",description:'{{t("Successfully finished.", { ns: "'.concat(r.C,'" })}}')},{value:l.FAILED,label:'{{t("Failed", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Failed to satisfy node configurations.", { ns: "'.concat(r.C,'" })}}')},{value:l.ERROR,label:'{{t("Error", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Some node meets error.", { ns: "'.concat(r.C,'" })}}')},{value:l.ABORTED,label:'{{t("Aborted", { ns: "'.concat(r.C,'" })}}'),color:"red",description:'{{t("Running of some node was aborted by program flow.", { ns: "'.concat(r.C,'" })}}')},{value:l.CANCELED,label:'{{t("Canceled", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Manually canceled whole execution when waiting.", { ns: "'.concat(r.C,'" })}}')},{value:l.REJECTED,label:'{{t("Rejected", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("Rejected from a manual node.", { ns: "'.concat(r.C,'" })}}')},{value:l.RETRY_NEEDED,label:'{{t("Retry needed", { ns: "'.concat(r.C,'" })}}'),color:"volcano",description:'{{t("General failed but should do another try.", { ns: "'.concat(r.C,'" })}}')}],i=a.reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{}),u=[{value:r.K.TIMEOUT,label:'{{t("Timed out", { ns: "'.concat(r.C,'" })}}')},{value:r.K.MANUAL_CANCEL,label:'{{t("Canceled manually", { ns: "'.concat(r.C,'" })}}')},{value:r.K.PARENT_ABORTED,label:'{{t("Aborted with parent execution", { ns: "'.concat(r.C,'" })}}')}].reduce(function(e,t){return Object.assign(e,o({},t.value,t))},{})}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["509"],{5764:function(e,t,n){n.r(t),n.d(t,{default:function(){return eo}});var r=n(7375),o=n(3485),l=n(5477),a=n(7694),i=n(2625),u=n(2059),c=n(9155),s=n.n(c),d=n(5827),f=n(7541),m=n(5927),p=n(7001),y=n(9488),b=n(8743),v=n(1652),g=n(5953);function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){w(l,r,o,a,i,"next",e)}function i(e){w(l,r,o,a,i,"throw",e)}a(void 0)})}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||k(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}}function C(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var x=["red","magenta","volcano","orange","gold","lime","green","cyan","blue","geekblue","purple","default"];function F(e){var t=(0,g.useTranslation)().t,n=x.map(function(e){return{value:e,label:s().createElement(u.Tag,{color:"default"===e?void 0:e},t(e.charAt(0).toUpperCase()+e.slice(1)))}});return s().createElement(u.Select,{allowClear:!0,value:e.value,options:n,onChange:e.onChange})}function A(e){var t=e.activeKey,n=e.onChange,r=e.categories,l=e.refreshCategories,d=e.className,f=(0,y.ec)().t,m=(0,y.kj)(),p=(0,a.useFlowContext)(),b=u.App.useApp().modal,v=p.api.resource("workflowCategories"),g=S((0,c.useState)(null),2),w=g[0],x=g[1],A=S((0,c.useState)(!1),2),O=A[0],T=A[1],I=S((0,c.useState)(!1),2),j=I[0],M=I[1],P=S(u.Form.useForm(),1)[0],z=(0,c.useMemo)(function(){return((function(e){if(Array.isArray(e))return h(e)})(r)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||k(r)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){var n,r;return(null!=(n=e.sort)?n:0)-(null!=(r=t.sort)?r:0)}).map(function(e){return{id:e.id,label:m(e.title),color:e.color}})},[r,m]),D=(0,i.useMemoizedFn)(function(e){return r.find(function(t){return String(t.id)===String(e)})}),B=(0,i.useMemoizedFn)(function(){x(null),P.resetFields(),T(!0)}),L=(0,i.useMemoizedFn)(function(e){var t=D(e);t&&(x(t),P.setFieldsValue({title:t.title,color:t.color}),T(!0))}),R=(0,i.useMemoizedFn)(function(e){var r=D(e);r&&b.confirm({title:f("Delete category"),content:f("Are you sure you want to delete it?"),onOk:function(){return E(function(){return C(this,function(e){switch(e.label){case 0:return[4,v.destroy({filterByTk:r.id})];case 1:return e.sent(),String(r.id)===t&&n("all"),l(),[2]}})})()}})}),N=(0,i.useMemoizedFn)(function(e,t){return E(function(){return C(this,function(n){switch(n.label){case 0:return[4,v.move({sourceId:e,targetId:t})];case 1:return n.sent(),l(),[2]}})})()}),G=(0,i.useMemoizedFn)(function(){return E(function(){var e;return C(this,function(t){switch(t.label){case 0:return[4,P.validateFields()];case 1:e=t.sent(),M(!0),t.label=2;case 2:if(t.trys.push([2,,7,8]),!w)return[3,4];return[4,v.update({filterByTk:w.id,values:e})];case 3:return t.sent(),[3,6];case 4:return[4,v.create({values:e})];case 5:t.sent(),t.label=6;case 6:return T(!1),l(),[3,8];case 7:return M(!1),[7];case 8:return[2]}})})()});return s().createElement(s().Fragment,null,s().createElement(o.SortableCategoryTabs,{className:d,activeKey:t,onChange:n,allTab:{key:"all",label:f("All")},categories:z,onAdd:B,onEdit:L,onDelete:R,onSort:N,menuLabels:{edit:f("Edit category"),delete:f("Delete category")}}),s().createElement(u.Modal,{title:w?f("Edit category"):f("Add category"),open:O,confirmLoading:j,onOk:G,onCancel:function(){return T(!1)},okText:f("Submit"),cancelText:f("Cancel"),destroyOnClose:!0},s().createElement(u.Form,{form:P,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:f("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"color",label:f("Color")},s().createElement(F,null)))))}var O=n(9239);function T(e){var t=e.value,n=e.onChange,o=e.disabled,l=(0,y.ec)().t,a=[{value:!1,label:l("Asynchronously"),tooltip:l("Will be executed in the background as a queued task.")},{value:!0,label:l("Synchronously"),tooltip:l("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.")}];return s().createElement(u.Radio.Group,{value:t,disabled:o,onChange:function(e){return null==n?void 0:n(e.target.value)}},a.map(function(e){return s().createElement(u.Radio,{key:String(e.value),value:e.value},s().createElement(u.Space,{size:"small"},e.label,s().createElement(u.Tooltip,{title:e.tooltip},s().createElement(r.QuestionCircleOutlined,null))))}))}function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=[{value:1e3,label:"Seconds"},{value:6e4,label:"Minutes"},{value:36e5,label:"Hours"},{value:864e5,label:"Days"}];function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15552e6;return Math.min(Math.max(e,0),t)}function P(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6e4;return e&&null!=(t=null==(n=j.findLast(function(t){return e%t.value==0}))?void 0:n.value)?t:r}function z(e){var t,n=e.value,r=e.onChange,o=(0,y.ec)().t,l=M(Number(null!=n?n:0)),a=function(e){if(Array.isArray(e))return e}(t=(0,c.useState)(function(){return P(l)}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],l=!0,a=!1;try{for(r=r.call(e);!(l=(t=r.next()).done)&&(o.push(t.value),2!==o.length);l=!0);}catch(e){a=!0,n=e}finally{try{l||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return I(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],d=a[1];(0,c.useEffect)(function(){0!==l&&d(function(e){return P(l,e)})},[l]);var f=0===l?0:l/i,m=15552e6/i;return s().createElement(u.Space.Compact,{style:{width:"50%"}},s().createElement(u.InputNumber,{min:0,max:m,precision:0,value:f,onChange:function(e){return null==r?void 0:r(M(Number(e)||0,m)*i)},style:{width:"70%"}}),s().createElement(u.Select,{value:i,style:{width:"30%"},options:j.map(function(e){return{value:e.value,label:o(e.label)}}),onChange:function(e){var t=M(Number(null!=n?n:0)),o=0===t?0:t/i;d(e),null==r||r(M(o*e))}}))}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function L(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e){var t,n=e.mode,r=e.plugin,l=e.record,d=e.categoryOptions,f=e.onSubmitted,m=(0,y.ec)().t,p=(0,y.kj)(),b=(0,a.useFlowContext)(),v=u.theme.useToken().token,g=b.api.resource("workflows"),h=L(u.Form.useForm(),1)[0],w=L((0,c.useState)(!1),2),E=w[0],S=w[1],k=(0,c.useMemo)(function(){var e=Array.from(r.triggers.getEntities()).map(function(e){var t=L(e,2),n=t[0],r=t[1];return{value:n,label:(null==r?void 0:r.title)?p(r.title):String(n),description:(null==r?void 0:r.description)?p(r.description):void 0}});return"edit"===n&&(null==l?void 0:l.type)&&!e.some(function(e){return e.value===l.type})&&e.push({value:l.type,label:l.type,description:void 0}),e.sort(function(e,t){return String(e.label).localeCompare(String(t.label))})},[r,p,n,l]),C=(0,c.useMemo)(function(){return O.hi.filter(function(e){return!!e.value}).map(function(e){return{value:e.value,label:p(e.label),color:e.color,description:e.description?p(e.description):void 0}})},[p]),x=(0,c.useMemo)(function(){if("edit"===n){var t,r,o;return{title:null==l?void 0:l.title,type:null==l?void 0:l.type,sync:null!=(t=null==l?void 0:l.sync)&&t,description:null==l?void 0:l.description,categories:(null!=(r=null==l?void 0:l.categories)?r:[]).map(function(e){return e.id}),options:null!=(o=null==l?void 0:l.options)?o:{}}}return{type:e.type,sync:!1,options:{},config:{}}},[n,l,e.type]);(0,c.useEffect)(function(){h.setFieldsValue(x)},[h,x]);var F=null!=(t=u.Form.useWatch("type",h))?t:e.type,A=(0,c.useMemo)(function(){return r.getTriggerOptions(F)},[r,F]),I=(null==A?void 0:A.sync)!=null;(0,c.useEffect)(function(){I&&h.setFieldValue("sync",A.sync)},[I,A,h]);var j=(0,c.useMemo)(function(){if("create"!==n)return null;var e=null==A?void 0:A.PresetFieldsetLoader;return e?(0,c.lazy)(e):null},[n,A]),M=(0,i.useMemoizedFn)(function(){h.setFieldValue("config",{})}),P=(0,i.useMemoizedFn)(function(){var e;return(e=function(){var e,t,r,o,a,i;return function(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(u){switch(u.label){case 0:return[4,h.validateFields()];case 1:e=u.sent(),S(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==n)return[3,4];return[4,g.create({values:{title:e.title,type:e.type,sync:!!e.sync,current:!0,config:null!=(t=e.config)?t:{},description:e.description,categories:null!=(r=e.categories)?r:[],options:null!=(o=e.options)?o:{}}})];case 3:return u.sent(),[3,6];case 4:return[4,g.update({filterByTk:l.id,values:{title:e.title,sync:!!e.sync,description:e.description,categories:null!=(a=e.categories)?a:[],options:null!=(i=e.options)?i:{}}})];case 5:u.sent(),u.label=6;case 6:return f(),[3,8];case 7:return S(!1),[7];case 8:return[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){B(l,r,o,a,i,"next",e)}function i(e){B(l,r,o,a,i,"throw",e)}a(void 0)})})()});return s().createElement(o.DrawerFormLayout,{title:m("create"===n?"Add new":"Edit"),onSubmit:P,submitting:E,submitText:m("Submit"),cancelText:m("Cancel")},s().createElement(u.Form,{form:h,layout:"vertical",initialValues:x},s().createElement(u.Form.Item,{name:"title",label:m("Title"),rules:[{required:!0}]},s().createElement(u.Input,null)),s().createElement(u.Form.Item,{name:"type",label:m("Trigger type"),rules:[{required:!0}]},s().createElement(u.Select,{options:k,disabled:"edit"===n,onChange:M,showSearch:!0,optionFilterProp:"label",popupMatchSelectWidth:!0,optionRender:function(e){var t,n;return s().createElement(u.Space,{direction:"vertical"},s().createElement(u.Tag,{color:"gold"},null==(t=e.data)?void 0:t.label),(null==(n=e.data)?void 0:n.description)?s().createElement(u.Typography.Text,{type:"secondary",style:{whiteSpace:"normal"}},e.data.description):null)}})),j?s().createElement("div",{style:{marginBottom:v.marginLG}},s().createElement("div",{style:{marginBottom:v.marginXS,fontWeight:600}},"".concat(m("Trigger configuration"),":")),s().createElement("div",{style:{padding:v.padding,border:"".concat(v.lineWidth,"px solid ").concat(v.colorBorderSecondary),borderRadius:v.borderRadiusLG}},s().createElement(c.Suspense,{fallback:s().createElement(u.Spin,null)},s().createElement(j,null)))):null,s().createElement(u.Form.Item,{name:"sync",label:m("Execute mode"),extra:m("Execute workflow asynchronously or synchronously based on trigger type, and could not be changed after created.")},s().createElement(T,{disabled:I||"edit"===n})),s().createElement(u.Form.Item,{name:"categories",label:m("Category")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:d,optionFilterProp:"label"})),s().createElement(u.Form.Item,{name:"description",label:m("Description")},s().createElement(u.Input.TextArea,{autoSize:{minRows:2}})),s().createElement(u.Form.Item,{label:m("Advance options")},s().createElement(u.Card,{size:"small"},s().createElement(u.Form.Item,{name:["options","timeout"],label:m("Timeout settings"),extra:m("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."),initialValue:0},s().createElement(z,null)),s().createElement(u.Form.Item,{name:["options","stackLimit"],label:m("Maximum number of cycling triggers"),extra:m("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."),initialValue:1},s().createElement(u.InputNumber,{min:1,precision:0,style:{width:"50%"}})),s().createElement(u.Form.Item,{name:["options","deleteExecutionOnStatus"],label:m("Auto delete history when execution is on end status")},s().createElement(u.Select,{mode:"multiple",allowClear:!0,options:C,optionFilterProp:"label",optionRender:function(e){var t,n,r;return s().createElement(u.Space,null,s().createElement(u.Tag,{color:null==(t=e.data)?void 0:t.color},null==(n=e.data)?void 0:n.label),(null==(r=e.data)?void 0:r.description)?s().createElement("span",null,e.data.description):null)},tagRender:function(e){var t,n=e.value,r=e.label,o=e.closable,l=e.onClose;return s().createElement(u.Tag,{color:null==(t=O.m2[String(n)])?void 0:t.color,closable:o,onClose:l,onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},r)}}))))))}function N(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function G(e,t,n,r,o,l,a){try{var i=e[l](a),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function W(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var l=e.apply(t,n);function a(e){G(l,r,o,a,i,"next",e)}function i(e){G(l,r,o,a,i,"throw",e)}a(void 0)})}}function q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function V(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var l=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(l.push(n.value),!t||l.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return l}}(e,t)||U(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function K(e){return function(e){if(Array.isArray(e))return N(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return N(e,t)}}function H(e,t){var n,r,o,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(a,"next",{value:u(0)}),i(a,"throw",{value:u(1)}),i(a,"return",{value:u(2)}),"function"==typeof Symbol&&i(a,Symbol.iterator,{value:function(){return this}}),a;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){l.label=c[1];break}if(6===c[0]&&l.label<o[1]){l.label=o[1],o=c;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(c);break}o[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function Q(){var e=_(["\n background: ",";\n padding: 0;\n "]);return Q=function(){return e},e}function X(){var e=_(["\n margin-left: -1px;\n background: ",";\n\n .ant-tabs {\n margin-bottom: 0;\n }\n\n .ant-tabs-nav {\n margin-bottom: 0;\n }\n\n .ant-tabs-content-holder {\n display: none;\n }\n "]);return X=function(){return e},e}function Z(){var e=_(["\n margin: 0;\n padding: ","px;\n background: ",";\n border-radius: 0 ","px ","px ","px;\n "]);return Z=function(){return e},e}var J=["id","description","categories"];function Y(e){var t=e.notices;if(!t.length)return null;var n=function(e){switch(e){case"error":return s().createElement(r.CloseCircleOutlined,null);case"info":return s().createElement(r.InfoCircleOutlined,null);case"success":return s().createElement(r.CheckCircleOutlined,null);default:return s().createElement(r.ExclamationCircleOutlined,null)}},o=function(e){switch(e){case"error":case"success":case"warning":return e;case"info":return"blue";default:return"warning"}};return s().createElement(s().Fragment,null,t.map(function(e,t){return s().createElement(u.Tooltip,{key:"".concat(e.key,"-").concat(t),title:e.description},s().createElement(u.Tag,{color:o(e.type),icon:n(e.type||"warning")},e.message))}))}function ee(e){var t=e.notices,n=e.title;return s().createElement("span",{style:{overflowWrap:"anywhere",whiteSpace:"normal",wordBreak:"break-word"}},n,t.length?s().createElement("span",{style:{display:"inline-flex",flexWrap:"wrap",gap:"4px 8px",marginInlineStart:8}},s().createElement(Y,{notices:t})):null)}function et(e){var t=e.record,n=e.resource,r=e.onChanged,o=(0,y.ec)().t,l=u.App.useApp().message,a=$((0,c.useState)(!1),2),d=a[0],f=a[1],m=(0,i.useMemoizedFn)(function(e){return W(function(){return H(this,function(a){switch(a.label){case 0:if((null==t?void 0:t.id)==null)return[2];f(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,n.update({filterByTk:t.id,values:{enabled:e}})];case 2:return a.sent(),setTimeout(function(){return r()},0),[3,5];case 3:return a.sent(),l.error(o("Operation failed")),[3,5];case 4:return f(!1),[7];case 5:return[2]}})})()});return s().createElement(u.Switch,{checked:!!(null==t?void 0:t.enabled),size:"small",disabled:d,loading:d,onClick:function(e,t){var n;return null==t||null==(n=t.stopPropagation)?void 0:n.call(t)},onChange:m})}function en(e){var t=e.record,n=e.resource,r=e.onSubmitted,l=(0,y.ec)().t,a=$(u.Form.useForm(),1)[0],d=$((0,c.useState)(!1),2),f=d[0],m=d[1],p=(0,i.useMemoizedFn)(function(){return W(function(){var e;return H(this,function(o){switch(o.label){case 0:return[4,a.validateFields()];case 1:e=o.sent(),m(!0),o.label=2;case 2:return o.trys.push([2,,4,5]),[4,n.revision({filterByTk:t.id,values:e})];case 3:return o.sent(),r(),[3,5];case 4:return m(!1),[7];case 5:return[2]}})})()});return s().createElement(o.DialogFormLayout,{title:l("Duplicate to new workflow"),onSubmit:p,submitting:f,submitText:l("Submit"),cancelText:l("Cancel")},s().createElement(u.Form,{form:a,layout:"vertical"},s().createElement(u.Form.Item,{name:"title",label:l("Title")},s().createElement(u.Input,null))))}function er(){var e,t=(0,y.ec)().t,n=(0,y.kj)(),d=(0,a.useFlowContext)(),g=(0,p.TD)().getWorkflowCanvasPath,h=u.theme.useToken().token,w=u.App.useApp(),E=w.modal,S=w.message,k=d.api.resource("workflows"),C=d.app.pm.get(b.A),x=(0,l.css)(Q(),h.colorBgLayout),F=(0,l.css)(X(),h.colorBgLayout),O=(0,l.css)(Z(),h.paddingLG,h.colorBgContainer,h.borderRadiusLG,h.borderRadiusLG,h.borderRadiusLG),T=(0,c.useMemo)(function(){var e,t,n,r;return null==(r=d.dataSourceManager)||null==(n=r.getDataSource)||null==(t=n.call(r,"main"))||null==(e=t.getCollection)?void 0:e.call(t,"workflows")},[d]),I=$((0,c.useState)("all"),2),j=I[0],M=I[1],P=$((0,c.useState)(1),2),z=P[0],D=P[1],B=$((0,c.useState)(o.DEFAULT_PAGE_SIZE),2),L=B[0],N=B[1],G=$((0,c.useState)([]),2),q=G[0],V=G[1],_=$((0,c.useState)(void 0),2),U=_[0],Y=_[1],er=$((0,c.useState)({}),2),eo=er[0],el=er[1],ea=(0,i.useMemoizedFn)(function(e){Y(e),D(1)}),ei=(0,i.useRequest)(function(){return W(function(){var e,t,n;return H(this,function(r){switch(r.label){case 0:return[4,d.api.resource("workflowCategories").list({paginate:!1,sort:["sort"]})];case 1:return[2,null!=(e=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?e:[]]}})})()}),eu=ei.data,ec=ei.refresh,es=(0,c.useMemo)(function(){return eu||[]},[eu]),ed=(0,c.useMemo)(function(){return es.map(function(e){var t;return{value:e.id,label:n(null!=(t=e.title)?t:"")}})},[es,n]),ef=(0,i.useRequest)(function(){return W(function(){var e,t;return H(this,function(n){switch(n.label){case 0:return e={current:!0},"all"!==j&&(e["categories.id"]=j),t=U?{$and:[e,U]}:e,[4,k.list({page:z,pageSize:L,sort:["-createdAt"],appends:["categories","stats"],except:["config"],filter:t})];case 1:var r,o,l,a,i;return[2,{records:a=Array.isArray(l=null==(o=null==(r=n.sent())?void 0:r.data)?void 0:o.data)?l:Array.isArray(null==l?void 0:l.data)?l.data:[],total:(i=(null==o?void 0:o.meta)||(null==l?void 0:l.meta)||{}).count||i.total||a.length}]}})})()},{refreshDeps:[z,L,j,U]}),em=ef.data,ep=ef.loading,ey=ef.refresh,eb=(0,c.useMemo)(function(){return(null==em?void 0:em.records)||[]},[null==em?void 0:em.records]);(0,c.useEffect)(function(){var e=!1;return W(function(){var t;return H(this,function(n){switch(n.label){case 0:if(!eb.length)return el({}),[2];return el({}),[4,C.loadWorkflowListNotices({api:d.api,surface:"workflow-list-row",workflows:eb})];case 1:return t=n.sent(),e||el(t),[2]}})})().catch(function(){e||el({})}),function(){e=!0}},[d.api,C,eb]);var ev=(0,i.useMemoizedFn)(function(e,t){if(t!==L){N(t),D(1);return}D(e)}),eg=(0,i.useMemoizedFn)(function(e){var t=e?C.getTriggerOptions(e):void 0;return(null==t?void 0:t.title)?n(t.title):e}),eh=(0,i.useMemoizedFn)(function(e,t){d.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(R,{mode:e,plugin:C,record:t,categoryOptions:ed,onSubmitted:function(){return ey()}})}})}),ew=(0,i.useMemoizedFn)(function(e){d.viewer.dialog({width:520,closable:!0,content:function(){return s().createElement(en,{record:e,resource:k,onSubmitted:function(){return ey()}})}})}),eE=(0,i.useMemoizedFn)(function(e){d.router.navigate(g(e.id))}),eS=(0,i.useMemoizedFn)(function(e){d.viewer.drawer({width:"60%",closable:!0,title:t("Execution history"),content:function(){return s().createElement(v.S,{workflowKey:e.key})}})}),ek=(0,i.useMemoizedFn)(function(e){E.confirm({title:t("Delete record"),content:t("Are you sure you want to delete it?"),onOk:function(){return W(function(){return H(this,function(t){switch(t.label){case 0:return[4,k.destroy({filterByTk:e})];case 1:return t.sent(),V([]),ey(),[2]}})})()}})}),eC=(0,i.useMemoizedFn)(function(){return W(function(){return H(this,function(e){switch(e.label){case 0:return[4,k.sync()];case 1:return e.sent(),S.success(t("Operation succeeded")),ey(),[2]}})})()}),ex=!!((null==(e=d.app)?void 0:e.name)&&"main"!==d.app.name||d.app.pm.get("multi-app-share-collection")),eF=(0,c.useMemo)(function(){return[{title:t("Title"),dataIndex:"title",width:520,onCell:function(){return{style:{overflowWrap:"anywhere",whiteSpace:"normal",wordBreak:"break-word"}}},render:function(e,t){var n=C.getWorkflowNotices({surface:"workflow-list-row",workflow:t}),r=eo[String(t.id)]||[],o=K(n).concat(K(r));return s().createElement(ee,{title:e,notices:o})}},{title:t("Category"),dataIndex:"categories",render:function(e){return s().createElement(u.Space,{size:[0,4],wrap:!0},(null!=e?e:[]).map(function(e){return s().createElement(u.Tag,{key:e.id,color:"default"===e.color?void 0:e.color},n(e.title))}))}},{title:t("Trigger type"),dataIndex:"type",render:function(e){return e?s().createElement(u.Tag,{color:"gold"},eg(e)):null}},{title:t("Execute mode"),dataIndex:"sync",width:140,render:function(e){return s().createElement(m.t,{value:e})}},{title:t("Enabled"),dataIndex:"enabled",width:100,render:function(e,t){return s().createElement(et,{record:t,resource:k,onChanged:ey})}},{title:t("Executed"),dataIndex:["stats","executed"],width:100,render:function(e,t){var n,r;return s().createElement("a",{"aria-label":"executed-".concat(t.title),onClick:function(){return eS(t)}},null!=(n=null==(r=t.stats)?void 0:r.executed)?n:0)}},{title:t("Actions"),width:260,render:function(e,n){return s().createElement(u.Space,{size:"middle",wrap:!1,style:{whiteSpace:"nowrap"}},s().createElement("a",{onClick:function(){return eE(n)}},t("Configure")),s().createElement("a",{onClick:function(){return eh("edit",n)}},t("Edit")),s().createElement("a",{onClick:function(){return ew(n)}},t("Duplicate")),s().createElement("a",{onClick:function(){return ek(n.id)}},t("Delete")))}}]},[ek,eE,ew,eS,eh,C,ey,k,t,eg,eo]);return s().createElement("div",{className:x},s().createElement(A,{className:F,activeKey:j,onChange:function(e){M(e),D(1)},categories:es,refreshCategories:ec}),s().createElement("div",{className:O},s().createElement(u.Flex,{justify:"space-between",align:"center",style:{marginBottom:h.margin}},s().createElement(o.CollectionFilter,{collection:T,defaultValue:f.d,nonfilterableFieldNames:J,onChange:ea,t:n}),s().createElement(u.Space,null,s().createElement(u.Button,{icon:s().createElement(r.ReloadOutlined,null),onClick:function(){return ey()}},t("Refresh")),ex?s().createElement(u.Tooltip,{title:t("Sync enabled status of all workflows from database")},s().createElement(u.Button,{icon:s().createElement(r.SyncOutlined,null),onClick:eC},t("Sync"))):null,s().createElement(u.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!q.length,onClick:function(){return ek(q)}},t("Delete")),s().createElement(u.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null),onClick:function(){return eh("create")}},t("Add new")))),s().createElement(o.Table,{rowKey:"id",loading:ep,columns:eF,dataSource:(null==em?void 0:em.records)||[],rowSelection:{selectedRowKeys:q,onChange:V},pagination:{current:z,pageSize:L,total:(null==em?void 0:em.total)||0,onChange:ev},tableLayout:"fixed"})))}function eo(){var e=(0,y.kj)(),t=(0,a.useFlowContext)().app.pm.get(b.A),n=(0,c.useMemo)(function(){var n=Array.from(t.triggers.getEntities()).map(function(t){var n=$(t,2),r=n[0],o=n[1];return{value:r,label:(null==o?void 0:o.title)?e(o.title):String(r)}}).sort(function(e,t){return String(e.label).localeCompare(String(t.label))});return[V(q({},d.A),{hidden:!0,fields:d.A.fields.map(function(e){return(null==e?void 0:e.name)==="type"&&e.uiSchema?V(q({},e),{uiSchema:V(q({},e.uiSchema),{enum:n})}):e})})]},[t,e]);return s().createElement(o.ExtendCollectionsProvider,{collections:n},s().createElement(er,null))}},7541:function(e,t,n){n.d(t,{d:function(){return r}});var r={$and:[{title:{$includes:""}},{type:{$eq:void 0}}]}}}]);
@@ -1,10 +0,0 @@
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
- "use strict";(self.webpackChunk_nocobase_plugin_workflow=self.webpackChunk_nocobase_plugin_workflow||[]).push([["54"],{5329:function(e,n,l){l.d(n,{F:function(){return r}});var t=l(9155),a=l.n(t),o=l(2059),i=l(8198),s=l(9488);function c(e){var n=e.value,l=e.onChange,o=e.disabled,s=e.onCollectionChanged,c=(0,t.useRef)();return a().createElement(i.XJ,{value:n,disabled:o,onChange:function(e){var t,a=null!=(t=c.current)?t:n;null==l||l(e),a&&a!==e&&(null==s||s(a,e)),c.current=e}})}function r(e){var n=e.disabled,l=e.onCollectionChanged,t=(0,s.kj)();return a().createElement(o.Form.Item,{name:["config","collection"],label:t("Collection"),rules:[{required:!0}]},a().createElement(c,{disabled:n,onCollectionChanged:l}))}},6381:function(e,n,l){l.d(n,{CreateFieldset:function(){return d},CreatePresetFieldset:function(){return m}});var t=l(9155),a=l.n(t),o=l(2059),i=l(2235),s=l(8198),c=l(9488),r=l(5329);function u(){var e,n=(0,c.kj)(),l=o.Form.useFormInstance(),r=(0,i.Zt)(),u=o.Form.useWatch(["config","collection"]),d=!!(null==r||null==(e=r.versionStats)?void 0:e.executed);return(0,t.useEffect)(function(){u&&(l.setFieldValue(["config","usingAssignFormSchema"],void 0),l.setFieldValue(["config","assignFormSchema"],void 0))},[u,l]),a().createElement(a().Fragment,null,a().createElement(o.Form.Item,{name:["config","params","values"],label:n("Fields values"),extra:n("Unassigned fields will be set to default values, and those without default values will be set to null.")},a().createElement(s.XH,{collection:u,disabled:d})),u?a().createElement(o.Form.Item,{name:["config","params","appends"],label:n("Preload associations"),extra:n("Please select the associated fields that need to be accessed in subsequent nodes. With more than two levels of to-many associations may cause performance issue, please use with caution.")},a().createElement(s.Kr,{collection:u})):null)}function d(){var e,n=(0,i.TA)(),l=o.Form.useFormInstance();return a().createElement(a().Fragment,null,a().createElement(r.F,{disabled:!!(null==n||null==(e=n.config)?void 0:e.collection),onCollectionChanged:function(){l.setFieldValue(["config","params"],{}),l.setFieldValue(["config","usingAssignFormSchema"],void 0),l.setFieldValue(["config","assignFormSchema"],void 0)}}),a().createElement(u,null))}function m(){return a().createElement(r.F,null)}}}]);