@nocobase/plugin-workflow 0.9.0-alpha.2 → 0.9.1-alpha.2

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 (138) hide show
  1. package/README.md +9 -0
  2. package/README.zh-CN.md +9 -0
  3. package/lib/client/AddButton.d.ts +1 -1
  4. package/lib/client/AddButton.js +43 -27
  5. package/lib/client/Branch.d.ts +1 -1
  6. package/lib/client/ExecutionCanvas.js +5 -10
  7. package/lib/client/WorkflowCanvas.js +12 -42
  8. package/lib/client/WorkflowProvider.js +10 -1
  9. package/lib/client/components/CollectionBlockInitializer.d.ts +7 -0
  10. package/lib/client/components/CollectionBlockInitializer.js +81 -0
  11. package/lib/client/components/CollectionFieldInitializers.d.ts +2 -0
  12. package/lib/client/components/CollectionFieldInitializers.js +89 -0
  13. package/lib/client/components/CollectionFieldset.js +25 -33
  14. package/lib/client/components/FilterDynamicComponent.d.ts +6 -0
  15. package/lib/client/components/FilterDynamicComponent.js +43 -0
  16. package/lib/client/components/NullRender.d.ts +1 -0
  17. package/lib/client/components/NullRender.js +10 -0
  18. package/lib/client/components/RadioWithTooltip.d.ts +7 -0
  19. package/lib/client/components/RadioWithTooltip.js +94 -0
  20. package/lib/client/constants.d.ts +10 -8
  21. package/lib/client/constants.js +52 -14
  22. package/lib/client/index.d.ts +0 -1
  23. package/lib/client/index.js +1 -10
  24. package/lib/client/locale/en-US.d.ts +18 -18
  25. package/lib/client/locale/en-US.js +19 -19
  26. package/lib/client/locale/zh-CN.d.ts +47 -20
  27. package/lib/client/locale/zh-CN.js +48 -21
  28. package/lib/client/nodes/calculation.d.ts +39 -7
  29. package/lib/client/nodes/calculation.js +165 -19
  30. package/lib/client/nodes/condition.d.ts +67 -4
  31. package/lib/client/nodes/condition.js +283 -31
  32. package/lib/client/nodes/create.d.ts +10 -10
  33. package/lib/client/nodes/create.js +28 -42
  34. package/lib/client/nodes/delay.d.ts +4 -4
  35. package/lib/client/nodes/delay.js +10 -8
  36. package/lib/client/nodes/destroy.d.ts +4 -7
  37. package/lib/client/nodes/destroy.js +4 -5
  38. package/lib/client/nodes/index.d.ts +10 -2
  39. package/lib/client/nodes/index.js +217 -110
  40. package/lib/client/nodes/manual/AssigneesSelect.d.ts +6 -0
  41. package/lib/client/nodes/manual/AssigneesSelect.js +65 -0
  42. package/lib/client/nodes/manual/ModeConfig.d.ts +5 -0
  43. package/lib/client/nodes/manual/ModeConfig.js +160 -0
  44. package/lib/client/nodes/manual/SchemaConfig.d.ts +6 -0
  45. package/lib/client/nodes/manual/SchemaConfig.js +715 -0
  46. package/lib/client/nodes/manual/WorkflowTodo.d.ts +8 -0
  47. package/lib/client/nodes/manual/WorkflowTodo.js +691 -0
  48. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +5 -0
  49. package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +75 -0
  50. package/lib/client/nodes/manual/index.d.ts +62 -0
  51. package/lib/client/nodes/manual/index.js +137 -0
  52. package/lib/client/nodes/parallel.d.ts +12 -7
  53. package/lib/client/nodes/parallel.js +32 -39
  54. package/lib/client/nodes/query.d.ts +11 -19
  55. package/lib/client/nodes/query.js +40 -47
  56. package/lib/client/nodes/request.d.ts +77 -42
  57. package/lib/client/nodes/request.js +123 -69
  58. package/lib/client/nodes/update.d.ts +33 -29
  59. package/lib/client/nodes/update.js +14 -7
  60. package/lib/client/schemas/collection.d.ts +0 -3
  61. package/lib/client/schemas/collection.js +2 -7
  62. package/lib/client/schemas/executions.js +1 -1
  63. package/lib/client/schemas/workflows.js +1 -1
  64. package/lib/client/style.js +51 -9
  65. package/lib/client/triggers/collection.d.ts +44 -15
  66. package/lib/client/triggers/collection.js +104 -82
  67. package/lib/client/triggers/index.d.ts +6 -3
  68. package/lib/client/triggers/index.js +167 -74
  69. package/lib/client/triggers/schedule/DateFieldsSelect.js +1 -3
  70. package/lib/client/triggers/schedule/ScheduleConfig.js +15 -17
  71. package/lib/client/triggers/schedule/index.d.ts +7 -6
  72. package/lib/client/triggers/schedule/index.js +39 -81
  73. package/lib/client/utils.d.ts +1 -0
  74. package/lib/client/utils.js +38 -0
  75. package/lib/client/variable.d.ts +21 -0
  76. package/lib/client/variable.js +147 -0
  77. package/lib/server/Plugin.d.ts +3 -3
  78. package/lib/server/Plugin.js +12 -21
  79. package/lib/server/Processor.d.ts +9 -2
  80. package/lib/server/Processor.js +33 -33
  81. package/lib/server/actions/index.js +2 -4
  82. package/lib/server/actions/workflows.d.ts +1 -0
  83. package/lib/server/actions/workflows.js +80 -23
  84. package/lib/server/collections/executions.js +5 -7
  85. package/lib/server/collections/flow_nodes.js +6 -18
  86. package/lib/server/collections/jobs.js +3 -1
  87. package/lib/server/collections/workflows.js +8 -4
  88. package/lib/server/constants.d.ts +9 -3
  89. package/lib/server/constants.js +11 -5
  90. package/lib/server/functions/index.d.ts +4 -0
  91. package/lib/server/functions/index.js +38 -0
  92. package/lib/server/index.d.ts +0 -1
  93. package/lib/server/index.js +0 -14
  94. package/lib/server/instructions/calculation.d.ts +2 -7
  95. package/lib/server/instructions/calculation.js +32 -37
  96. package/lib/server/instructions/condition.d.ts +4 -4
  97. package/lib/server/instructions/condition.js +126 -54
  98. package/lib/server/instructions/index.js +1 -1
  99. package/lib/server/instructions/manual/actions.js +101 -0
  100. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.d.ts +2 -0
  101. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.js +2 -1
  102. package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.js +10 -10
  103. package/lib/server/instructions/manual/index.d.ts +25 -0
  104. package/lib/server/instructions/manual/index.js +200 -0
  105. package/lib/server/instructions/parallel.js +11 -7
  106. package/lib/server/instructions/request.d.ts +5 -4
  107. package/lib/server/instructions/request.js +60 -79
  108. package/lib/server/migrations/20230221032941-change-request-body-type.d.ts +5 -0
  109. package/lib/server/migrations/20230221032941-change-request-body-type.js +113 -0
  110. package/lib/server/migrations/20230221071831-calculation-expression.d.ts +4 -0
  111. package/lib/server/migrations/20230221071831-calculation-expression.js +143 -0
  112. package/lib/server/migrations/20230221121203-condition-calculation.d.ts +4 -0
  113. package/lib/server/migrations/20230221121203-condition-calculation.js +126 -0
  114. package/lib/server/migrations/20230221162902-jsonb-to-json.d.ts +4 -0
  115. package/lib/server/migrations/20230221162902-jsonb-to-json.js +81 -0
  116. package/lib/server/triggers/schedule.js +11 -3
  117. package/package.json +10 -10
  118. package/lib/client/calculators.d.ts +0 -89
  119. package/lib/client/calculators.js +0 -668
  120. package/lib/client/components/CollectionFieldSelect.d.ts +0 -2
  121. package/lib/client/components/CollectionFieldSelect.js +0 -106
  122. package/lib/client/components/EjsTextArea.d.ts +0 -2
  123. package/lib/client/components/EjsTextArea.js +0 -232
  124. package/lib/server/actions/jobs.d.ts +0 -2
  125. package/lib/server/actions/jobs.js +0 -39
  126. package/lib/server/calculators/index.d.ts +0 -40
  127. package/lib/server/calculators/index.js +0 -187
  128. package/lib/server/extensions/assignees/actions.js +0 -75
  129. package/lib/server/extensions/assignees/index.d.ts +0 -2
  130. package/lib/server/extensions/assignees/index.js +0 -273
  131. package/lib/server/extensions/index.d.ts +0 -3
  132. package/lib/server/extensions/index.js +0 -13
  133. package/lib/server/instructions/prompt.d.ts +0 -19
  134. package/lib/server/instructions/prompt.js +0 -131
  135. /package/lib/server/{extensions/assignees → instructions/manual}/actions.d.ts +0 -0
  136. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.d.ts +0 -0
  137. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.js +0 -0
  138. /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.d.ts +0 -0
