@nocobase/plugin-workflow 0.21.0-alpha.9 → 1.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/client/AddButton.d.ts +8 -0
  2. package/dist/client/Branch.d.ts +8 -0
  3. package/dist/client/CanvasContent.d.ts +8 -0
  4. package/dist/client/ExecutionCanvas.d.ts +8 -0
  5. package/dist/client/ExecutionContextProvider.d.ts +8 -0
  6. package/dist/client/ExecutionLink.d.ts +8 -0
  7. package/dist/client/ExecutionPage.d.ts +8 -0
  8. package/dist/client/ExecutionResourceProvider.d.ts +8 -0
  9. package/dist/client/FlowContext.d.ts +8 -0
  10. package/dist/client/WorkflowCanvas.d.ts +8 -0
  11. package/dist/client/WorkflowLink.d.ts +8 -0
  12. package/dist/client/WorkflowPage.d.ts +8 -0
  13. package/dist/client/WorkflowPane.d.ts +8 -0
  14. package/dist/client/components/CheckboxGroupWithTooltip.d.ts +8 -0
  15. package/dist/client/components/CollectionBlockInitializer.d.ts +8 -0
  16. package/dist/client/components/CollectionFieldset.d.ts +8 -0
  17. package/dist/client/components/DetailsBlockProvider.d.ts +8 -0
  18. package/dist/client/components/DrawerDescription.d.ts +8 -0
  19. package/dist/client/components/DrawerForm.d.ts +8 -0
  20. package/dist/client/components/ExecutionStatus.d.ts +8 -0
  21. package/dist/client/components/FieldsSelect.d.ts +8 -0
  22. package/dist/client/components/FilterDynamicComponent.d.ts +8 -0
  23. package/dist/client/components/OpenDrawer.d.ts +8 -0
  24. package/dist/client/components/RadioWithTooltip.d.ts +8 -0
  25. package/dist/client/components/SimpleDesigner.d.ts +8 -0
  26. package/dist/client/components/StatusButton.d.ts +8 -0
  27. package/dist/client/components/TriggerOptionRender.d.ts +8 -0
  28. package/dist/client/components/ValueBlock.d.ts +8 -0
  29. package/dist/client/components/index.d.ts +8 -0
  30. package/dist/client/components/renderEngineReference.d.ts +8 -0
  31. package/dist/client/constants.d.ts +8 -0
  32. package/dist/client/hooks/index.d.ts +8 -0
  33. package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +8 -0
  34. package/dist/client/hooks/useRefreshActionProps.d.ts +8 -0
  35. package/dist/client/hooks/useTriggerWorkflowActionProps.d.ts +14 -0
  36. package/dist/client/hooks/useWorkflowExecuted.d.ts +8 -0
  37. package/dist/client/index.d.ts +8 -0
  38. package/dist/client/index.js +29 -20
  39. package/dist/client/locale/index.d.ts +8 -0
  40. package/dist/client/nodes/calculation.d.ts +8 -0
  41. package/dist/client/nodes/condition.d.ts +8 -0
  42. package/dist/client/nodes/create.d.ts +8 -0
  43. package/dist/client/nodes/destroy.d.ts +8 -0
  44. package/dist/client/nodes/end.d.ts +8 -0
  45. package/dist/client/nodes/index.d.ts +8 -0
  46. package/dist/client/nodes/query.d.ts +8 -0
  47. package/dist/client/nodes/update.d.ts +8 -0
  48. package/dist/client/schemas/collection.d.ts +8 -0
  49. package/dist/client/schemas/executions.d.ts +8 -0
  50. package/dist/client/schemas/workflows.d.ts +8 -0
  51. package/dist/client/settings/customizeSubmitToWorkflowActionSettings.d.ts +8 -0
  52. package/dist/client/style.d.ts +8 -0
  53. package/dist/client/triggers/collection.d.ts +8 -0
  54. package/dist/client/triggers/index.d.ts +8 -0
  55. package/dist/client/triggers/schedule/EndsByField.d.ts +8 -0
  56. package/dist/client/triggers/schedule/OnField.d.ts +8 -0
  57. package/dist/client/triggers/schedule/RepeatField.d.ts +8 -0
  58. package/dist/client/triggers/schedule/ScheduleConfig.d.ts +8 -0
  59. package/dist/client/triggers/schedule/constants.d.ts +8 -0
  60. package/dist/client/triggers/schedule/index.d.ts +8 -0
  61. package/dist/client/triggers/schedule/locale/Cron.zh-CN.d.ts +8 -0
  62. package/dist/client/utils.d.ts +8 -0
  63. package/dist/client/variable.d.ts +8 -0
  64. package/dist/externalVersion.js +19 -10
  65. package/dist/index.d.ts +8 -0
  66. package/dist/index.js +9 -0
  67. package/dist/locale/zh-CN.json +4 -3
  68. package/dist/node_modules/cron-parser/package.json +1 -1
  69. package/dist/node_modules/lru-cache/package.json +1 -1
  70. package/dist/server/Plugin.d.ts +15 -3
  71. package/dist/server/Plugin.js +62 -33
  72. package/dist/server/Processor.d.ts +8 -0
  73. package/dist/server/Processor.js +9 -0
  74. package/dist/server/actions/executions.d.ts +8 -0
  75. package/dist/server/actions/executions.js +9 -0
  76. package/dist/server/actions/index.d.ts +8 -0
  77. package/dist/server/actions/index.js +9 -0
  78. package/dist/server/actions/nodes.d.ts +8 -0
  79. package/dist/server/actions/nodes.js +9 -0
  80. package/dist/server/actions/workflows.d.ts +8 -0
  81. package/dist/server/actions/workflows.js +9 -0
  82. package/dist/server/collections/executions.d.ts +8 -0
  83. package/dist/server/collections/executions.js +14 -0
  84. package/dist/server/collections/flow_nodes.d.ts +8 -0
  85. package/dist/server/collections/flow_nodes.js +9 -0
  86. package/dist/server/collections/jobs.d.ts +8 -0
  87. package/dist/server/collections/jobs.js +9 -0
  88. package/dist/server/collections/workflows.d.ts +8 -0
  89. package/dist/server/collections/workflows.js +9 -0
  90. package/dist/server/constants.d.ts +8 -0
  91. package/dist/server/constants.js +9 -0
  92. package/dist/server/functions/index.d.ts +8 -0
  93. package/dist/server/functions/index.js +9 -0
  94. package/dist/server/index.d.ts +8 -0
  95. package/dist/server/index.js +9 -0
  96. package/dist/server/instructions/CalculationInstruction.d.ts +8 -0
  97. package/dist/server/instructions/CalculationInstruction.js +9 -0
  98. package/dist/server/instructions/ConditionInstruction.d.ts +8 -0
  99. package/dist/server/instructions/ConditionInstruction.js +9 -0
  100. package/dist/server/instructions/CreateInstruction.d.ts +8 -0
  101. package/dist/server/instructions/CreateInstruction.js +9 -0
  102. package/dist/server/instructions/DestroyInstruction.d.ts +8 -0
  103. package/dist/server/instructions/DestroyInstruction.js +9 -0
  104. package/dist/server/instructions/EndInstruction.d.ts +8 -0
  105. package/dist/server/instructions/EndInstruction.js +9 -0
  106. package/dist/server/instructions/QueryInstruction.d.ts +8 -0
  107. package/dist/server/instructions/QueryInstruction.js +9 -0
  108. package/dist/server/instructions/UpdateInstruction.d.ts +8 -0
  109. package/dist/server/instructions/UpdateInstruction.js +9 -0
  110. package/dist/server/instructions/index.d.ts +8 -0
  111. package/dist/server/instructions/index.js +9 -0
  112. package/dist/server/migrations/20221129153547-calculation-variables.d.ts +8 -0
  113. package/dist/server/migrations/20221129153547-calculation-variables.js +9 -0
  114. package/dist/server/migrations/20230221032941-change-request-body-type.d.ts +8 -0
  115. package/dist/server/migrations/20230221032941-change-request-body-type.js +9 -0
  116. package/dist/server/migrations/20230221071831-calculation-expression.d.ts +8 -0
  117. package/dist/server/migrations/20230221071831-calculation-expression.js +9 -0
  118. package/dist/server/migrations/20230221121203-condition-calculation.d.ts +8 -0
  119. package/dist/server/migrations/20230221121203-condition-calculation.js +9 -0
  120. package/dist/server/migrations/20230221162902-jsonb-to-json.d.ts +8 -0
  121. package/dist/server/migrations/20230221162902-jsonb-to-json.js +9 -0
  122. package/dist/server/migrations/20230411034722-manual-multi-form.d.ts +8 -0
  123. package/dist/server/migrations/20230411034722-manual-multi-form.js +9 -0
  124. package/dist/server/migrations/20230612021134-manual-collection-block.d.ts +8 -0
  125. package/dist/server/migrations/20230612021134-manual-collection-block.js +9 -0
  126. package/dist/server/migrations/20230710115902-manual-action-values.d.ts +8 -0
  127. package/dist/server/migrations/20230710115902-manual-action-values.js +9 -0
  128. package/dist/server/migrations/20230809113132-workflow-options.d.ts +8 -0
  129. package/dist/server/migrations/20230809113132-workflow-options.js +9 -0
  130. package/dist/server/migrations/20231024172342-add-node-key.d.ts +8 -0
  131. package/dist/server/migrations/20231024172342-add-node-key.js +9 -0
  132. package/dist/server/migrations/20231122143143-split-to-plugins.d.ts +8 -0
  133. package/dist/server/migrations/20231122143143-split-to-plugins.js +9 -0
  134. package/dist/server/migrations/20240115220721-add-node-key-to-job.d.ts +8 -0
  135. package/dist/server/migrations/20240115220721-add-node-key-to-job.js +9 -0
  136. package/dist/server/triggers/CollectionTrigger.d.ts +8 -0
  137. package/dist/server/triggers/CollectionTrigger.js +9 -0
  138. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.d.ts +8 -0
  139. package/dist/server/triggers/ScheduleTrigger/DateFieldScheduleTrigger.js +21 -6
  140. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.d.ts +13 -7
  141. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +12 -2
  142. package/dist/server/triggers/ScheduleTrigger/index.d.ts +8 -3
  143. package/dist/server/triggers/ScheduleTrigger/index.js +22 -12
  144. package/dist/server/triggers/ScheduleTrigger/utils.d.ts +8 -0
  145. package/dist/server/triggers/ScheduleTrigger/utils.js +9 -0
  146. package/dist/server/triggers/index.d.ts +8 -0
  147. package/dist/server/triggers/index.js +9 -0
  148. package/dist/server/types/Execution.d.ts +8 -0
  149. package/dist/server/types/Execution.js +9 -0
  150. package/dist/server/types/FlowNode.d.ts +8 -0
  151. package/dist/server/types/FlowNode.js +9 -0
  152. package/dist/server/types/Job.d.ts +8 -0
  153. package/dist/server/types/Job.js +9 -0
  154. package/dist/server/types/Workflow.d.ts +8 -0
  155. package/dist/server/types/Workflow.js +9 -0
  156. package/dist/server/types/index.d.ts +8 -0
  157. package/dist/server/types/index.js +9 -0
  158. package/dist/server/utils.d.ts +8 -0
  159. package/dist/server/utils.js +9 -0
  160. package/dist/swagger/index.d.ts +8 -0
  161. package/dist/swagger/index.js +9 -0
  162. package/package.json +15 -15
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Migration } from '@nocobase/server';
2
10
  export default class extends Migration {
3
11
  appVersion: string;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Transactionable } from '@nocobase/database';
