@nocobase/plugin-workflow 0.9.1-alpha.1 → 0.9.2-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.
- package/lib/client/AddButton.js +50 -86
- package/lib/client/Branch.js +0 -13
- package/lib/client/ExecutionCanvas.js +16 -63
- package/lib/client/ExecutionLink.js +3 -21
- package/lib/client/ExecutionPage.js +1 -19
- package/lib/client/ExecutionResourceProvider.js +6 -23
- package/lib/client/FlowContext.js +0 -8
- package/lib/client/WorkflowCanvas.js +57 -129
- package/lib/client/WorkflowLink.js +3 -21
- package/lib/client/WorkflowPage.js +1 -19
- package/lib/client/WorkflowProvider.js +24 -47
- package/lib/client/WorkflowShortcut.js +0 -16
- package/lib/client/components/CollectionBlockInitializer.js +12 -22
- package/lib/client/components/CollectionFieldInitializers.js +5 -24
- package/lib/client/components/CollectionFieldset.js +33 -85
- package/lib/client/components/Duration.js +0 -14
- package/lib/client/components/DynamicExpression.d.ts +4 -0
- package/lib/client/components/DynamicExpression.js +102 -0
- package/lib/client/components/FieldsSelect.d.ts +2 -0
- package/lib/client/components/FieldsSelect.js +66 -0
- package/lib/client/components/FilterDynamicComponent.js +1 -10
- package/lib/client/components/NullRender.js +0 -1
- package/lib/client/components/OpenDrawer.js +10 -35
- package/lib/client/components/RadioWithTooltip.js +5 -27
- package/lib/client/components/renderEngineReference.d.ts +1 -0
- package/lib/client/components/renderEngineReference.js +55 -0
- package/lib/client/constants.js +0 -9
- package/lib/client/index.js +0 -6
- package/lib/client/interfaces/expression.d.ts +3 -0
- package/lib/client/interfaces/expression.js +37 -0
- package/lib/client/locale/index.js +5 -15
- package/lib/client/locale/pt-BR.d.ts +130 -0
- package/lib/client/locale/pt-BR.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +16 -1
- package/lib/client/locale/zh-CN.js +17 -2
- package/lib/client/nodes/calculation.d.ts +56 -7
- package/lib/client/nodes/calculation.js +141 -74
- package/lib/client/nodes/condition.d.ts +5 -9
- package/lib/client/nodes/condition.js +30 -93
- package/lib/client/nodes/create.d.ts +36 -12
- package/lib/client/nodes/create.js +14 -28
- package/lib/client/nodes/delay.d.ts +3 -7
- package/lib/client/nodes/delay.js +5 -14
- package/lib/client/nodes/destroy.d.ts +3 -11
- package/lib/client/nodes/destroy.js +14 -12
- package/lib/client/nodes/index.d.ts +2 -2
- package/lib/client/nodes/index.js +181 -222
- package/lib/client/nodes/manual/AssigneesSelect.js +8 -18
- package/lib/client/nodes/manual/ModeConfig.js +0 -27
- package/lib/client/nodes/manual/SchemaConfig.js +87 -449
- package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
- package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
- package/lib/client/nodes/manual/forms/customForm.js +411 -0
- package/lib/client/nodes/manual/index.d.ts +15 -6
- package/lib/client/nodes/manual/index.js +58 -54
- package/lib/client/nodes/parallel.d.ts +1 -2
- package/lib/client/nodes/parallel.js +16 -45
- package/lib/client/nodes/query.d.ts +30 -12
- package/lib/client/nodes/query.js +17 -25
- package/lib/client/nodes/request.d.ts +9 -17
- package/lib/client/nodes/request.js +13 -37
- package/lib/client/nodes/update.d.ts +27 -28
- package/lib/client/nodes/update.js +17 -18
- package/lib/client/schemas/collection.d.ts +20 -7
- package/lib/client/schemas/collection.js +27 -28
- package/lib/client/schemas/executions.js +3 -18
- package/lib/client/schemas/workflows.js +10 -33
- package/lib/client/style.js +75 -26
- package/lib/client/triggers/collection.d.ts +47 -18
- package/lib/client/triggers/collection.js +65 -123
- package/lib/client/triggers/index.d.ts +3 -6
- package/lib/client/triggers/index.js +146 -146
- package/lib/client/triggers/schedule/DateFieldsSelect.js +7 -32
- package/lib/client/triggers/schedule/EndsByField.js +1 -18
- package/lib/client/triggers/schedule/OnField.js +10 -38
- package/lib/client/triggers/schedule/RepeatField.js +4 -32
- package/lib/client/triggers/schedule/ScheduleConfig.js +25 -68
- package/lib/client/triggers/schedule/index.d.ts +21 -1
- package/lib/client/triggers/schedule/index.js +22 -24
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +31 -10
- package/lib/client/variable.d.ts +7 -6
- package/lib/client/variable.js +132 -71
- package/lib/index.js +0 -2
- package/lib/server/Plugin.d.ts +7 -7
- package/lib/server/Plugin.js +76 -111
- package/lib/server/Processor.d.ts +2 -0
- package/lib/server/Processor.js +62 -125
- package/lib/server/actions/index.js +3 -10
- package/lib/server/actions/nodes.js +34 -87
- package/lib/server/actions/workflows.js +46 -96
- package/lib/server/collections/executions.js +1 -1
- package/lib/server/collections/flow_nodes.js +7 -4
- package/lib/server/collections/jobs.js +1 -1
- package/lib/server/collections/workflows.js +3 -4
- package/lib/server/fields/expression-field.d.ts +8 -0
- package/lib/server/fields/expression-field.js +26 -0
- package/lib/server/fields/index.d.ts +1 -0
- package/lib/server/fields/index.js +12 -0
- package/lib/server/functions/index.js +3 -14
- package/lib/server/index.js +0 -6
- package/lib/server/instructions/calculation.js +22 -17
- package/lib/server/instructions/condition.js +8 -52
- package/lib/server/instructions/create.js +31 -15
- package/lib/server/instructions/delay.js +4 -32
- package/lib/server/instructions/destroy.js +6 -12
- package/lib/server/instructions/index.js +6 -23
- package/lib/server/instructions/manual/actions.js +22 -31
- package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
- package/lib/server/instructions/manual/index.d.ts +13 -12
- package/lib/server/instructions/manual/index.js +9 -47
- package/lib/server/instructions/parallel.js +9 -36
- package/lib/server/instructions/query.js +17 -15
- package/lib/server/instructions/request.js +7 -30
- package/lib/server/instructions/update.js +8 -14
- package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
- package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
- package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
- package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
- package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
- package/lib/server/models/Execution.js +0 -5
- package/lib/server/models/FlowNode.js +0 -5
- package/lib/server/models/Job.js +0 -5
- package/lib/server/models/Workflow.js +0 -5
- package/lib/server/triggers/collection.js +39 -61
- package/lib/server/triggers/index.js +3 -22
- package/lib/server/triggers/schedule.js +72 -194
- package/package.json +14 -11
|
@@ -4,83 +4,55 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireWildcard(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _css() {
|
|
19
15
|
const data = require("@emotion/css");
|
|
20
|
-
|
|
21
16
|
_css = function _css() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _icons() {
|
|
29
22
|
const data = require("@ant-design/icons");
|
|
30
|
-
|
|
31
23
|
_icons = function _icons() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _antd() {
|
|
39
29
|
const data = require("antd");
|
|
40
|
-
|
|
41
30
|
_antd = function _antd() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _2 = require(".");
|
|
49
|
-
|
|
50
36
|
var _Branch = require("../Branch");
|
|
51
|
-
|
|
52
37
|
var _FlowContext = require("../FlowContext");
|
|
53
|
-
|
|
54
38
|
var _style = require("../style");
|
|
55
|
-
|
|
56
39
|
var _locale = require("../locale");
|
|
57
|
-
|
|
58
40
|
var _RadioWithTooltip = require("../components/RadioWithTooltip");
|
|
59
|
-
|
|
60
41
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
61
|
-
|
|
62
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
63
|
-
|
|
64
43
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
65
|
-
|
|
66
44
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
|
-
|
|
68
45
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
69
|
-
|
|
70
46
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
71
|
-
|
|
72
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
73
|
-
|
|
47
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
74
48
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
75
|
-
|
|
76
49
|
var _default = {
|
|
77
50
|
title: `{{t("Parallel branch", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
78
51
|
type: 'parallel',
|
|
79
52
|
group: 'control',
|
|
80
53
|
fieldset: {
|
|
81
|
-
|
|
54
|
+
mode: {
|
|
82
55
|
type: 'string',
|
|
83
|
-
name: 'config.mode',
|
|
84
56
|
title: `{{t("Mode", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
85
57
|
'x-decorator': 'FormItem',
|
|
86
58
|
'x-component': 'RadioWithTooltip',
|
|
@@ -103,27 +75,22 @@ var _default = {
|
|
|
103
75
|
}
|
|
104
76
|
},
|
|
105
77
|
view: {},
|
|
106
|
-
|
|
107
78
|
render(data) {
|
|
108
79
|
const id = data.id,
|
|
109
|
-
|
|
110
|
-
|
|
80
|
+
mode = data.config.mode;
|
|
111
81
|
const _useFlowContext = (0, _FlowContext.useFlowContext)(),
|
|
112
|
-
|
|
113
|
-
|
|
82
|
+
workflow = _useFlowContext.workflow,
|
|
83
|
+
nodes = _useFlowContext.nodes;
|
|
114
84
|
const branches = nodes.reduce((result, node) => {
|
|
115
85
|
if (node.upstreamId === id && node.branchIndex != null) {
|
|
116
86
|
return result.concat(node);
|
|
117
87
|
}
|
|
118
|
-
|
|
119
88
|
return result;
|
|
120
89
|
}, []).sort((a, b) => a.branchIndex - b.branchIndex);
|
|
121
|
-
|
|
122
90
|
const _useState = (0, _react().useState)(Math.max(2, branches.length)),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
91
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
92
|
+
branchCount = _useState2[0],
|
|
93
|
+
setBranchCount = _useState2[1];
|
|
127
94
|
const tempBranches = Array(Math.max(0, branchCount - branches.length)).fill(null);
|
|
128
95
|
const lastBranchHead = branches[branches.length - 1];
|
|
129
96
|
return _react().default.createElement(_2.NodeDefaultView, {
|
|
@@ -154,7 +121,8 @@ var _default = {
|
|
|
154
121
|
}, _react().default.createElement(_antd().Button, {
|
|
155
122
|
shape: "circle",
|
|
156
123
|
icon: _react().default.createElement(_icons().PlusOutlined, null),
|
|
157
|
-
onClick: () => setBranchCount(branchCount - 1)
|
|
124
|
+
onClick: () => setBranchCount(branchCount - 1),
|
|
125
|
+
disabled: workflow.executed
|
|
158
126
|
})) : null
|
|
159
127
|
}))), _react().default.createElement("div", {
|
|
160
128
|
className: (0, _css().css)`
|
|
@@ -162,7 +130,10 @@ var _default = {
|
|
|
162
130
|
height: 2em;
|
|
163
131
|
`
|
|
164
132
|
}, _react().default.createElement(_antd().Tooltip, {
|
|
165
|
-
title: (0, _locale.lang)('Add branch')
|
|
133
|
+
title: (0, _locale.lang)('Add branch'),
|
|
134
|
+
className: (0, _css().css)`
|
|
135
|
+
visibility: ${workflow.executed ? 'hidden' : 'visible'}
|
|
136
|
+
`
|
|
166
137
|
}, _react().default.createElement(_antd().Button, {
|
|
167
138
|
icon: _react().default.createElement(_icons().PlusOutlined, null),
|
|
168
139
|
className: (0, _css().css)`
|
|
@@ -174,10 +145,10 @@ var _default = {
|
|
|
174
145
|
transform: rotate(-45deg);
|
|
175
146
|
}
|
|
176
147
|
`,
|
|
177
|
-
onClick: () => setBranchCount(branchCount + 1)
|
|
148
|
+
onClick: () => setBranchCount(branchCount + 1),
|
|
149
|
+
disabled: workflow.executed
|
|
178
150
|
})))));
|
|
179
151
|
},
|
|
180
|
-
|
|
181
152
|
components: {
|
|
182
153
|
RadioWithTooltip: _RadioWithTooltip.RadioWithTooltip
|
|
183
154
|
}
|
|
@@ -6,10 +6,9 @@ declare const _default: {
|
|
|
6
6
|
type: string;
|
|
7
7
|
group: string;
|
|
8
8
|
fieldset: {
|
|
9
|
-
|
|
9
|
+
collection: {
|
|
10
10
|
type: string;
|
|
11
11
|
title: string;
|
|
12
|
-
name: string;
|
|
13
12
|
required: boolean;
|
|
14
13
|
'x-reactions': string[];
|
|
15
14
|
'x-decorator': string;
|
|
@@ -18,21 +17,13 @@ declare const _default: {
|
|
|
18
17
|
placeholder: string;
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
|
|
20
|
+
params: {
|
|
22
21
|
type: string;
|
|
23
|
-
name: string;
|
|
24
|
-
title: string;
|
|
25
|
-
'x-decorator': string;
|
|
26
22
|
properties: {
|
|
27
23
|
filter: {
|
|
28
24
|
type: string;
|
|
29
25
|
title: string;
|
|
30
|
-
name: string;
|
|
31
26
|
'x-decorator': string;
|
|
32
|
-
'x-decorator-props': {
|
|
33
|
-
labelAlign: string;
|
|
34
|
-
className: string;
|
|
35
|
-
};
|
|
36
27
|
'x-component': string;
|
|
37
28
|
'x-component-props': {
|
|
38
29
|
useProps(): {
|
|
@@ -42,8 +33,34 @@ declare const _default: {
|
|
|
42
33
|
dynamicComponent: string;
|
|
43
34
|
};
|
|
44
35
|
};
|
|
36
|
+
appends: {
|
|
37
|
+
type: string;
|
|
38
|
+
title: string;
|
|
39
|
+
description: string;
|
|
40
|
+
'x-decorator': string;
|
|
41
|
+
'x-component': string;
|
|
42
|
+
'x-component-props': {
|
|
43
|
+
mode: string;
|
|
44
|
+
placeholder: string;
|
|
45
|
+
filter(field: any): boolean;
|
|
46
|
+
};
|
|
47
|
+
'x-reactions': {
|
|
48
|
+
dependencies: string[];
|
|
49
|
+
fulfill: {
|
|
50
|
+
state: {
|
|
51
|
+
visible: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
45
56
|
};
|
|
46
57
|
};
|
|
58
|
+
failOnEmpty: {
|
|
59
|
+
type: string;
|
|
60
|
+
title: string;
|
|
61
|
+
'x-decorator': string;
|
|
62
|
+
'x-component': string;
|
|
63
|
+
};
|
|
47
64
|
};
|
|
48
65
|
view: {};
|
|
49
66
|
scope: {
|
|
@@ -51,8 +68,9 @@ declare const _default: {
|
|
|
51
68
|
};
|
|
52
69
|
components: {
|
|
53
70
|
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
71
|
+
FieldsSelect: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
54
72
|
};
|
|
55
|
-
getOptions(config: any, types: any):
|
|
73
|
+
getOptions(config: any, types: any): import("../variable").VariableOption[];
|
|
56
74
|
useInitializers(node: any): SchemaInitializerItemOptions | null;
|
|
57
75
|
initializers: {
|
|
58
76
|
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
@@ -4,53 +4,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _client() {
|
|
9
8
|
const data = require("@nocobase/client");
|
|
10
|
-
|
|
11
9
|
_client = function _client() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
var _collection = require("../schemas/collection");
|
|
19
|
-
|
|
20
15
|
var _locale = require("../locale");
|
|
21
|
-
|
|
22
16
|
var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
|
|
23
|
-
|
|
24
17
|
var _CollectionFieldInitializers = require("../components/CollectionFieldInitializers");
|
|
25
|
-
|
|
26
18
|
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
27
|
-
|
|
28
19
|
var _variable = require("../variable");
|
|
29
|
-
|
|
20
|
+
var _FieldsSelect = require("../components/FieldsSelect");
|
|
30
21
|
var _default = {
|
|
31
22
|
title: `{{t("Query record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
32
23
|
type: 'query',
|
|
33
24
|
group: 'collection',
|
|
34
25
|
fieldset: {
|
|
35
|
-
|
|
36
|
-
//
|
|
26
|
+
collection: _collection.collection,
|
|
27
|
+
// multiple: {
|
|
37
28
|
// type: 'boolean',
|
|
38
29
|
// title: `{{t("Multiple records", { ns: "${NAMESPACE}" })}}`,
|
|
39
|
-
// name: 'config.multiple',
|
|
40
30
|
// 'x-decorator': 'FormItem',
|
|
41
31
|
// 'x-component': 'Checkbox',
|
|
42
32
|
// 'x-component-props': {
|
|
43
33
|
// disabled: true
|
|
44
34
|
// }
|
|
45
35
|
// },
|
|
46
|
-
|
|
36
|
+
params: {
|
|
47
37
|
type: 'object',
|
|
48
|
-
name: 'config.params',
|
|
49
|
-
title: '',
|
|
50
|
-
'x-decorator': 'FormItem',
|
|
51
38
|
properties: {
|
|
52
|
-
filter: _collection.filter
|
|
39
|
+
filter: _collection.filter,
|
|
40
|
+
appends: _collection.appends
|
|
53
41
|
}
|
|
42
|
+
},
|
|
43
|
+
failOnEmpty: {
|
|
44
|
+
type: 'boolean',
|
|
45
|
+
title: `{{t("Fail on no data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
46
|
+
'x-decorator': 'FormItem',
|
|
47
|
+
'x-component': 'Checkbox'
|
|
54
48
|
}
|
|
55
49
|
},
|
|
56
50
|
view: {},
|
|
@@ -58,23 +52,22 @@ var _default = {
|
|
|
58
52
|
useCollectionDataSource: _client().useCollectionDataSource
|
|
59
53
|
},
|
|
60
54
|
components: {
|
|
61
|
-
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent
|
|
55
|
+
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent,
|
|
56
|
+
FieldsSelect: _FieldsSelect.FieldsSelect
|
|
62
57
|
},
|
|
63
|
-
|
|
64
58
|
getOptions(config, types) {
|
|
59
|
+
var _config$params, _config$params$append;
|
|
65
60
|
return (0, _variable.useCollectionFieldOptions)({
|
|
66
61
|
collection: config.collection,
|
|
67
|
-
types
|
|
62
|
+
types,
|
|
63
|
+
depth: ((_config$params = config.params) === null || _config$params === void 0 ? void 0 : (_config$params$append = _config$params.appends) === null || _config$params$append === void 0 ? void 0 : _config$params$append.length) ? 1 : 0
|
|
68
64
|
});
|
|
69
65
|
},
|
|
70
|
-
|
|
71
66
|
useInitializers(node) {
|
|
72
67
|
var _node$title;
|
|
73
|
-
|
|
74
68
|
if (!node.config.collection) {
|
|
75
69
|
return null;
|
|
76
70
|
}
|
|
77
|
-
|
|
78
71
|
return {
|
|
79
72
|
type: 'item',
|
|
80
73
|
title: (_node$title = node.title) !== null && _node$title !== void 0 ? _node$title : `#${node.id}`,
|
|
@@ -83,7 +76,6 @@ var _default = {
|
|
|
83
76
|
dataSource: `{{$jobsMapByNodeId.${node.id}}}`
|
|
84
77
|
};
|
|
85
78
|
},
|
|
86
|
-
|
|
87
79
|
initializers: {
|
|
88
80
|
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
89
81
|
}
|
|
@@ -4,9 +4,8 @@ declare const _default: {
|
|
|
4
4
|
type: string;
|
|
5
5
|
group: string;
|
|
6
6
|
fieldset: {
|
|
7
|
-
|
|
7
|
+
method: {
|
|
8
8
|
type: string;
|
|
9
|
-
name: string;
|
|
10
9
|
required: boolean;
|
|
11
10
|
title: string;
|
|
12
11
|
'x-decorator': string;
|
|
@@ -21,23 +20,20 @@ declare const _default: {
|
|
|
21
20
|
}[];
|
|
22
21
|
default: string;
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
url: {
|
|
25
24
|
type: string;
|
|
26
|
-
name: string;
|
|
27
25
|
required: boolean;
|
|
28
26
|
title: string;
|
|
29
27
|
'x-decorator': string;
|
|
30
|
-
'x-decorator-props': {
|
|
31
|
-
className: string;
|
|
32
|
-
};
|
|
28
|
+
'x-decorator-props': {};
|
|
33
29
|
'x-component': string;
|
|
34
30
|
'x-component-props': {
|
|
35
31
|
placeholder: string;
|
|
32
|
+
className: string;
|
|
36
33
|
};
|
|
37
34
|
};
|
|
38
|
-
|
|
35
|
+
headers: {
|
|
39
36
|
type: string;
|
|
40
|
-
name: string;
|
|
41
37
|
'x-component': string;
|
|
42
38
|
'x-decorator': string;
|
|
43
39
|
title: string;
|
|
@@ -82,9 +78,8 @@ declare const _default: {
|
|
|
82
78
|
};
|
|
83
79
|
};
|
|
84
80
|
};
|
|
85
|
-
|
|
81
|
+
params: {
|
|
86
82
|
type: string;
|
|
87
|
-
name: string;
|
|
88
83
|
'x-component': string;
|
|
89
84
|
'x-decorator': string;
|
|
90
85
|
title: string;
|
|
@@ -128,9 +123,8 @@ declare const _default: {
|
|
|
128
123
|
};
|
|
129
124
|
};
|
|
130
125
|
};
|
|
131
|
-
|
|
126
|
+
data: {
|
|
132
127
|
type: string;
|
|
133
|
-
name: string;
|
|
134
128
|
title: string;
|
|
135
129
|
'x-decorator': string;
|
|
136
130
|
'x-decorator-props': {};
|
|
@@ -145,9 +139,8 @@ declare const _default: {
|
|
|
145
139
|
};
|
|
146
140
|
description: string;
|
|
147
141
|
};
|
|
148
|
-
|
|
142
|
+
timeout: {
|
|
149
143
|
type: string;
|
|
150
|
-
name: string;
|
|
151
144
|
title: string;
|
|
152
145
|
'x-decorator': string;
|
|
153
146
|
'x-decorator-props': {};
|
|
@@ -159,9 +152,8 @@ declare const _default: {
|
|
|
159
152
|
defaultValue: number;
|
|
160
153
|
};
|
|
161
154
|
};
|
|
162
|
-
|
|
155
|
+
ignoreFail: {
|
|
163
156
|
type: string;
|
|
164
|
-
name: string;
|
|
165
157
|
title: string;
|
|
166
158
|
'x-decorator': string;
|
|
167
159
|
'x-component': string;
|
|
@@ -4,39 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _antd() {
|
|
9
8
|
const data = require("@formily/antd");
|
|
10
|
-
|
|
11
9
|
_antd = function _antd() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _css() {
|
|
19
15
|
const data = require("@emotion/css");
|
|
20
|
-
|
|
21
16
|
_css = function _css() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
var _locale = require("../locale");
|
|
29
|
-
|
|
30
22
|
var _variable = require("../variable");
|
|
31
|
-
|
|
32
23
|
var _default = {
|
|
33
24
|
title: `{{t("HTTP request", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
34
25
|
type: 'request',
|
|
35
26
|
group: 'extended',
|
|
36
27
|
fieldset: {
|
|
37
|
-
|
|
28
|
+
method: {
|
|
38
29
|
type: 'string',
|
|
39
|
-
name: 'config.method',
|
|
40
30
|
required: true,
|
|
41
31
|
title: `{{t("HTTP method", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
42
32
|
'x-decorator': 'FormItem',
|
|
@@ -63,30 +53,20 @@ var _default = {
|
|
|
63
53
|
}],
|
|
64
54
|
default: 'POST'
|
|
65
55
|
},
|
|
66
|
-
|
|
56
|
+
url: {
|
|
67
57
|
type: 'string',
|
|
68
|
-
name: 'config.url',
|
|
69
58
|
required: true,
|
|
70
59
|
title: `{{t("URL", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
71
60
|
'x-decorator': 'FormItem',
|
|
72
|
-
'x-decorator-props': {
|
|
73
|
-
className: (0, _css().css)`
|
|
74
|
-
.ant-formily-item-control-content-component{
|
|
75
|
-
.ant-input-affix-wrapper,
|
|
76
|
-
.ant-input{
|
|
77
|
-
width: 100%;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
`
|
|
81
|
-
},
|
|
61
|
+
'x-decorator-props': {},
|
|
82
62
|
'x-component': 'Input',
|
|
83
63
|
'x-component-props': {
|
|
84
|
-
placeholder: 'https://www.nocobase.com'
|
|
64
|
+
placeholder: 'https://www.nocobase.com',
|
|
65
|
+
className: 'full-width'
|
|
85
66
|
}
|
|
86
67
|
},
|
|
87
|
-
|
|
68
|
+
headers: {
|
|
88
69
|
type: 'array',
|
|
89
|
-
name: 'config.headers',
|
|
90
70
|
'x-component': 'ArrayItems',
|
|
91
71
|
'x-decorator': 'FormItem',
|
|
92
72
|
title: `{{t("Headers", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -131,9 +111,8 @@ var _default = {
|
|
|
131
111
|
}
|
|
132
112
|
}
|
|
133
113
|
},
|
|
134
|
-
|
|
114
|
+
params: {
|
|
135
115
|
type: 'array',
|
|
136
|
-
name: 'config.params',
|
|
137
116
|
'x-component': 'ArrayItems',
|
|
138
117
|
'x-decorator': 'FormItem',
|
|
139
118
|
title: `{{t("Parameters", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
@@ -177,9 +156,8 @@ var _default = {
|
|
|
177
156
|
}
|
|
178
157
|
}
|
|
179
158
|
},
|
|
180
|
-
|
|
159
|
+
data: {
|
|
181
160
|
type: 'string',
|
|
182
|
-
name: 'config.data',
|
|
183
161
|
title: `{{t("Body", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
184
162
|
'x-decorator': 'FormItem',
|
|
185
163
|
'x-decorator-props': {},
|
|
@@ -190,16 +168,15 @@ var _default = {
|
|
|
190
168
|
minRows: 10
|
|
191
169
|
},
|
|
192
170
|
placeholder: `{{t("Input request data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
193
|
-
className: (0, _css().css)`
|
|
194
|
-
font-size:
|
|
171
|
+
className: (0, _css().cx)('full-width', (0, _css().css)`
|
|
172
|
+
font-size: 90%;
|
|
195
173
|
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
196
|
-
`
|
|
174
|
+
`)
|
|
197
175
|
},
|
|
198
176
|
description: `{{t("Only support standard JSON data", { ns: "${_locale.NAMESPACE}" })}}`
|
|
199
177
|
},
|
|
200
|
-
|
|
178
|
+
timeout: {
|
|
201
179
|
type: 'number',
|
|
202
|
-
name: 'config.timeout',
|
|
203
180
|
title: `{{t("Timeout config", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
204
181
|
'x-decorator': 'FormItem',
|
|
205
182
|
'x-decorator-props': {},
|
|
@@ -211,9 +188,8 @@ var _default = {
|
|
|
211
188
|
defaultValue: 5000
|
|
212
189
|
}
|
|
213
190
|
},
|
|
214
|
-
|
|
191
|
+
ignoreFail: {
|
|
215
192
|
type: 'boolean',
|
|
216
|
-
name: 'config.ignoreFail',
|
|
217
193
|
title: `{{t("Ignore fail request and continue workflow", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
218
194
|
'x-decorator': 'FormItem',
|
|
219
195
|
'x-component': 'Checkbox'
|
|
@@ -5,10 +5,9 @@ declare const _default: {
|
|
|
5
5
|
type: string;
|
|
6
6
|
group: string;
|
|
7
7
|
fieldset: {
|
|
8
|
-
|
|
8
|
+
collection: {
|
|
9
9
|
type: string;
|
|
10
10
|
title: string;
|
|
11
|
-
name: string;
|
|
12
11
|
required: boolean;
|
|
13
12
|
'x-reactions': string[];
|
|
14
13
|
'x-decorator': string;
|
|
@@ -17,35 +16,35 @@ declare const _default: {
|
|
|
17
16
|
placeholder: string;
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
title: string;
|
|
19
|
+
params: {
|
|
22
20
|
type: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
properties: {
|
|
22
|
+
filter: {
|
|
23
|
+
title: string;
|
|
24
|
+
"x-validator"(value: any): string;
|
|
25
|
+
type: string;
|
|
26
|
+
'x-decorator': string;
|
|
27
|
+
'x-component': string;
|
|
28
|
+
'x-component-props': {
|
|
29
|
+
useProps(): {
|
|
30
|
+
options: any[];
|
|
31
|
+
className: string;
|
|
32
|
+
};
|
|
33
|
+
dynamicComponent: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
values: {
|
|
37
|
+
type: string;
|
|
38
|
+
title: string;
|
|
39
|
+
'x-decorator': string;
|
|
40
|
+
'x-decorator-props': {
|
|
41
|
+
labelAlign: string;
|
|
42
|
+
className: string;
|
|
43
|
+
};
|
|
44
|
+
'x-component': string;
|
|
45
|
+
description: string;
|
|
34
46
|
};
|
|
35
|
-
dynamicComponent: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
'config.params.values': {
|
|
39
|
-
type: string;
|
|
40
|
-
title: string;
|
|
41
|
-
name: string;
|
|
42
|
-
'x-decorator': string;
|
|
43
|
-
'x-decorator-props': {
|
|
44
|
-
labelAlign: string;
|
|
45
|
-
className: string;
|
|
46
47
|
};
|
|
47
|
-
'x-component': string;
|
|
48
|
-
description: string;
|
|
49
48
|
};
|
|
50
49
|
};
|
|
51
50
|
view: {};
|
|
@@ -4,43 +4,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _client() {
|
|
9
8
|
const data = require("@nocobase/client");
|
|
10
|
-
|
|
11
9
|
_client = function _client() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
19
|
-
|
|
20
15
|
var _CollectionFieldset = _interopRequireDefault(require("../components/CollectionFieldset"));
|
|
21
|
-
|
|
16
|
+
var _utils = require("../utils");
|
|
22
17
|
var _locale = require("../locale");
|
|
23
|
-
|
|
24
18
|
var _collection = require("../schemas/collection");
|
|
25
|
-
|
|
26
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
-
|
|
28
20
|
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; }
|
|
29
|
-
|
|
30
21
|
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; }
|
|
31
|
-
|
|
32
|
-
function
|
|
33
|
-
|
|
22
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
24
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
25
|
var _default = {
|
|
35
26
|
title: `{{t("Update record", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
36
27
|
type: 'update',
|
|
37
28
|
group: 'collection',
|
|
38
29
|
fieldset: {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
collection: _collection.collection,
|
|
31
|
+
params: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
filter: _objectSpread(_objectSpread({}, _collection.filter), {}, {
|
|
35
|
+
title: `{{t("Only update records matching conditions", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
36
|
+
['x-validator'](value) {
|
|
37
|
+
return (0, _utils.isValidFilter)(value) ? '' : `{{t("Please add at least one condition", { ns: "${_locale.NAMESPACE}" })}}`;
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
values: _collection.values
|
|
41
|
+
}
|
|
42
|
+
}
|
|
44
43
|
},
|
|
45
44
|
view: {},
|
|
46
45
|
scope: {
|