@@ -75,10 +75,10 @@ function _client() {
75
75
  return data;
76
76
  }
77
77
 
78
- var _calculators = require("../calculators");
79
-
80
78
  var _locale = require("../locale");
81
79
 
80
+ var _variable = require("../variable");
81
+
82
82
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83
83
 
84
84
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
@@ -96,8 +96,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
96
96
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
97
97
 
98
98
  function AssociationInput(props) {
99
- var _data$config;
100
-
101
99
  const _useCollectionManager = (0, _client().useCollectionManager)(),
102
100
  getCollectionFields = _useCollectionManager.getCollectionFields;
103
101
 
@@ -107,9 +105,9 @@ function AssociationInput(props) {
107
105
  const fieldName = path.segments[path.segments.length - 1];
108
106
 
109
107
  const _useForm = (0, _react2().useForm)(),
110
- data = _useForm.values;
108
+ config = _useForm.values;
111
109
 
112
- const fields = getCollectionFields(data === null || data === void 0 ? void 0 : (_data$config = data.config) === null || _data$config === void 0 ? void 0 : _data$config.collection);
110
+ const fields = getCollectionFields(config === null || config === void 0 ? void 0 : config.collection);
113
111
 
114
112
  const _fields$find = fields.find(item => item.name === fieldName),
115
113
  type = _fields$find.type;
@@ -130,26 +128,28 @@ function AssociationInput(props) {
130
128
 
131
129
  var _default = (0, _react2().observer)(({
132
130
  value,
131
+ disabled,
133
132
  onChange: _onChange
134
133
  }) => {
135
- var _data$config2;
136
-
137
134
  const _useTranslation = (0, _reactI18next().useTranslation)(),
138
135
  t = _useTranslation.t;
139
136
 
140
137
  const compile = (0, _client().useCompile)();
138
+ const form = (0, _react2().useForm)();
141
139
 
142
140
  const _useCollectionManager2 = (0, _client().useCollectionManager)(),
143
141
  getCollection = _useCollectionManager2.getCollection,
144
142
  getCollectionFields = _useCollectionManager2.getCollectionFields;
145
143
 
146
144
  const _useForm2 = (0, _react2().useForm)(),
147
- data = _useForm2.values;
145
+ config = _useForm2.values;
148
146
 
149
- const collectionName = data === null || data === void 0 ? void 0 : (_data$config2 = data.config) === null || _data$config2 === void 0 ? void 0 : _data$config2.collection;
150
- const fields = getCollectionFields(collectionName).filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false) // && (!['linkTo', 'hasMany', 'hasOne', 'belongsToMany'].includes(field.type))
151
- );
147
+ const collectionName = config === null || config === void 0 ? void 0 : config.collection;
148
+ const fields = getCollectionFields(collectionName).filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false) // TODO: should use some field option but not type to control this
149
+ && !['formula'].includes(field.type));
152
150
  const unassignedFields = fields.filter(field => !(field.name in value));
151
+ const scope = (0, _variable.useWorkflowVariableOptions)();
152
+ const mergedDisabled = disabled || form.disabled;
153
153
  return _react().default.createElement("fieldset", {
154
154
  className: (0, _css().css)`
155
155
  margin-top: .5em;
@@ -167,16 +167,9 @@ var _default = (0, _react2().observer)(({
167
167
  }, fields.filter(field => field.name in value).map(field => {
168
168
  var _field$uiSchema$title, _field$uiSchema;
169
169
 
170
- const VTypes = _objectSpread(_objectSpread({}, ['linkTo', 'hasMany', 'belongsToMany'].includes(field.type) ? {} : _calculators.VariableTypes), {}, {
171
- constant: {
172
- title: `{{t("Constant", { ns: "${_locale.NAMESPACE}" })}}`,
173
- value: 'constant'
174
- }
175
- });
176
-
177
- const operand = (0, _calculators.parseValue)(value[field.name], VTypes); // constant for associations to use Input, others to use CollectionField
170
+ // constant for associations to use Input, others to use CollectionField
178
171
  // dynamic values only support belongsTo/hasOne association, other association type should disable
179
- // TODO: try to use <ObjectField> to replace this map
172
+ const ConstantCompoent = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) ? AssociationInput : _client().CollectionField; // TODO: try to use <ObjectField> to replace this map
180
173
 
181
174
  return _react().default.createElement(_antd().Form.Item, {
182
175
  key: field.name,
@@ -187,30 +180,29 @@ var _default = (0, _react2().observer)(({
187
180
  display: flex;
188
181
  }
189
182
  `
190
- }, _react().default.createElement(_calculators.VariableTypesContext.Provider, {
191
- value: VTypes
192
- }, _react().default.createElement(_calculators.Operand, {
183
+ }, _react().default.createElement(_client().Variable.Input, {
184
+ scope: ['hasMany', 'belongsToMany'].includes(field.type) ? [] : scope,
193
185
  value: value[field.name],
194
186
  onChange: next => {
195
187
  _onChange(_objectSpread(_objectSpread({}, value), {}, {
196
188
  [field.name]: next
197
189
  }));
198
190
  }
199
- }, operand.type === 'constant' ? _react().default.createElement(_client().SchemaComponent, {
191
+ }, _react().default.createElement(_client().SchemaComponent, {
200
192
  schema: {
201
193
  type: 'void',
202
194
  properties: {
203
195
  [field.name]: {
204
- 'x-component': ['linkTo', 'belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) ? 'AssociationInput' : 'CollectionField'
196
+ 'x-component': ConstantCompoent,
197
+
198
+ ['x-validator']() {
199
+ return '';
200
+ }
201
+
205
202
  }
206
203
  }
207
- },
208
- components: {
209
- CollectionField: _client().CollectionField,
210
- AssociationInput
211
204
  }
212
- }) // ? <SchemaComponent schema={{ ...field.uiSchema, name: field.name }} />
213
- : null), _react().default.createElement(_antd().Button, {
205
+ })), !mergedDisabled ? _react().default.createElement(_antd().Button, {
214
206
  type: "link",
215
207
  icon: _react().default.createElement(_icons().CloseCircleOutlined, null),
216
208
  onClick: () => {
@@ -220,7 +212,7 @@ var _default = (0, _react2().observer)(({
220
212
 
221
213
  _onChange(rest);
222
214
  }
223
- })));
215
+ }) : null);
224
216
  }), unassignedFields.length ? _react().default.createElement(_antd().Dropdown, {
225
217
  overlay: _react().default.createElement(_antd().Menu, {
226
218
  onClick: ({
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function FilterDynamicComponent({ value, onChange, renderSchemaComponent }: {
3
+ value: any;
4
+ onChange: any;
5
+ renderSchemaComponent: any;
6
+ }): JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.FilterDynamicComponent = FilterDynamicComponent;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _client() {
19
+ const data = require("@nocobase/client");
20
+
21
+ _client = function _client() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ var _variable = require("../variable");
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+
32
+ function FilterDynamicComponent({
33
+ value,
34
+ onChange,
35
+ renderSchemaComponent
36
+ }) {
37
+ const scope = (0, _variable.useWorkflowVariableOptions)();
38
+ return _react().default.createElement(_client().Variable.Input, {
39
+ value: value,
40
+ onChange: onChange,
41
+ scope: scope
42
+ });
43
+ }
@@ -0,0 +1 @@
1
+ export declare function NullRender(): any;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NullRender = NullRender;
7
+
8
+ function NullRender() {
9
+ return null;
10
+ }
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export interface RadioWithTooltipOption {
3
+ value: any;
4
+ label: string;
5
+ tooltip?: string;
6
+ }
7
+ export declare function RadioWithTooltip(props: any): JSX.Element;
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.RadioWithTooltip = RadioWithTooltip;
7
+
8
+ function _react() {
9
+ const data = _interopRequireDefault(require("react"));
10
+
11
+ _react = function _react() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
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
+ function _icons() {
29
+ const data = require("@ant-design/icons");
30
+
31
+ _icons = function _icons() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _css() {
39
+ const data = require("@emotion/css");
40
+
41
+ _css = function _css() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ function _client() {
49
+ const data = require("@nocobase/client");
50
+
51
+ _client = function _client() {
52
+ return data;
53
+ };
54
+
55
+ return data;
56
+ }
57
+
58
+ const _excluded = ["options"];
59
+
60
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61
+
62
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
63
+
64
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
65
+
66
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
67
+
68
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
69
+
70
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
71
+
72
+ function RadioWithTooltip(props) {
73
+ const _props$options = props.options,
74
+ options = _props$options === void 0 ? [] : _props$options,
75
+ other = _objectWithoutProperties(props, _excluded);
76
+
77
+ const compile = (0, _client().useCompile)();
78
+ return _react().default.createElement(_antd().Radio.Group, _objectSpread({}, other), options.map(option => _react().default.createElement(_antd().Radio, {
79
+ key: option.value,
80
+ value: option.value
81
+ }, _react().default.createElement("span", {
82
+ className: (0, _css().css)`
83
+ & + .anticon {
84
+ margin-left: .25em;
85
+ }
86
+ `
87
+ }, compile(option.label)), option.tooltip && _react().default.createElement(_antd().Tooltip, {
88
+ title: compile(option.tooltip)
89
+ }, _react().default.createElement(_icons().QuestionCircleOutlined, {
90
+ style: {
91
+ color: '#666'
92
+ }
93
+ })))));
94
+ }
@@ -1,25 +1,27 @@
1
1
  export declare const EXECUTION_STATUS: {
2
2
  QUEUEING: any;
3
3
  STARTED: number;
4
- SUCCEEDED: number;
4
+ RESOLVED: number;
5
5
  FAILED: number;
6
+ ERROR: number;
7
+ ABORTED: number;
6
8
  CANCELED: number;
9
+ REJECTED: number;
7
10
  };
8
- export declare const ExecutionStatusOptions: ({
11
+ export declare const ExecutionStatusOptions: {
9
12
  value: any;
10
13
  label: string;
11
14
  color: string;
12
- } | {
13
- value: number;
14
- label: string;
15
- color?: undefined;
16
- })[];
15
+ }[];
17
16
  export declare const ExecutionStatusOptionsMap: {};
18
17
  export declare const JOB_STATUS: {
19
18
  PENDING: number;
20
19
  RESOLVED: number;
21
- REJECTED: number;
20
+ FAILED: number;
21
+ ERROR: number;
22
+ ABORTED: number;
22
23
  CANCELED: number;
24
+ REJECTED: number;
23
25
  };
24
26
  export declare const JobStatusOptions: {
25
27
  value: number;
@@ -32,9 +32,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
32
32
  const EXECUTION_STATUS = {
33
33
  QUEUEING: null,
34
34
  STARTED: 0,
35
- SUCCEEDED: 1,
35
+ RESOLVED: 1,
36
36
  FAILED: -1,
37
- CANCELED: -2
37
+ ERROR: -2,
38
+ ABORTED: -3,
39
+ CANCELED: -4,
40
+ REJECTED: -5
38
41
  };
39
42
  exports.EXECUTION_STATUS = EXECUTION_STATUS;
40
43
  const ExecutionStatusOptions = [{
@@ -46,16 +49,29 @@ const ExecutionStatusOptions = [{
46
49
  label: `{{t("On going", { ns: "${_locale.NAMESPACE}" })}}`,
47
50
  color: 'gold'
48
51
  }, {
49
- value: EXECUTION_STATUS.SUCCEEDED,
50
- label: `{{t("Succeeded", { ns: "${_locale.NAMESPACE}" })}}`,
52
+ value: EXECUTION_STATUS.RESOLVED,
53
+ label: `{{t("Resolved", { ns: "${_locale.NAMESPACE}" })}}`,
51
54
  color: 'green'
52
55
  }, {
53
56
  value: EXECUTION_STATUS.FAILED,
54
57
  label: `{{t("Failed", { ns: "${_locale.NAMESPACE}" })}}`,
55
58
  color: 'red'
59
+ }, {
60
+ value: EXECUTION_STATUS.ERROR,
61
+ label: `{{t("Error", { ns: "${_locale.NAMESPACE}" })}}`,
62
+ color: 'red'
63
+ }, {
64
+ value: EXECUTION_STATUS.ABORTED,
65
+ label: `{{t("Aborted", { ns: "${_locale.NAMESPACE}" })}}`,
66
+ color: 'red'
56
67
  }, {
57
68
  value: EXECUTION_STATUS.CANCELED,
58
- label: `{{t("Canceled", { ns: "${_locale.NAMESPACE}" })}}`
69
+ label: `{{t("Canceled", { ns: "${_locale.NAMESPACE}" })}}`,
70
+ color: 'volcano'
71
+ }, {
72
+ value: EXECUTION_STATUS.REJECTED,
73
+ label: `{{t("Rejected", { ns: "${_locale.NAMESPACE}" })}}`,
74
+ color: 'volcano'
59
75
  }];
60
76
  exports.ExecutionStatusOptions = ExecutionStatusOptions;
61
77
  const ExecutionStatusOptionsMap = ExecutionStatusOptions.reduce((map, option) => Object.assign(map, {
@@ -65,30 +81,52 @@ exports.ExecutionStatusOptionsMap = ExecutionStatusOptionsMap;
65
81
  const JOB_STATUS = {
66
82
  PENDING: 0,
67
83
  RESOLVED: 1,
68
- REJECTED: -1,
69
- CANCELED: -2
84
+ FAILED: -1,
85
+ ERROR: -2,
86
+ ABORTED: -3,
87
+ CANCELED: -4,
88
+ REJECTED: -5
70
89
  };
71
90
  exports.JOB_STATUS = JOB_STATUS;
72
91
  const JobStatusOptions = [{
73
92
  value: JOB_STATUS.PENDING,
74
93
  label: `{{t("Pending", { ns: "${_locale.NAMESPACE}" })}}`,
75
- color: '#d4c306',
94
+ color: 'gold',
76
95
  icon: _react().default.createElement(_icons().ClockCircleOutlined, null)
77
96
  }, {
78
97
  value: JOB_STATUS.RESOLVED,
79
- label: `{{t("Succeeded", { ns: "${_locale.NAMESPACE}" })}}`,
80
- color: '#67c068',
98
+ label: `{{t("Resolved", { ns: "${_locale.NAMESPACE}" })}}`,
99
+ color: 'green',
81
100
  icon: _react().default.createElement(_icons().CheckOutlined, null)
82
101
  }, {
83
- value: JOB_STATUS.REJECTED,
102
+ value: JOB_STATUS.FAILED,
84
103
  label: `{{t("Failed", { ns: "${_locale.NAMESPACE}" })}}`,
85
- color: '#f40',
104
+ color: 'red',
86
105
  icon: _react().default.createElement(_icons().ExclamationOutlined, null)
106
+ }, {
107
+ value: JOB_STATUS.ERROR,
108
+ label: `{{t("Error", { ns: "${_locale.NAMESPACE}" })}}`,
109
+ color: 'red',
110
+ icon: _react().default.createElement(_icons().CloseOutlined, null)
111
+ }, {
112
+ value: JOB_STATUS.ABORTED,
113
+ label: `{{t("Aborted", { ns: "${_locale.NAMESPACE}" })}}`,
114
+ color: 'red',
115
+ icon: _react().default.createElement(_icons().MinusOutlined, {
116
+ rotate: 90
117
+ })
87
118
  }, {
88
119
  value: JOB_STATUS.CANCELED,
89
120
  label: `{{t("Canceled", { ns: "${_locale.NAMESPACE}" })}}`,
90
- color: '#f40',
91
- icon: _react().default.createElement(_icons().CloseOutlined, null)
121
+ color: 'volcano',
122
+ icon: _react().default.createElement(_icons().MinusOutlined, {
123
+ rotate: 45
124
+ })
125
+ }, {
126
+ value: JOB_STATUS.REJECTED,
127
+ label: `{{t("Rejected", { ns: "${_locale.NAMESPACE}" })}}`,
128
+ color: 'volcano',
129
+ icon: _react().default.createElement(_icons().MinusOutlined, null)
92
130
  }];
93
131
  exports.JobStatusOptions = JobStatusOptions;
94
132
  const JobStatusOptionsMap = JobStatusOptions.reduce((map, option) => Object.assign(map, {
@@ -1,5 +1,4 @@
1
1
  export { triggers } from './triggers';
2
2
  export * from './nodes';
3
- export { calculators } from './calculators';
4
3
  export * from './FlowContext';
5
4
  export { WorkflowProvider as default } from './WorkflowProvider';
@@ -4,15 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
- triggers: true,
8
- calculators: true
7
+ triggers: true
9
8
  };
10
- Object.defineProperty(exports, "calculators", {
11
- enumerable: true,
12
- get: function get() {
13
- return _calculators.calculators;
14
- }
15
- });
16
9
  Object.defineProperty(exports, "default", {
17
10
  enumerable: true,
18
11
  get: function get() {
@@ -42,8 +35,6 @@ Object.keys(_nodes).forEach(function (key) {
42
35
  });
43
36
  });
44
37
 
45
- var _calculators = require("./calculators");
46
-
47
38
  var _FlowContext = require("./FlowContext");
48
39
 
49
40
  Object.keys(_FlowContext).forEach(function (key) {
@@ -107,24 +107,24 @@ declare const _default: {
107
107
  "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": string;
108
108
  "Trigger in executed workflow cannot be modified": string;
109
109
  "Node in executed workflow cannot be modified": string;
110
- "Can not delete": string;
111
- "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": string;
112
- "HTTP request": string;
110
+ 'Can not delete': string;
111
+ 'The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.': string;
112
+ 'HTTP request': string;
113
+ 'HTTP method': string;
113
114
  URL: string;
114
- "You can use the above available variables in URL.": string;
115
- "Request headers": string;
116
- "Name(e.g. Content-Type)": string;
117
- "Value(e.g. Application/json)": string;
118
- "Add request header": string;
119
- "HTTP method": string;
120
- "Request data": string;
121
- "Input request data": string;
122
- "You can use the above available variables in request data.": string;
123
- "Copy success!": string;
124
- "Copy variable output template statement": string;
125
- "Default headers is Content-Type: application/json": string;
126
- "Ignore fail request and continue workflow": string;
127
- "Syntax see": string;
128
- "Show available variable tool": string;
115
+ Headers: string;
116
+ 'Add request header': string;
117
+ Parameters: string;
118
+ 'Add parameter': string;
119
+ Body: string;
120
+ 'Use variable': string;
121
+ Format: string;
122
+ Insert: string;
123
+ 'Timeout config': string;
124
+ ms: string;
125
+ 'Input request data': string;
126
+ 'Only support standard JSON data': string;
127
+ '"Content-Type" only support "application/json", and no need to specify': string;
128
+ 'Ignore fail request and continue workflow': string;
129
129
  };
130
130
  export default _default;
@@ -113,24 +113,24 @@ var _default = {
113
113
  "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.": "Fields that are not assigned a value will be set to the default value, and those that do not have a default value are set to null.",
114
114
  "Trigger in executed workflow cannot be modified": "Trigger in executed workflow cannot be modified",
115
115
  "Node in executed workflow cannot be modified": "Node in executed workflow cannot be modified",
116
- "Can not delete": "Can not delete",
117
- "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.": "The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.",
118
- "HTTP request": "HTTP request",
119
- "URL": "URL",
120
- "You can use the above available variables in URL.": "You can use the above available variables in URL.",
121
- "Request headers": "Request headers",
122
- "Name(e.g. Content-Type)": "Name(e.g. Content-Type)",
123
- "Value(e.g. Application/json)": "Value(e.g. Application/json)",
124
- "Add request header": "Add request header",
125
- "HTTP method": "HTTP method",
126
- "Request data": "Request data",
127
- "Input request data": "Input request data",
128
- "You can use the above available variables in request data.": "You can use the above available variables in request data.",
129
- "Copy success!": "Copy success!",
130
- "Copy variable output template statement": "Copy variable output template statement",
131
- "Default headers is Content-Type: application/json": "Default headers is Content-Type: application/json",
132
- "Ignore fail request and continue workflow": "Ignore fail request and continue workflow",
133
- "Syntax see": "Syntax see",
134
- "Show available variable tool": "Show available variable tool"
116
+ 'Can not delete': 'Can not delete',
117
+ 'The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.': 'The result of this node has been referenced by other nodes ({{nodes}}), please remove the usage before deleting.',
118
+ 'HTTP request': 'HTTP request',
119
+ 'HTTP method': 'HTTP method',
120
+ 'URL': 'URL',
121
+ 'Headers': 'Headers',
122
+ 'Add request header': 'Add request header',
123
+ 'Parameters': 'Parameters',
124
+ 'Add parameter': 'Add parameter',
125
+ 'Body': 'Body',
126
+ 'Use variable': 'Use variable',
127
+ 'Format': 'Format',
128
+ 'Insert': 'Insert',
129
+ 'Timeout config': 'Timeout config',
130
+ 'ms': 'ms',
131
+ 'Input request data': 'Input request data',
132
+ 'Only support standard JSON data': 'Only support standard JSON data',
133
+ '"Content-Type" only support "application/json", and no need to specify': '"Content-Type" only support "application/json", and no need to specify',
134
+ 'Ignore fail request and continue workflow': 'Ignore fail request and continue workflow'
135
135
  };
136
136
  exports.default = _default;