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

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 (116) hide show
  1. package/dist/client/142.ffce610ff4faa187.js +10 -0
  2. package/dist/client/276.c2cea2710b05299f.js +10 -0
  3. package/dist/client/{382.d37fba14a6b91b0b.js → 382.99626aff85e3c6d5.js} +1 -1
  4. package/dist/client/{394.a37310b78419ad7a.js → 394.e1ae8030362ba71d.js} +1 -1
  5. package/dist/client/438.255c1f798203a3fc.js +10 -0
  6. package/dist/client/509.280de53e5e3e8874.js +10 -0
  7. package/dist/client/{54.d81b710f7b4c1cd5.js → 54.e47d7f0ea7ee3688.js} +1 -1
  8. package/dist/client/{618.1aa6c21d0f2840cb.js → 618.3a1c7678cb08cbe0.js} +1 -1
  9. package/dist/client/635.870ba51b25218741.js +10 -0
  10. package/dist/client/{67.56a3d15a55ab7d5c.js → 67.fc770d56b2c34497.js} +1 -1
  11. package/dist/client/719.0ad4a535dd22f3ff.js +10 -0
  12. package/dist/client/728.f57b6314d6786870.js +10 -0
  13. package/dist/client/828.eda52a8918f0a56c.js +10 -0
  14. package/dist/client/{938.26493fc09ba1ccbc.js → 938.fd73c40b34b25d64.js} +1 -1
  15. package/dist/client/{964.5ab736effd480a42.js → 964.618e49037c20a31b.js} +1 -1
  16. package/dist/client/WorkflowTasks.d.ts +5 -4
  17. package/dist/client/components/UsersSelect.d.ts +2 -9
  18. package/dist/client/index.d.ts +1 -1
  19. package/dist/client/index.js +1 -1
  20. package/dist/client/workflowTasksResponsive.d.ts +14 -0
  21. package/dist/client-v2/142.0f6a2edf05cbda44.js +10 -0
  22. package/dist/client-v2/276.534cc7e9c2515739.js +10 -0
  23. package/dist/client-v2/32.3aff0d3127924f37.js +10 -0
  24. package/dist/client-v2/{382.05f5482bb512b179.js → 382.df2386151a0de313.js} +1 -1
  25. package/dist/client-v2/394.0eb5d5430b5418ac.js +10 -0
  26. package/dist/client-v2/438.76337ed02ad35e77.js +10 -0
  27. package/dist/client-v2/513.028d9992cc415e73.js +10 -0
  28. package/dist/client-v2/54.3ee650a12f10be1f.js +10 -0
  29. package/dist/client-v2/635.d2d2912b1f5e9fb1.js +10 -0
  30. package/dist/client-v2/677.687ffa76229d7e48.js +10 -0
  31. package/dist/client-v2/719.c0aba991ec406006.js +10 -0
  32. package/dist/client-v2/938.371ea064789aadbc.js +10 -0
  33. package/dist/client-v2/canvas/WorkflowVariableInput.d.ts +9 -2
  34. package/dist/client-v2/canvas/WorkflowVariableTextArea.d.ts +6 -1
  35. package/dist/client-v2/components/FilterDynamicComponent.d.ts +4 -1
  36. package/dist/client-v2/components/UsersSelect.d.ts +39 -0
  37. package/dist/client-v2/components/collection/AssociationValueInput.d.ts +19 -0
  38. package/dist/client-v2/constants.d.ts +4 -0
  39. package/dist/client-v2/index.d.ts +2 -0
  40. package/dist/client-v2/index.js +1 -1
  41. package/dist/client-v2/taskCenter.d.ts +3 -1
  42. package/dist/common/collections/jobs.d.ts +3 -0
  43. package/dist/common/collections/jobs.js +4 -3
  44. package/dist/common/collections/userWorkflowTaskStats.d.ts +54 -0
  45. package/dist/common/collections/userWorkflowTaskStats.js +87 -0
  46. package/dist/externalVersion.js +14 -14
  47. package/dist/locale/de-DE.json +2 -0
  48. package/dist/locale/en-US.json +6 -0
  49. package/dist/locale/es-ES.json +2 -0
  50. package/dist/locale/fr-FR.json +2 -0
  51. package/dist/locale/hu-HU.json +2 -0
  52. package/dist/locale/id-ID.json +2 -0
  53. package/dist/locale/it-IT.json +2 -0
  54. package/dist/locale/ja-JP.json +2 -0
  55. package/dist/locale/ko-KR.json +2 -0
  56. package/dist/locale/nl-NL.json +2 -0
  57. package/dist/locale/pt-BR.json +2 -0
  58. package/dist/locale/ru-RU.json +2 -0
  59. package/dist/locale/tr-TR.json +2 -0
  60. package/dist/locale/uk-UA.json +2 -0
  61. package/dist/locale/vi-VN.json +2 -0
  62. package/dist/locale/zh-CN.json +6 -0
  63. package/dist/locale/zh-TW.json +2 -0
  64. package/dist/node_modules/cron-parser/package.json +1 -1
  65. package/dist/node_modules/joi/package.json +1 -1
  66. package/dist/node_modules/lru-cache/package.json +1 -1
  67. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  68. package/dist/server/Dispatcher.d.ts +24 -13
  69. package/dist/server/Dispatcher.js +160 -143
  70. package/dist/server/Plugin.d.ts +58 -12
  71. package/dist/server/Plugin.js +356 -16
  72. package/dist/server/Processor.d.ts +2 -7
  73. package/dist/server/Processor.js +37 -18
  74. package/dist/server/RunningExecutionRegistry.d.ts +2 -2
  75. package/dist/server/RunningExecutionRegistry.js +21 -6
  76. package/dist/server/actions/executions.js +3 -6
  77. package/dist/server/actions/index.js +3 -1
  78. package/dist/server/actions/jobs.js +1 -2
  79. package/dist/server/{migrations/20260713000000-remove-workflow-validation.d.ts → actions/userWorkflowTaskStats.d.ts} +2 -5
  80. package/dist/server/actions/userWorkflowTaskStats.js +112 -0
  81. package/dist/server/actions/workflows.js +18 -1
  82. package/dist/server/collections/userWorkflowTaskStats.d.ts +11 -0
  83. package/dist/server/collections/userWorkflowTaskStats.js +43 -0
  84. package/dist/server/index.d.ts +1 -0
  85. package/dist/server/triggers/CollectionTrigger.js +2 -2
  86. package/dist/server/triggers/ScheduleTrigger/StaticScheduleTrigger.js +8 -7
  87. package/dist/server/types/Execution.d.ts +2 -0
  88. package/dist/server/types/Job.d.ts +6 -0
  89. package/dist/server/utils.d.ts +1 -0
  90. package/dist/server/utils.js +5 -0
  91. package/dist/shared/WorkflowTaskNavigation.d.ts +56 -0
  92. package/dist/shared/WorkflowTaskNavigation.js +750 -0
  93. package/dist/swagger/index.d.ts +68 -1
  94. package/dist/swagger/index.js +61 -1
  95. package/package.json +2 -2
  96. package/dist/client/142.fb4936d78fc80007.js +0 -10
  97. package/dist/client/276.69fb2aea13bc7c37.js +0 -10
  98. package/dist/client/438.6c6409d821d8c353.js +0 -10
  99. package/dist/client/509.88792f5bd054b2af.js +0 -10
  100. package/dist/client/635.ff6085589e23d39b.js +0 -10
  101. package/dist/client/719.f011fde3ad54571e.js +0 -10
  102. package/dist/client/728.711fd4f1ed7d4e6a.js +0 -10
  103. package/dist/client/828.6880ab21513b1968.js +0 -10
  104. package/dist/client/972.dd7f074d5f12e171.js +0 -10
  105. package/dist/client-v2/142.a8c8df2a9abb43c5.js +0 -10
  106. package/dist/client-v2/276.7f746d899e221e2f.js +0 -10
  107. package/dist/client-v2/394.515ed058e7f72797.js +0 -10
  108. package/dist/client-v2/438.b7df0416b66f8f64.js +0 -10
  109. package/dist/client-v2/513.617697f74783a611.js +0 -10
  110. package/dist/client-v2/54.d3daf06e53092726.js +0 -10
  111. package/dist/client-v2/635.14a6f21cf4f16345.js +0 -10
  112. package/dist/client-v2/677.7382807126d9621a.js +0 -10
  113. package/dist/client-v2/719.05cf070ef89a78f4.js +0 -10
  114. package/dist/client-v2/728.4e8322ff8fce87b9.js +0 -10
  115. package/dist/client-v2/938.717e47af39485b29.js +0 -10
  116. package/dist/server/migrations/20260713000000-remove-workflow-validation.js +0 -56