2
10
  import Trigger from '.';
3
11
  import type { WorkflowModel } from '../types';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Transactionable } from '@nocobase/database';
2
10
  import type Plugin from '../../Plugin';
3
11
  import type { WorkflowModel } from '../../types';
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -289,12 +298,18 @@ class ScheduleTrigger {
289
298
  appends: workflow.config.appends,
290
299
  transaction
291
300
  });
292
- const key = `${workflow.id}:${recordPk}@${nextTime}`;
293
- this.cache.delete(key);
294
- this.workflow.trigger(workflow, {
295
- data: data.toJSON(),
296
- date: new Date(nextTime)
297
- });
301
+ const eventKey = `${workflow.id}:${recordPk}@${nextTime}`;
302
+ this.cache.delete(eventKey);
303
+ this.workflow.trigger(
304
+ workflow,
305
+ {
306
+ data: data.toJSON(),
307
+ date: new Date(nextTime)
308
+ },
309
+ {
310
+ eventKey
311
+ }
312
+ );
298
313
  if (!workflow.config.repeat || workflow.config.limit && workflow.allExecuted >= workflow.config.limit - 1) {
299
314
  return;
300
315
  }
@@ -1,15 +1,21 @@
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
+ */
1
9
  import type Plugin from '../../Plugin';
