@nocobase/plugin-workflow 0.8.0-alpha.8 → 0.8.1-alpha.3

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 (95) hide show
  1. package/lib/client/AddButton.js +21 -13
  2. package/lib/client/ExecutionCanvas.js +10 -24
  3. package/lib/client/ExecutionResourceProvider.d.ts +2 -1
  4. package/lib/client/ExecutionResourceProvider.js +4 -3
  5. package/lib/client/FlowContext.js +1 -1
  6. package/lib/client/WorkflowCanvas.js +136 -39
  7. package/lib/client/WorkflowProvider.d.ts +3 -0
  8. package/lib/client/WorkflowProvider.js +71 -16
  9. package/lib/client/WorkflowShortcut.d.ts +0 -1
  10. package/lib/client/WorkflowShortcut.js +4 -47
  11. package/lib/client/calculators.d.ts +27 -37
  12. package/lib/client/calculators.js +168 -150
  13. package/lib/client/components/CollectionFieldset.js +10 -20
  14. package/lib/client/components/Duration.js +3 -14
  15. package/lib/client/components/EjsTextArea.d.ts +2 -0
  16. package/lib/client/components/EjsTextArea.js +232 -0
  17. package/lib/client/components/OpenDrawer.d.ts +6 -0
  18. package/lib/client/components/OpenDrawer.js +93 -0
  19. package/lib/client/constants.js +11 -9
  20. package/lib/client/index.d.ts +1 -0
  21. package/lib/client/index.js +14 -0
  22. package/lib/client/locale/en-US.d.ts +105 -0
  23. package/lib/client/locale/en-US.js +111 -0
  24. package/lib/client/locale/index.d.ts +3 -0
  25. package/lib/client/locale/index.js +69 -0
  26. package/lib/client/locale/ja-JP.d.ts +88 -0
  27. package/lib/client/locale/ja-JP.js +94 -0
  28. package/lib/client/locale/ru-RU.d.ts +88 -0
  29. package/lib/client/locale/ru-RU.js +94 -0
  30. package/lib/client/locale/tr-TR.d.ts +88 -0
  31. package/lib/client/locale/tr-TR.js +94 -0
  32. package/lib/client/locale/zh-CN.d.ts +130 -0
  33. package/lib/client/locale/zh-CN.js +136 -0
  34. package/lib/client/nodes/calculation.d.ts +0 -1
  35. package/lib/client/nodes/calculation.js +9 -17
  36. package/lib/client/nodes/condition.js +16 -22
  37. package/lib/client/nodes/create.d.ts +3 -1
  38. package/lib/client/nodes/create.js +11 -11
  39. package/lib/client/nodes/delay.js +8 -6
  40. package/lib/client/nodes/index.js +46 -14
  41. package/lib/client/nodes/parallel.d.ts +0 -1
  42. package/lib/client/nodes/parallel.js +11 -32
  43. package/lib/client/nodes/query.js +9 -17
  44. package/lib/client/nodes/request.d.ts +138 -0
  45. package/lib/client/nodes/request.js +167 -0
  46. package/lib/client/nodes/update.js +4 -2
  47. package/lib/client/schemas/collection.js +3 -1
  48. package/lib/client/schemas/executions.d.ts +211 -207
  49. package/lib/client/schemas/executions.js +102 -96
  50. package/lib/client/schemas/workflows.js +112 -22
  51. package/lib/client/style.js +7 -7
  52. package/lib/client/triggers/collection.d.ts +2 -1
  53. package/lib/client/triggers/collection.js +49 -34
  54. package/lib/client/triggers/index.d.ts +4 -6
  55. package/lib/client/triggers/index.js +57 -51
  56. package/lib/client/triggers/schedule/EndsByField.js +13 -39
  57. package/lib/client/triggers/schedule/OnField.js +10 -5
  58. package/lib/client/triggers/schedule/RepeatField.js +6 -14
  59. package/lib/client/triggers/schedule/ScheduleConfig.js +25 -20
  60. package/lib/client/triggers/schedule/constants.d.ts +4 -0
  61. package/lib/client/triggers/schedule/constants.js +11 -0
  62. package/lib/client/triggers/schedule/index.d.ts +2 -3
  63. package/lib/client/triggers/schedule/index.js +55 -40
  64. package/lib/server/Plugin.d.ts +15 -5
  65. package/lib/server/Plugin.js +176 -61
  66. package/lib/server/Processor.d.ts +1 -2
  67. package/lib/server/Processor.js +3 -19
  68. package/lib/server/actions/jobs.js +2 -3
  69. package/lib/server/actions/workflows.js +13 -5
  70. package/lib/server/calculators/index.d.ts +4 -2
  71. package/lib/server/calculators/index.js +6 -4
  72. package/lib/server/collections/executions.js +2 -1
  73. package/lib/server/constants.d.ts +1 -0
  74. package/lib/server/constants.js +1 -0
  75. package/lib/server/extensions/assignees/actions.js +2 -3
  76. package/lib/server/extensions/assignees/collections/users_jobs.js +9 -1
  77. package/lib/server/index.d.ts +3 -4
  78. package/lib/server/index.js +21 -44
  79. package/lib/server/instructions/condition.js +1 -1
  80. package/lib/server/instructions/create.js +3 -1
  81. package/lib/server/instructions/delay.js +2 -3
  82. package/lib/server/instructions/destroy.js +3 -1
  83. package/lib/server/instructions/index.d.ts +3 -2
  84. package/lib/server/instructions/index.js +1 -1
  85. package/lib/server/instructions/prompt.js +2 -1
  86. package/lib/server/instructions/query.js +3 -1
  87. package/lib/server/instructions/request.d.ts +14 -0
  88. package/lib/server/instructions/request.js +154 -0
  89. package/lib/server/instructions/update.d.ts +1 -1
  90. package/lib/server/instructions/update.js +3 -1
  91. package/lib/server/migrations/20221129153547-calculation-variables.d.ts +5 -0
  92. package/lib/server/migrations/20221129153547-calculation-variables.js +116 -0
  93. package/lib/server/triggers/collection.js +5 -7
  94. package/lib/server/triggers/schedule.js +17 -6
  95. package/package.json +13 -8
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.WorkflowShortcut = exports.WorkflowPane = void 0;
6
+ exports.WorkflowShortcut = void 0;
7
7
 