@@ -21,6 +21,7 @@
21
21
  * the converters here just join/split that path inside `{{ }}`.
22
22
  */
23
23
  import React from 'react';
24
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
24
25
  import { type UseWorkflowVariableOptions } from './useWorkflowVariableOptions';
25
26
  export type WorkflowVariableInputProps = {
26
27
  value?: string;
@@ -34,7 +35,13 @@ export type WorkflowVariableInputProps = {
34
35
  * `Form.Item` the status is inherited automatically. */
35
36
  status?: 'error' | 'warning';
36
37
  /** Variable-tree options forwarded to each upstream `useVariables` (types
37
- * filter, appends, depth, fieldNames). */
38
+ * filter, appends, depth, fieldNames). Ignored when `metaTree` is given. */
38
39
  variableOptions?: UseWorkflowVariableOptions;
40
+ /** An explicit variable tree, replacing the canvas-derived one. Pass this
41
+ * outside the workflow canvas — e.g. the approval message template manager,
42
+ * where the renderer's scope is fixed by the server, not by upstream nodes.
43
+ * An empty array is honoured as "no variables"; omit the prop to fall back
44
+ * to the canvas tree. */
45
+ metaTree?: MetaTreeNode[];
39
46
  };
40
- export declare function WorkflowVariableInput(props: WorkflowVariableInputProps): React.JSX.Element;
47
+ export declare function WorkflowVariableInput({ metaTree, variableOptions, ...props }: WorkflowVariableInputProps): React.JSX.Element;
@@ -7,12 +7,17 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import type { TextAreaProps } from 'antd/es/input';
10
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
10
11
  import React from 'react';
