@nocobase/plugin-workflow 0.14.0-alpha.7 → 0.15.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/client/AddButton.d.ts +2 -1
  2. package/dist/client/Branch.d.ts +4 -2
  3. package/dist/client/WorkflowProvider.d.ts +1 -0
  4. package/dist/client/constant.d.ts +2 -0
  5. package/dist/client/constants.d.ts +2 -0
  6. package/dist/client/hooks/useGetAriaLabelOfAddButton.d.ts +6 -0
  7. package/dist/client/index.d.ts +8 -2
  8. package/dist/client/index.js +138 -120
  9. package/dist/client/nodes/aggregate.d.ts +3 -3
  10. package/dist/client/nodes/calculation.d.ts +21 -7
  11. package/dist/client/nodes/create.d.ts +3 -2
  12. package/dist/client/nodes/index.d.ts +2 -2
  13. package/dist/client/nodes/loop.d.ts +4 -5
  14. package/dist/client/nodes/manual/SchemaConfig.d.ts +1 -1
  15. package/dist/client/nodes/manual/index.d.ts +3 -3
  16. package/dist/client/nodes/query.d.ts +5 -5
  17. package/dist/client/nodes/request.d.ts +15 -10
  18. package/dist/client/nodes/sql.d.ts +11 -2
  19. package/dist/client/schemas/collection.d.ts +1 -1
  20. package/dist/client/triggers/collection.d.ts +1 -0
  21. package/dist/client/triggers/form.d.ts +2 -0
  22. package/dist/client/triggers/index.d.ts +4 -0
  23. package/dist/client/variable.d.ts +20 -3
  24. package/dist/externalVersion.js +9 -10
  25. package/dist/locale/zh-CN.d.ts +5 -3
  26. package/dist/locale/zh-CN.js +5 -3
  27. package/dist/node_modules/cron-parser/package.json +1 -1
  28. package/dist/node_modules/lru-cache/package.json +1 -1
  29. package/dist/server/Plugin.js +4 -1
  30. package/dist/server/Processor.d.ts +4 -4
  31. package/dist/server/Processor.js +9 -6
  32. package/dist/server/actions/workflows.d.ts +1 -0
  33. package/dist/server/actions/workflows.js +13 -52
  34. package/dist/server/collections/flow_nodes.js +4 -0
  35. package/dist/server/constants.d.ts +2 -0
  36. package/dist/server/constants.js +4 -2
  37. package/dist/server/index.d.ts +1 -0
  38. package/dist/server/index.js +2 -0
  39. package/dist/server/instructions/index.d.ts +3 -1
  40. package/dist/server/migrations/20230221162902-jsonb-to-json.js +0 -16
  41. package/dist/server/migrations/20230809113132-workflow-options.js +5 -2
  42. package/dist/server/migrations/20231024172342-add-node-key.d.ts +4 -0
  43. package/dist/server/migrations/20231024172342-add-node-key.js +80 -0
  44. package/dist/server/triggers/form.d.ts +3 -3
  45. package/dist/server/triggers/form.js +15 -11
  46. package/dist/server/triggers/index.d.ts +2 -0
  47. package/dist/server/triggers/index.js +1 -1
  48. package/dist/server/triggers/schedule.js +2 -2
  49. package/dist/server/utils.js +5 -4
  50. package/package.json +2 -3
@@ -177,8 +177,8 @@ declare const _default: {
177
177
  };
178
178
  AssociatedConfig: typeof AssociatedConfig;
179
179
  };