8
8
  function _react() {
9
9
  const data = _interopRequireDefault(require("react"));
@@ -15,16 +15,6 @@ function _react() {
15
15
  return data;
16
16
  }
17
17
 
18
- function _antd() {
19
- const data = require("antd");
20
-
21
- _antd = function _antd() {
22
- return data;
23
- };
24
-
25
- return data;
26
- }
27
-
28
18
  function _icons() {
29
19
  const data = require("@ant-design/icons");
30
20
 
@@ -35,16 +25,6 @@ function _icons() {
35
25
  return data;
36
26
  }
37
27
 
38
- function _reactI18next() {
39
- const data = require("react-i18next");
40
-
41
- _reactI18next = function _reactI18next() {
42
- return data;
43
- };
44
-
45
- return data;
46
- }
47
-
48
28
  function _reactRouterDom() {
49
29
  const data = require("react-router-dom");
50
30
 
@@ -65,39 +45,16 @@ function _client() {
65
45
  return data;
66
46
  }
67
47
 
68
- var _workflows = require("./schemas/workflows");
69
-
70
- var _WorkflowLink = require("./WorkflowLink");
71
-
72
- var _ExecutionResourceProvider = require("./ExecutionResourceProvider");
73
-
74
- var _ExecutionLink = require("./ExecutionLink");
48
+ var _locale = require("./locale");
75
49
 
76
50
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
77
51
 
78
- const WorkflowPane = () => {
79
- return _react().default.createElement(_antd().Card, {
80
- bordered: false
81
- }, _react().default.createElement(_client().SchemaComponent, {
82
- schema: _workflows.workflowSchema,
83
- components: {
84
- WorkflowLink: _WorkflowLink.WorkflowLink,
85
- ExecutionResourceProvider: _ExecutionResourceProvider.ExecutionResourceProvider,
86
- ExecutionLink: _ExecutionLink.ExecutionLink
87
- }
88
- }));
89
- };
90
-
91
- exports.WorkflowPane = WorkflowPane;
92
-
93
52
  const WorkflowShortcut = () => {
94
- const _useTranslation = (0, _reactI18next().useTranslation)(),
95
- t = _useTranslation.t;
96
-
97
53
  const history = (0, _reactRouterDom().useHistory)();
98
54
  return _react().default.createElement(_client().PluginManager.Toolbar.Item, {
55
+ key: "workflow",
99
56
  icon: _react().default.createElement(_icons().PartitionOutlined, null),
100
- title: t('Workflow'),
57
+ title: (0, _locale.lang)('Workflow'),
101
58
  onClick: () => {
102
59
  history.push('/admin/settings/workflow/workflows');
103
60
  }
@@ -1,22 +1,15 @@
1
1
  import React from "react";
2
2
  import { Registry } from "@nocobase/utils/client";
3
- declare function NullRender(): any;
4
3
  interface Calculator {
5
4
  name: string;
6
5
  type: 'boolean' | 'number' | 'string' | 'date' | 'unknown' | 'null' | 'array';
7
6
  group: string;
8
7
  }
9
8
  export declare const calculators: Registry<Calculator>;
10
- export declare function parseStringValue(value: string, Types: any): {
9
+ export declare function parseValue(value: any, Types: any): {
11
10
  type: string;
12
- value: string;
13
- options: {
14
- type: string;
15
- };
16
- } | {
17
- type: string;
18
- options: any;
19
- value?: undefined;
11
+ value?: any;
12
+ options?: any;
20
13
  };
21
14
  export declare const BaseTypeSet: Set<string>;
22
15
  export declare const VariableTypes: {
@@ -27,17 +20,13 @@ export declare const VariableTypes: {
27
20
  value: string;
28
21
  label: string;
29
22
  }[];
30
- component({ options }: {
31
- options?: {
32
- type: string;
33
- };
34
- }): any;
23
+ component(props: any): any;
35
24
  appendTypeValue({ options }: {
36
25
  options?: {
37
26
  type: string;
38
27
  };
39
28
  }): string[];
40
- onTypeChange(old: any, [type, optionsType]: [any, any], onChange: any): void;
29
+ onTypeChange([type, optionsType]: [any, any], onChange: any): void;
41
30
  parse(path: any): {
42
31
  path: any;
43
32
  };
@@ -46,46 +35,47 @@ export declare const VariableTypes: {
46
35
  title: string;
47
36
  value: string;
48
37
  options(): any[];
49
- component({ options }: {
50
- options: any;
51
- }): typeof NullRender | ((node: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>);
38
+ component(props: any): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
52
39
  appendTypeValue({ options }: {
53
40
  type: string;
54
41
  options: any;
55
42
  }): number[];
56
- onTypeChange(old: any, [type, nodeId]: [any, any], onChange: any): void;
43
+ onTypeChange([type, nodeId]: [any, any], onChange: any): void;
57
44
  parse([nodeId, ...path]: [any, ...any[]]): {
58
45
  nodeId: any;
59
46
  path: string;
60
47
  };
61
- stringify({ options }: {
62
- options: any;
63
- }): string;
48
+ stringify(next: any): string;
64
49
  };
65
50
  $context: {
66
51
  title: string;
67
52
  value: string;
68
- component(): ((node: any) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) | typeof NullRender;
69
- parse([prefix, ...path]: [any, ...any[]]): {
70
- path: string;
71
- };
72
- stringify({ options }: {
53
+ options(): {
54
+ label: string;
55
+ value: any;
56
+ key: string;
57
+ }[];
58
+ component(props: any): React.ReactNode;
59
+ appendTypeValue({ options }: {
73
60
  options: any;
74
- }): string;
61
+ }): any[];
62
+ onTypeChange([type, optionType]: [any, any], onChange: any): void;
63
+ parse([type, ...path]: [any, ...any[]]): {
64
+ path?: string;
65
+ type: any;
66
+ };
67
+ stringify(next: any): string;
75
68
  };
76
69
  };
77
- export declare const VariableTypesContext: React.Context<any>;
78
- export declare function useVariableTypes(): any;
70
+ export declare const VariableTypesContext: React.Context<{}>;
71
+ export declare function useVariableTypes(): {};
79
72
  interface OperandProps {
80
- value: {
81
- type: string;
82
- value?: any;
83
- options?: any;
84
- };
73
+ value: any;
85
74
  onChange(v: any): void;
86
75
  children?: React.ReactNode;
87
76
  }
88
- export declare function Operand({ value: operand, onChange, children }: OperandProps): JSX.Element;
77
+ export declare function useOperandContext(): any;
78
+ export declare function Operand({ value, onChange, children }: OperandProps): JSX.Element;
89
79
  export declare function Calculation({ calculator, operands, onChange }: {
90
80
  calculator: any;
91
81
  operands?: any[];