11
12
  import { type UseWorkflowVariableOptions } from './useWorkflowVariableOptions';
12
13
  export interface WorkflowVariableTextAreaProps extends Omit<TextAreaProps, 'value' | 'onChange'> {
13
14
  value?: string;
14
15
  onChange?: (value: string) => void;
16
+ /** Ignored when `metaTree` is given. */
15
17
  variableOptions?: UseWorkflowVariableOptions;
18
+ /** An explicit variable tree, replacing the canvas-derived one. See
19
+ * `WorkflowVariableInput` for when to reach for this. */
20
+ metaTree?: MetaTreeNode[];
16
21
  delimiters?: readonly [string, string];
17
22
  }
18
- export declare function WorkflowVariableTextArea(props: WorkflowVariableTextAreaProps): React.JSX.Element;
23
+ export declare function WorkflowVariableTextArea({ metaTree, variableOptions, ...props }: WorkflowVariableTextAreaProps): React.JSX.Element;
@@ -6,8 +6,9 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
9
10
  import React from 'react';
10
- export declare function FilterDynamicComponent({ collection, value, onChange, disabled, rightAsVariable, maxAssociationFieldDepth, }: {
11
+ export declare function FilterDynamicComponent({ collection, value, onChange, disabled, rightAsVariable, maxAssociationFieldDepth, transformVariableOptions, includeDateRangeVariable, }: {
11
12
  collection?: string;
12
13
  value?: Record<string, unknown> | null;
13
14
  onChange?: (value: Record<string, unknown> | null) => void;
@@ -23,6 +24,8 @@ export declare function FilterDynamicComponent({ collection, value, onChange, di
23
24
  * Defaults to `2` to match the legacy v1 workflow filter behaviour.
24
25
  */
25
26
  maxAssociationFieldDepth?: number;
27
+ transformVariableOptions?: (options: MetaTreeNode[]) => MetaTreeNode[];
28
+ includeDateRangeVariable?: boolean;
26
29
  }): React.JSX.Element;
27
30
  export declare const ConditionField: typeof FilterDynamicComponent;
28
31
  export default FilterDynamicComponent;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { type MetaTreeNode } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ export type UserOption = {
12
+ id: number | string;
13
+ nickname?: string;
14
+ };
15
+ export type UserQueryValue = {
16
+ filter?: Record<string, unknown>;
17
+ };
18
+ export type UserSelectValue = number | string | UserQueryValue;
19
+ type WorkflowFieldLike = {
20
+ collectionName?: string;
21
+ isForeignKey?: boolean;
22
+ name?: string;
23
+ target?: string;
24
+ type?: string;
25
+ };
26
+ export type UsersSelectProps = {
27
+ disabled?: boolean;
28
+ dropdownFooter?: React.ReactNode;
29
+ nullable?: boolean;
30
+ includeDateRangeVariable?: boolean;
31
+ onChange?: (next: UserSelectValue) => void;
32
+ popupClassName?: string;
33
+ transformVariableOptions?: (options: MetaTreeNode[]) => MetaTreeNode[];
34
+ value?: UserSelectValue | null;
35
+ variableOptions?: MetaTreeNode[];
36
+ };
37
+ export declare function isUserKeyField(field: WorkflowFieldLike): boolean;
38
+ export declare function UsersSelect({ variableOptions, ...props }: UsersSelectProps): React.JSX.Element;
39
+ export default UsersSelect;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import { type CollectionTriggerField } from './utils';
11
+ export declare function AssociationValueInput({ collection, field, value, onChange, disabled, }: {
12
+ collection: string;
13
+ field: CollectionTriggerField & {
14
+ name: string;
15
+ };
16
+ value: unknown;
17
+ onChange: (value: unknown) => void;
18
+ disabled?: boolean;
19
+ }): React.JSX.Element;
@@ -8,9 +8,13 @@
8
8
  */
9
9
  export declare const WORKFLOW_CANVAS_ROUTE_NAME = "admin.workflow.workflows.id";
10
10
  export declare const WORKFLOW_CANVAS_ROUTE_PATH = "/admin/workflow/workflows/:id";
11
+ export declare const WORKFLOW_CANVAS_SETTINGS_ROUTE_NAME = "admin.workflow.settings.workflows.id";
12
+ export declare const WORKFLOW_CANVAS_SETTINGS_ROUTE_PATH = "/admin/settings/workflow/workflows/:id";
11
13
  export declare function getWorkflowCanvasPath(id: string | number): string;
12
14
  export declare const WORKFLOW_EXECUTION_ROUTE_NAME = "admin.workflow.executions.id";
13
15
  export declare const WORKFLOW_EXECUTION_ROUTE_PATH = "/admin/workflow/executions/:id";
16
+ export declare const WORKFLOW_EXECUTION_SETTINGS_ROUTE_NAME = "admin.workflow.settings.executions.id";
17
+ export declare const WORKFLOW_EXECUTION_SETTINGS_ROUTE_PATH = "/admin/settings/workflow/executions/:id";
14
18
  export declare function getWorkflowExecutionPath(id: string | number): string;
15
19
  export declare const WORKFLOW_TASKS_ROUTE_NAME = "admin.workflow.tasks";
16
20
  export declare const WORKFLOW_TASKS_ROUTE_PATH = "/admin/workflow/tasks/:taskType?/:status?/:popupId?";
@@ -46,3 +46,5 @@ export { Trigger } from './triggers';
46
46
  export type { LoaderOf as TriggerLoaderOf, TriggerTempAssociationSource } from './triggers';
47
47
  export * from './components/collection';
48
48
  export { FilterDynamicComponent, ConditionField } from './components/FilterDynamicComponent';
49
+ export { UsersSelect, isUserKeyField } from './components/UsersSelect';
50
+ export type { UsersSelectProps, UserSelectValue, UserQueryValue, UserOption } from './components/UsersSelect';