10
+ import { WorkflowModel } from '../../types';
2
11
  export default class StaticScheduleTrigger {
3
12
  workflow: Plugin;
4
13
  private timers;
5
14
  constructor(workflow: Plugin);
6
- inspect(workflows: any): void;
7
- getNextTime({ config, allExecuted }: {
8
- config: any;
9
- allExecuted: any;
10
- }, currentDate: any, nextSecond?: boolean): any;
11
- schedule(workflow: any, nextTime: any, toggle?: boolean): void;
12
- trigger(workflow: any, time: any): Promise<void>;
15
+ inspect(workflows: WorkflowModel[]): void;
16
+ getNextTime({ config, allExecuted }: WorkflowModel, currentDate: Date, nextSecond?: boolean): number;
17
+ schedule(workflow: WorkflowModel, nextTime: number, toggle?: boolean): void;
18
+ trigger(workflow: WorkflowModel, time: number): Promise<void>;
13
19
  on(workflow: any): void;
14
20
  off(workflow: any): void;
15
21
  }
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -124,8 +133,9 @@ class StaticScheduleTrigger {
124
133
  }
125
134
  }
126
135
  async trigger(workflow, time) {
127
- this.timers.delete(`${workflow.id}@${time}`);
128
- this.workflow.trigger(workflow, { date: new Date(time) });
136
+ const eventKey = `${workflow.id}@${time}`;
137
+ this.timers.delete(eventKey);
138
+ this.workflow.trigger(workflow, { date: new Date(time) }, { eventKey });
129
139
  if (!workflow.config.repeat || workflow.config.limit && workflow.allExecuted >= workflow.config.limit - 1) {
130
140
  return;
131
141
  }
@@ -1,7 +1,13 @@
1
- import { Transactionable } from 'sequelize';
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
+ */
2
9
  import Trigger from '..';
3
10
  import type Plugin from '../../Plugin';
4
- import { WorkflowModel } from '../../types';
5
11
  export default class ScheduleTrigger extends Trigger {
6
12
  sync: boolean;
7
13
  private modes;
@@ -9,5 +15,4 @@ export default class ScheduleTrigger extends Trigger {
9
15
  private getTrigger;
10
16
  on(workflow: any): void;
11
17
  off(workflow: any): void;
12
- validateEvent(workflow: WorkflowModel, context: any, options: Transactionable): Promise<boolean>;
13
18
  }
@@ -1,3 +1,12 @@
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
+
1
10
  var __create = Object.create;
2
11
  var __defProp = Object.defineProperty;
3
12
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -59,16 +68,17 @@ class ScheduleTrigger extends import__.default {
59
68
  trigger.off(workflow);
60
69
  }
61
70
  }
62
- async validateEvent(workflow, context, options) {
63
- if (!context.date) {
64
- return false;
65
- }
66
- const existed = await workflow.countExecutions({
67
- where: {
68
- "context.date": context.date
69
- },
70
- transaction: options.transaction
71
- });
72
- return !existed;
73
- }
71
+ // async validateEvent(workflow: WorkflowModel, context: any, options: Transactionable): Promise<boolean> {
72
+ // if (!context.date) {
73
+ // return false;
74
+ // }
75
+ // const existed = await workflow.getExecutions({
76
+ // attributes: ['id'],
77
+ // where: {
78
+ // 'context.date': context.date instanceof Date ? context.date.toISOString() : context.date,
79
+ // },
80
+ // transaction: options.transaction,
81
+ // });
82
+ // return !existed.length;
83
+ // }
74
84
  }