180
- useVariables({ id, title }: {
181
- id: any;
180
+ useVariables({ key, title }: {
181
+ key: any;
182
182
  title: any;
183
183
  }, { types, fieldNames }: {
184
184
  types: any;
@@ -188,7 +188,7 @@ declare const _default: {
188
188
  readonly children: "children";
189
189
  };
190
190
  }): {
191
- value: string;
191
+ value: any;
192
192
  label: any;
193
193
  };
194
194
  useInitializers(node: any): SchemaInitializerItemOptions | null;
@@ -1,6 +1,7 @@
1
1
  import { SchemaInitializerItemOptions } from '@nocobase/client';
2
2
  import React from 'react';
3
3
  import { RadioWithTooltip } from '../components/RadioWithTooltip';
4
+ import { WorkflowVariableInput, WorkflowVariableTextArea } from '../variable';
4
5
  declare const _default: {
5
6
  title: string;
6
7
  type: string;
@@ -36,6 +37,9 @@ declare const _default: {
36
37
  title: string;
37
38
  'x-decorator': string;
38
39
  'x-component': string;
40
+ 'x-component-props': {
41
+ changeOnSelect: boolean;
42
+ };
39
43
  "x-validator"(value: any, rules: any, { form }: {
40
44
  form: any;
41
45
  }): string;
@@ -65,6 +69,15 @@ declare const _default: {
65
69
  'x-component': string;
66
70
  'x-component-props': {
67
71
  changeOnSelect: boolean;
72
+ variableOptions: {
73
+ types: {
74
+ type: string;
75
+ options: {
76
+ collection: string;
77
+ entity: boolean;
78
+ };
79
+ }[];
80
+ };
68
81
  };
69
82
  'x-reactions': {
70
83
  dependencies: string[];
@@ -81,19 +94,20 @@ declare const _default: {
81
94
  renderEngineReference: (key: string) => React.JSX.Element;
82
95
  };
83
96
  components: {
84
- CalculationExpression(props: any): React.JSX.Element;
85
- ScopeSelect(props: any): React.JSX.Element;
86
- CalculationResult({ dataSource }: {
87
- dataSource: any;
88
- }): string | React.JSX.Element;
97
+ WorkflowVariableInput: typeof WorkflowVariableInput;
98
+ WorkflowVariableTextArea: typeof WorkflowVariableTextArea;
89
99
  RadioWithTooltip: typeof RadioWithTooltip;
90
100
  DynamicConfig: ({ value, onChange }: {
91
101
  value: any;
92
102
  onChange: any;
93
103
  }) => React.JSX.Element;
104
+ ValueBlock: (() => JSX.Element) & {
105
+ Initializer: (props: any) => JSX.Element;
106
+ Result: (props: any) => JSX.Element;
107
+ };
94
108
  };
95
- useVariables({ id, title }: {
96
- id: any;
109
+ useVariables({ key, title }: {
110
+ key: any;
97
111
  title: any;
98
112
  }, { types, fieldNames }: {
99
113
  types: any;
@@ -38,6 +38,7 @@ declare const _default: {
38
38
  'x-decorator': string;
39
39
  'x-component': string;
40
40
  'x-component-props': {
41
+ title: string;
41
42
  multiple: boolean;
42
43
  useCollection(): any;
43
44
  };
@@ -60,8 +61,8 @@ declare const _default: {
60
61
  components: {
61
62
  CollectionFieldset: import("react").MemoExoticComponent<import("@formily/reactive-react").ReactFC<Omit<any, "ref">>>;
62
63
  };
63
- useVariables({ id, title, config }: {
64
- id: any;
64
+ useVariables({ key: name, title, config }: {
65
+ key: any;
65
66
  title: any;
66
67
  config: any;
67
68
  }, options: any): import("../variable").VariableOption;
@@ -1,6 +1,6 @@
1
+ import React from 'react';
1
2
  import { ISchema } from '@formily/react';
2
3
  import { SchemaInitializerItemOptions } from '@nocobase/client';
3
- import React from 'react';
4
4
  import { VariableOption, VariableOptions } from '../variable';
5
5
  export interface Instruction {
6
6
  title: string;
@@ -23,13 +23,13 @@ export interface Instruction {
23
23
  [key: string]: any;
24
24
  };
25
25
  component?(props: any): JSX.Element;
26
- endding?: boolean;
27
26
  useVariables?(node: any, options?: any): VariableOption;
28
27
  useScopeVariables?(node: any, options?: any): VariableOptions;
29
28
  useInitializers?(node: any): SchemaInitializerItemOptions | null;
30
29
  initializers?: {
31
30
  [key: string]: any;
32
31
  };
32
+ isAvailable?(ctx: object): boolean;
33
33
  }
34
34
  export declare const instructions: any;
35
35
  export declare const NodeContext: React.Context<any>;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { VariableOption, useWorkflowVariableOptions } from '../variable';
2
+ import { VariableOption, WorkflowVariableInput } from '../variable';
3
3
  declare const _default: {
4
4
  title: string;
5
5
  type: string;
@@ -13,7 +13,6 @@ declare const _default: {
13
13
  'x-decorator': string;
14
14
  'x-component': string;
15
15
  'x-component-props': {
16
- scope: string;
17
16
  changeOnSelect: boolean;
18
17
  useTypedConstant: string[];
19
18
  className: string;
@@ -25,10 +24,10 @@ declare const _default: {
25
24
  component: ({ data }: {
26
25
  data: any;
27
26
  }) => React.JSX.Element;
28
- scope: {
29
- useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
27
+ scope: {};
28
+ components: {
29
+ WorkflowVariableInput: typeof WorkflowVariableInput;
30
30
  };
31
- components: {};
32
31
  useScopeVariables(node: any, options: any): VariableOption[];
33
32
  };
34
33
  export default _default;
@@ -1,5 +1,5 @@
1
- import { ISchema } from '@formily/react';
2
1
  import React from 'react';
2
+ import { ISchema } from '@formily/react';
3
3
  import { SchemaInitializerItemOptions } from '@nocobase/client';
4
4
  import { JOB_STATUS } from '../../constants';
5
5
  type ValueOf<T> = T[keyof T];
@@ -58,8 +58,8 @@ declare const _default: {
58
58
  ModeConfig: typeof ModeConfig;
59
59
  AssigneesSelect: typeof AssigneesSelect;
60
60
  };
61
- useVariables({ id, title, config }: {
62
- id: any;
61
+ useVariables({ key, title, config }: {
62
+ key: any;
63
63
  title: any;
64
64
  config: any;
65
65
  }, { types, fieldNames }: {
@@ -70,7 +70,7 @@ declare const _default: {
70
70
  readonly children: "children";
71
71
  };
72
72
  }): {
73
- value: string;
73
+ value: any;
74
74
  label: any;
75
75
  children: {
76
76
  key: string;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
3
3
  import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
4
- import { useWorkflowVariableOptions } from '../variable';
4
+ import { WorkflowVariableInput } from '../variable';
5
5
  declare const _default: {
6
6
  title: string;
7
7
  type: string;
@@ -126,7 +126,6 @@ declare const _default: {
126
126
  'x-decorator': string;
127
127
  'x-component': string;
128
128
  'x-component-props': {
129
- scope: string;
130
129
  useTypedConstant: string[];
131
130
  };
132
131
  default: number;
@@ -161,6 +160,7 @@ declare const _default: {
161
160
  'x-decorator': string;
162
161
  'x-component': string;
163
162
  'x-component-props': {
163
+ title: string;
164
164
  multiple: boolean;
165
165
  useCollection(): any;
166
166
  };
@@ -193,7 +193,6 @@ declare const _default: {
193
193
  view: {};
194
194
  scope: {
195
195
  useCollectionDataSource: typeof useCollectionDataSource;
196
- useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
197
196
  useSortableFields(): {
198
197
  value: any;
199
198
  label: any;
@@ -207,9 +206,10 @@ declare const _default: {
207
206
  };
208
207
  FilterDynamicComponent: typeof FilterDynamicComponent;
209
208
  SchemaComponentContext: import("react").Context<import("@nocobase/client").ISchemaComponentContext>;
209
+ WorkflowVariableInput: typeof WorkflowVariableInput;
210
210
  };
211
- useVariables({ id, title, config }: {
212
- id: any;
211
+ useVariables({ key: name, title, config }: {
212
+ key: any;
213
213
  title: any;
214
214
  config: any;
215
215
  }, options: any): import("../variable").VariableOption;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import { useWorkflowVariableOptions } from '../variable';
1
+ import { WorkflowVariableInput, WorkflowVariableJSON } from '../variable';
3
2
  declare const _default: {
4
3
  title: string;
5
4
  type: string;
@@ -60,7 +59,6 @@ declare const _default: {
60
59
  'x-decorator': string;
61
60
  'x-component': string;
62
61
  'x-component-props': {
63
- scope: string;
64
62
  useTypedConstant: boolean;
65
63
  };
66
64
  };
@@ -106,7 +104,6 @@ declare const _default: {
106
104
  'x-decorator': string;
107
105
  'x-component': string;
108
106
  'x-component-props': {
109
- scope: string;
110
107
  useTypedConstant: boolean;
111
108
  };
112
109
  };
@@ -163,16 +160,24 @@ declare const _default: {
163
160
  };
164
161
  };
165
162
  view: {};
166
- scope: {
167
- useWorkflowVariableOptions: typeof useWorkflowVariableOptions;
168
- };
163
+ scope: {};
169
164
  components: {
170
- ArrayItems: import("@formily/reactive-react").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
171
- Item: import("@formily/reactive-react").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
165
+ ArrayItems: import("@formily/reactive-react").ReactFC<import("react").HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
166
+ Item: import("@formily/reactive-react").ReactFC<import("react").HTMLAttributes<HTMLDivElement> & {
172
167
  type?: "divide" | "card";
173
168
  }>;
174
169
  };
175
- RequestBody(props: any): React.JSX.Element;
170
+ WorkflowVariableInput: typeof WorkflowVariableInput;
171
+ WorkflowVariableJSON: typeof WorkflowVariableJSON;
172
+ };
173
+ useVariables({ key, title }: {
174
+ key: any;
175
+ title: any;
176
+ }, { types, fieldNames }: {
177
+ types: any;
178
+ fieldNames?: import("@nocobase/client").FieldNames;
179
+ }): {
180
+ [x: string]: any;
176
181
  };
177
182
  };
178
183
  export default _default;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { WorkflowVariableRawTextArea } from '../variable';
2
2
  declare const _default: {
3
3
  title: string;
4
4
  type: string;
@@ -20,7 +20,16 @@ declare const _default: {
20
20
  };
21
21
  scope: {};
22
22
  components: {
23
- SQLInput(props: any): React.JSX.Element;
23
+ WorkflowVariableRawTextArea: typeof WorkflowVariableRawTextArea;
24
+ };
25
+ useVariables({ key, title }: {
26
+ key: any;
27
+ title: any;
28
+ }, { types, fieldNames }: {
29
+ types: any;
30
+ fieldNames?: import("@nocobase/client").FieldNames;
31
+ }): {
32
+ [x: string]: any;
24
33
  };
25
34
  };
26
35
  export default _default;
@@ -116,7 +116,6 @@ export declare const pagination: {
116
116
  'x-decorator': string;
117
117
  'x-component': string;
118
118
  'x-component-props': {
119
- scope: string;
120
119
  useTypedConstant: string[];
121
120
  };
122
121
  default: number;
@@ -151,6 +150,7 @@ export declare const appends: {
151
150
  'x-decorator': string;
152
151
  'x-component': string;
153
152
  'x-component-props': {
153
+ title: string;
154
154
  multiple: boolean;
155
155
  useCollection(): any;
156
156
  };
@@ -95,6 +95,7 @@ declare const _default: {
95
95
  'x-decorator': string;
96
96
  'x-component': string;
97
97
  'x-component-props': {
98
+ title: string;
98
99
  multiple: boolean;
99
100
  useCollection(): any;
100
101
  };
@@ -23,6 +23,7 @@ declare const _default: {
23
23
  'x-decorator': string;
24
24
  'x-component': string;
25
25
  'x-component-props': {
26
+ title: string;
26
27
  multiple: boolean;
27
28
  useCollection(): any;
28
29
  };
@@ -43,6 +44,7 @@ declare const _default: {
43
44
  useVariables(config: any, options: any): import("../variable").VariableOption[];
44
45
  useInitializers(config: any): SchemaInitializerItemOptions | null;
45
46
  initializers: {};
47
+ useActionTriggerable: boolean;
46
48
  };
47
49
  export default _default;
48
50
  export declare function useTriggerWorkflowsActionProps(): {
@@ -19,6 +19,7 @@ export interface Trigger {
19
19
  };
20
20
  useInitializers?(config: any): SchemaInitializerItemOptions | null;
21
21
  initializers?: any;
22
+ useActionTriggerable?: boolean | (() => boolean);
22
23
  }
23
24
  export declare const triggers: any;
24
25
  export declare const TriggerConfig: () => React.JSX.Element;
@@ -27,4 +28,7 @@ export declare function getTriggersOptions(): {
27
28
  value: any;
28
29
  label: any;
29
30
  color: string;
31
+ options: {
32
+ [x: string]: any;
33
+ };
30
34
  }[];
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export type VariableOption = {
2
3
  key?: string;
3
4
  value?: string;
@@ -21,6 +22,8 @@ export type OptionsOfUseVariableOptions = {
21
22
  children?: string;
22
23
  };
23
24
  appends?: string[] | null;
25
+ depth?: number;
26
+ current?: any;
24
27
  };
25
28
  export declare const defaultFieldNames: {
26
29
  readonly label: "label";
@@ -57,10 +60,24 @@ export declare const BaseTypeSets: {
57
60
  date: Set<string>;
58
61
  };
59
62
  export declare function useWorkflowVariableOptions(options?: OptionsOfUseVariableOptions): {
60
- label: any;
61
- value: any;
63
+ [x: number]: any;
62
64
  key: any;
63
- children: any;
64
65
  disabled: boolean;
65
66
  }[];
66
67
  export declare function getCollectionFieldOptions(options: any): VariableOption[];
68
+ export declare function WorkflowVariableInput({ variableOptions, ...props }: {
69
+ [x: string]: any;
70
+ variableOptions: any;
71
+ }): JSX.Element;
72
+ export declare function WorkflowVariableTextArea({ variableOptions, ...props }: {
73
+ [x: string]: any;
74
+ variableOptions: any;
75
+ }): JSX.Element;
76
+ export declare function WorkflowVariableRawTextArea({ variableOptions, ...props }: {
77
+ [x: string]: any;
78
+ variableOptions: any;
79
+ }): JSX.Element;
80
+ export declare function WorkflowVariableJSON({ variableOptions, ...props }: {
81
+ [x: string]: any;
82
+ variableOptions: any;
83
+ }): JSX.Element;
@@ -1,24 +1,23 @@
1
1
  module.exports = {
2
2
  "@ant-design/icons": "5.1.4",
3
- "@nocobase/client": "0.14.0-alpha.7",
3
+ "@nocobase/client": "0.15.0-alpha.1",
4
4
  "antd": "5.8.6",
5
5
  "react": "18.2.0",
6
- "@nocobase/utils": "0.14.0-alpha.7",
6
+ "@nocobase/utils": "0.15.0-alpha.1",
7
7
  "react-router-dom": "6.14.1",
8
8
  "react-i18next": "11.18.6",
9
9
  "winston": "3.9.0",
10
- "@nocobase/database": "0.14.0-alpha.7",
11
- "@nocobase/server": "0.14.0-alpha.7",
12
- "@nocobase/logger": "0.14.0-alpha.7",
13
- "@nocobase/evaluators": "0.14.0-alpha.7",
10
+ "@nocobase/database": "0.15.0-alpha.1",
11
+ "@nocobase/server": "0.15.0-alpha.1",
12
+ "@nocobase/logger": "0.15.0-alpha.1",
13
+ "@nocobase/evaluators": "0.15.0-alpha.1",
14
14
  "@formily/react": "2.2.27",
15
15
  "@formily/core": "2.2.27",
16
- "@formily/antd-v5": "1.1.0",
16
+ "@formily/antd-v5": "1.1.7",
17
17
  "lodash": "4.17.21",
18
- "@nocobase/actions": "0.14.0-alpha.7",
18
+ "@nocobase/actions": "0.15.0-alpha.1",
19
19
  "axios": "0.26.1",
20
20
  "sequelize": "6.32.1",
21
- "@emotion/css": "11.11.2",
22
21
  "dayjs": "1.11.9",
23
- "@nocobase/resourcer": "0.14.0-alpha.7"
22
+ "@nocobase/resourcer": "0.15.0-alpha.1"
24
23
  };
@@ -83,6 +83,7 @@ declare const _default: {
83
83
  Advanced: string;
84
84
  End: string;
85
85
  'Node result': string;
86
+ 'Variable key of node': string;
86
87
  Calculator: string;
87
88
  'Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression can be static or dynamic one from an expression collections.': string;
88
89
  'String operation': string;
@@ -99,6 +100,7 @@ declare const _default: {
99
100
  Aborted: string;
100
101
  Canceled: string;
101
102
  Rejected: string;
103
+ 'Retry needed': string;
102
104
  'Triggered but still waiting in queue to execute.': string;
103
105
  'Started and executing, maybe waiting for an async callback (manual, delay etc.).': string;
104
106
  'Successfully finished.': string;
@@ -107,6 +109,7 @@ declare const _default: {
107
109
  'Running of some node was aborted by program flow.': string;
108
110
  'Manually canceled whole execution when waiting.': string;
109
111
  'Rejected from a manual node.': string;
112
+ 'General failed but should do another try.': string;
110
113
  'Continue the process': string;
111
114
  'Terminate the process': string;
112
115
  'Save temporarily': string;
@@ -213,8 +216,7 @@ declare const _default: {
213
216
  'Field to aggregate': string;
214
217
  Distinct: string;
215
218
  'Query result': string;
216
- 'Trigger in executed workflow cannot be modified': string;
217
- 'Node in executed workflow cannot be modified': string;
219
+ 'Executed workflow cannot be modified': string;
218
220
  'Can not delete': string;
219
221
  'The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.': string;
220
222
  'HTTP request': string;
@@ -234,7 +236,7 @@ declare const _default: {
234
236
  'Input request data': string;
235
237
  'Only support standard JSON data': string;
236
238
  '"Content-Type" only support "application/json", and no need to specify': string;
237
- 'Ignore fail request and continue workflow': string;
239
+ 'Ignore failed request and continue workflow': string;
238
240
  'Workflow todos': string;
239
241
  Task: string;
240
242
  'Dynamic expression': string;
@@ -105,6 +105,7 @@ var zh_CN_default = {
105
105
  Advanced: "\u9AD8\u7EA7\u6A21\u5F0F",
106
106
  End: "\u7ED3\u675F",
107
107
  "Node result": "\u8282\u70B9\u6570\u636E",
108
+ "Variable key of node": "\u8282\u70B9\u53D8\u91CF\u6807\u8BC6",
108
109
  Calculator: "\u8FD0\u7B97",
109
110
  "Calculate an expression based on a calculation engine and obtain a value as the result. Variables in the upstream nodes can be used in the expression. The expression can be static or dynamic one from an expression collections.": "\u57FA\u4E8E\u8BA1\u7B97\u5F15\u64CE\u5BF9\u4E00\u4E2A\u8868\u8FBE\u5F0F\u8FDB\u884C\u8BA1\u7B97\uFF0C\u5E76\u83B7\u5F97\u4E00\u4E2A\u503C\u4F5C\u4E3A\u7ED3\u679C\u3002\u8868\u8FBE\u5F0F\u4E2D\u53EF\u4EE5\u4F7F\u7528\u4E0A\u6E38\u8282\u70B9\u91CC\u7684\u53D8\u91CF\u3002\u8868\u8FBE\u5F0F\u53EF\u4EE5\u662F\u9759\u6001\u7684\uFF0C\u4E5F\u53EF\u4EE5\u662F\u8868\u8FBE\u5F0F\u8868\u4E2D\u7684\u52A8\u6001\u8868\u8FBE\u5F0F\u3002",
110
111
  "String operation": "\u5B57\u7B26\u4E32",
@@ -121,6 +122,7 @@ var zh_CN_default = {
121
122
  Aborted: "\u5DF2\u7EC8\u6B62",
122
123
  Canceled: "\u5DF2\u53D6\u6D88",
123
124
  Rejected: "\u5DF2\u62D2\u7EDD",
125
+ "Retry needed": "\u9700\u91CD\u8BD5",
124
126
  "Triggered but still waiting in queue to execute.": "\u5DF2\u89E6\u53D1\u4F46\u4ECD\u5728\u961F\u5217\u4E2D\u7B49\u5F85\u6267\u884C\u3002",
125
127
  "Started and executing, maybe waiting for an async callback (manual, delay etc.).": "\u5DF2\u5F00\u59CB\u6267\u884C\uFF0C\u53EF\u80FD\u5728\u7B49\u5F85\u5F02\u6B65\u56DE\u8C03\uFF08\u4EBA\u5DE5\u3001\u5EF6\u65F6\u7B49\uFF09\u3002",
126
128
  "Successfully finished.": "\u6210\u529F\u5B8C\u6210\u3002",
@@ -129,6 +131,7 @@ var zh_CN_default = {
129
131
  "Running of some node was aborted by program flow.": "\u67D0\u4E2A\u8282\u70B9\u88AB\u7A0B\u5E8F\u6D41\u7A0B\u7EC8\u6B62\u3002",
130
132
  "Manually canceled whole execution when waiting.": "\u7B49\u5F85\u65F6\u88AB\u624B\u52A8\u53D6\u6D88\u6574\u4E2A\u6267\u884C\u3002",
131
133
  "Rejected from a manual node.": "\u88AB\u4EBA\u5DE5\u8282\u70B9\u62D2\u7EDD\u7EE7\u7EED\u3002",
134
+ "General failed but should do another try.": "\u6267\u884C\u5931\u8D25\uFF0C\u9700\u91CD\u8BD5\u3002",
132
135
  "Continue the process": "\u7EE7\u7EED\u6D41\u7A0B",
133
136
  "Terminate the process": "\u7EC8\u6B62\u6D41\u7A0B",
134
137
  "Save temporarily": "\u6682\u5B58",
@@ -235,8 +238,7 @@ var zh_CN_default = {
235
238
  "Field to aggregate": "\u805A\u5408\u5B57\u6BB5",
236
239
  Distinct: "\u53BB\u91CD",
237
240
  "Query result": "\u67E5\u8BE2\u7ED3\u679C",
238
- "Trigger in executed workflow cannot be modified": "\u5DF2\u7ECF\u6267\u884C\u8FC7\u5DE5\u4F5C\u6D41\u7684\u89E6\u53D1\u5668\u4E0D\u80FD\u88AB\u4FEE\u6539",
239
- "Node in executed workflow cannot be modified": "\u5DF2\u7ECF\u6267\u884C\u8FC7\u5DE5\u4F5C\u6D41\u4E2D\u7684\u8282\u70B9\u4E0D\u80FD\u88AB\u4FEE\u6539",
241
+ "Executed workflow cannot be modified": "\u5DF2\u7ECF\u6267\u884C\u8FC7\u7684\u5DE5\u4F5C\u6D41\u4E0D\u80FD\u88AB\u4FEE\u6539",
240
242
  "Can not delete": "\u65E0\u6CD5\u5220\u9664",
241
243
  "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "\u8BE5\u8282\u70B9\u7684\u6267\u884C\u7ED3\u679C\u5DF2\u88AB\u5176\u4ED6\u8282\u70B9\uFF08{{nodes}}\uFF09\u5F15\u7528\uFF0C\u5220\u9664\u524D\u8BF7\u5148\u79FB\u9664\u5F15\u7528\u3002",
242
244
  "HTTP request": "HTTP \u8BF7\u6C42",
@@ -256,7 +258,7 @@ var zh_CN_default = {
256
258
  "Input request data": "\u8F93\u5165\u8BF7\u6C42\u6570\u636E",
257
259
  "Only support standard JSON data": "\u4EC5\u652F\u6301\u6807\u51C6 JSON \u6570\u636E",
258
260
  '"Content-Type" only support "application/json", and no need to specify': '"Content-Type" \u8BF7\u6C42\u5934\u4EC5\u652F\u6301 "application/json"\uFF0C\u65E0\u9700\u586B\u5199',
259
- "Ignore fail request and continue workflow": "\u5FFD\u7565\u5931\u8D25\u7684\u8BF7\u6C42\u5E76\u7EE7\u7EED\u5DE5\u4F5C\u6D41",
261
+ "Ignore failed request and continue workflow": "\u5FFD\u7565\u5931\u8D25\u7684\u8BF7\u6C42\u5E76\u7EE7\u7EED\u5DE5\u4F5C\u6D41",
260
262
  "Workflow todos": "\u5DE5\u4F5C\u6D41\u5F85\u529E",
261
263
  Task: "\u4EFB\u52A1",
262
264
  "Dynamic expression": "\u52A8\u6001\u8868\u8FBE\u5F0F",
@@ -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":"2023-10-07T08:33:03.346Z"}
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":"2023-11-13T03:13:09.200Z"}
@@ -1 +1 @@
1
- {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2023-10-07T08:33:02.747Z"}
1
+ {"name":"lru-cache","description":"A cache object that deletes the least-recently-used items.","version":"8.0.5","author":"Isaac Z. Schlueter <i@izs.me>","keywords":["mru","lru","cache"],"sideEffects":false,"scripts":{"build":"npm run prepare","preprepare":"rm -rf dist","prepare":"tsc -p tsconfig.json && tsc -p tsconfig-esm.json","postprepare":"bash fixup.sh","pretest":"npm run prepare","presnap":"npm run prepare","test":"c8 tap","snap":"c8 tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags","format":"prettier --write .","typedoc":"typedoc --tsconfig tsconfig-esm.json ./src/*.ts","benchmark-results-typedoc":"bash scripts/benchmark-results-typedoc.sh","prebenchmark":"npm run prepare","benchmark":"make -C benchmark","preprofile":"npm run prepare","profile":"make -C benchmark profile"},"main":"./dist/cjs/index-cjs.js","module":"./dist/mjs/index.js","types":"./dist/mjs/index.d.ts","exports":{"./min":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.min.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index.min.js"}},".":{"import":{"types":"./dist/mjs/index.d.ts","default":"./dist/mjs/index.js"},"require":{"types":"./dist/cjs/index.d.ts","default":"./dist/cjs/index-cjs.js"}}},"repository":"git://github.com/isaacs/node-lru-cache.git","devDependencies":{"@size-limit/preset-small-lib":"^7.0.8","@types/node":"^17.0.31","@types/tap":"^15.0.6","benchmark":"^2.1.4","c8":"^7.11.2","clock-mock":"^1.0.6","esbuild":"^0.17.11","eslint-config-prettier":"^8.5.0","marked":"^4.2.12","mkdirp":"^2.1.5","prettier":"^2.6.2","size-limit":"^7.0.8","tap":"^16.3.4","ts-node":"^10.7.0","tslib":"^2.4.0","typedoc":"^0.23.24","typescript":"^4.6.4"},"license":"ISC","files":["dist"],"engines":{"node":">=16.14"},"prettier":{"semi":false,"printWidth":70,"tabWidth":2,"useTabs":false,"singleQuote":true,"jsxSingleQuote":false,"bracketSameLine":true,"arrowParens":"avoid","endOfLine":"lf"},"tap":{"coverage":false,"node-arg":["--expose-gc","--no-warnings","--loader","ts-node/esm"],"ts":false},"size-limit":[{"path":"./dist/mjs/index.js"}],"_lastModified":"2023-11-13T03:13:08.897Z"}
@@ -288,7 +288,10 @@ class WorkflowPlugin extends import_server.Plugin {
288
288
  } else {
289
289
  const execution = await this.db.getRepository("executions").findOne({
290
290
  filter: {
291
- status: import_constants.EXECUTION_STATUS.QUEUEING
291
+ status: import_constants.EXECUTION_STATUS.QUEUEING,
292
+ "workflow.id": {
293
+ [import_database.Op.not]: null
294
+ }
292
295
  },
293
296
  appends: ["workflow"],
294
297
  sort: "createdAt"
@@ -16,8 +16,8 @@ export default class Processor {
16
16
  nodes: FlowNodeModel[];
17
17
  nodesMap: Map<number, FlowNodeModel>;
18
18
  jobsMap: Map<number, JobModel>;
19
- jobsMapByNodeId: {
20
- [key: number]: any;
19
+ jobsMapByNodeKey: {
20
+ [key: string]: any;
21
21
  };
22
22
  constructor(execution: ExecutionModel, options: ProcessorOptions);
23
23
  private makeNodes;
@@ -41,8 +41,8 @@ export default class Processor {
41
41
  findBranchLastJob(node: FlowNodeModel, job: JobModel): JobModel | null;
42
42
  getScope(sourceNodeId: number): {
43
43
  $context: any;
44
- $jobsMapByNodeId: {
45
- [key: number]: any;
44
+ $jobsMapByNodeKey: {
45
+ [key: string]: any;
46
46
  };
47
47
  $system: {};
48
48
  $scopes: {};
@@ -37,14 +37,15 @@ class Processor {
37
37
  [import_constants.JOB_STATUS.ERROR]: import_constants.EXECUTION_STATUS.ERROR,
38
38
  [import_constants.JOB_STATUS.ABORTED]: import_constants.EXECUTION_STATUS.ABORTED,
39
39
  [import_constants.JOB_STATUS.CANCELED]: import_constants.EXECUTION_STATUS.CANCELED,
40
- [import_constants.JOB_STATUS.REJECTED]: import_constants.EXECUTION_STATUS.REJECTED
40
+ [import_constants.JOB_STATUS.REJECTED]: import_constants.EXECUTION_STATUS.REJECTED,
41
+ [import_constants.JOB_STATUS.RETRY_NEEDED]: import_constants.EXECUTION_STATUS.RETRY_NEEDED
41
42
  };
42
43
  logger;
43
44
  transaction;
44
45
  nodes = [];
45
46
  nodesMap = /* @__PURE__ */ new Map();
46
47
  jobsMap = /* @__PURE__ */ new Map();
47
- jobsMapByNodeId = {};
48
+ jobsMapByNodeKey = {};
48
49
  // make dual linked nodes list then cache
49
50
  makeNodes(nodes = []) {
50
51
  this.nodes = nodes;
@@ -63,7 +64,8 @@ class Processor {
63
64
  makeJobs(jobs) {
64
65
  jobs.forEach((job) => {
65
66
  this.jobsMap.set(job.id, job);
66
- this.jobsMapByNodeId[job.nodeId] = job.result;
67
+ const node = this.nodesMap.get(job.nodeId);
68
+ this.jobsMapByNodeKey[node.key] = job.result;
67
69
  });
68
70
  }
69
71
  async getTransaction() {
@@ -214,7 +216,8 @@ class Processor {
214
216
  );
215
217
  }
216
218
  this.jobsMap.set(job.id, job);
217
- this.jobsMapByNodeId[job.nodeId] = job.result;
219
+ const node = this.nodesMap.get(job.nodeId);
220
+ this.jobsMapByNodeKey[node.key] = job.result;
218
221
  return job;
219
222
  }
220
223
  getBranches(node) {
@@ -290,12 +293,12 @@ class Processor {
290
293
  for (let n = this.findBranchParentNode(node); n; n = this.findBranchParentNode(n)) {
291
294
  const instruction = this.options.plugin.instructions.get(n.type);
292
295
  if (typeof instruction.getScope === "function") {
293
- $scopes[n.id] = instruction.getScope(n, this.jobsMapByNodeId[n.id], this);
296
+ $scopes[n.id] = $scopes[n.key] = instruction.getScope(n, this.jobsMapByNodeKey[n.key], this);
294
297
  }
295
298
  }
296
299
  return {
297
300
  $context: this.execution.context,
298
- $jobsMapByNodeId: this.jobsMapByNodeId,
301
+ $jobsMapByNodeKey: this.jobsMapByNodeKey,
299
302
  $system: systemFns,
300
303
  $scopes
301
304
  };