@@ -1,3 +1,11 @@
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
+ */
1
9
  export declare const SCHEDULE_MODE: {
2
10
  readonly STATIC: 0;
3
11
  readonly DATE_FIELD: 1;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Transactionable } from '@nocobase/database';
2
10
  import type Plugin from '../Plugin';
3
11
  import type { WorkflowModel } from '../types';
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { BelongsToGetAssociationMixin, Database, HasManyGetAssociationsMixin, Model } from '@nocobase/database';
2
10
  import JobModel from './Job';
3
11
  import WorkflowModel from './Workflow';
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { BelongsToGetAssociationMixin, Database, Model } from '@nocobase/database';
2
10
  import WorkflowModel from './Workflow';
3
11
  export default class FlowNodeModel extends Model {
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { BelongsToGetAssociationMixin, Model } from '@nocobase/database';
2
10
  import FlowNodeModel from './FlowNode';
3
11
  export default class JobModel extends Model {
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  import { Database, HasManyCountAssociationsMixin, HasManyCreateAssociationMixin, HasManyGetAssociationsMixin, Model } from '@nocobase/database';
2
10
  import ExecutionModel from './Execution';
3
11
  import FlowNodeModel from './FlowNode';
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  export type { default as WorkflowModel } from './Workflow';
2
10
  export type { default as FlowNodeModel } from './FlowNode';
3
11
  export type { default as ExecutionModel } from './Execution';
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
1
9
  export declare function toJSON(data: any): any;
@@ -1,3 +1,12 @@
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
+
1
10
  var __defProp = Object.defineProperty;
2
11
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
12
  var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -1,3 +1,11 @@
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
+ */
1
9
  declare const _default: {
2
10
  openapi: string;
3
11
  info: {