@nocobase/plugin-workflow 0.9.0-alpha.2 → 0.9.1-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/README.md +9 -0
- package/README.zh-CN.md +9 -0
- package/lib/client/AddButton.d.ts +1 -1
- package/lib/client/AddButton.js +7 -2
- package/lib/client/Branch.d.ts +1 -1
- package/lib/client/ExecutionCanvas.js +5 -10
- package/lib/client/WorkflowCanvas.js +11 -40
- package/lib/client/WorkflowProvider.js +10 -1
- package/lib/client/components/CollectionBlockInitializer.d.ts +7 -0
- package/lib/client/components/CollectionBlockInitializer.js +81 -0
- package/lib/client/components/CollectionFieldInitializers.d.ts +2 -0
- package/lib/client/components/CollectionFieldInitializers.js +89 -0
- package/lib/client/components/CollectionFieldset.js +21 -25
- package/lib/client/components/FilterDynamicComponent.d.ts +6 -0
- package/lib/client/components/FilterDynamicComponent.js +43 -0
- package/lib/client/components/NullRender.d.ts +1 -0
- package/lib/client/components/NullRender.js +10 -0
- package/lib/client/components/RadioWithTooltip.d.ts +7 -0
- package/lib/client/components/RadioWithTooltip.js +94 -0
- package/lib/client/constants.d.ts +10 -8
- package/lib/client/constants.js +52 -14
- package/lib/client/index.d.ts +0 -1
- package/lib/client/index.js +1 -10
- package/lib/client/locale/en-US.d.ts +18 -18
- package/lib/client/locale/en-US.js +19 -19
- package/lib/client/locale/zh-CN.d.ts +47 -20
- package/lib/client/locale/zh-CN.js +48 -21
- package/lib/client/nodes/calculation.d.ts +40 -6
- package/lib/client/nodes/calculation.js +171 -19
- package/lib/client/nodes/condition.d.ts +67 -0
- package/lib/client/nodes/condition.js +287 -27
- package/lib/client/nodes/create.d.ts +8 -6
- package/lib/client/nodes/create.js +27 -33
- package/lib/client/nodes/delay.d.ts +2 -0
- package/lib/client/nodes/delay.js +8 -4
- package/lib/client/nodes/destroy.d.ts +2 -2
- package/lib/client/nodes/destroy.js +2 -2
- package/lib/client/nodes/index.d.ts +10 -2
- package/lib/client/nodes/index.js +73 -27
- package/lib/client/nodes/manual/AssigneesSelect.d.ts +6 -0
- package/lib/client/nodes/manual/AssigneesSelect.js +64 -0
- package/lib/client/nodes/manual/ModeConfig.d.ts +5 -0
- package/lib/client/nodes/manual/ModeConfig.js +160 -0
- package/lib/client/nodes/manual/SchemaConfig.d.ts +6 -0
- package/lib/client/nodes/manual/SchemaConfig.js +715 -0
- package/lib/client/nodes/manual/WorkflowTodo.d.ts +8 -0
- package/lib/client/nodes/manual/WorkflowTodo.js +691 -0
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.d.ts +5 -0
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +75 -0
- package/lib/client/nodes/manual/index.d.ts +64 -0
- package/lib/client/nodes/manual/index.js +146 -0
- package/lib/client/nodes/parallel.d.ts +11 -5
- package/lib/client/nodes/parallel.js +22 -34
- package/lib/client/nodes/query.d.ts +9 -14
- package/lib/client/nodes/query.js +38 -44
- package/lib/client/nodes/request.d.ts +75 -33
- package/lib/client/nodes/request.js +124 -63
- package/lib/client/nodes/update.d.ts +2 -2
- package/lib/client/nodes/update.js +2 -2
- package/lib/client/schemas/collection.js +1 -1
- package/lib/client/schemas/executions.js +1 -1
- package/lib/client/schemas/workflows.js +1 -1
- package/lib/client/style.js +0 -4
- package/lib/client/triggers/collection.d.ts +7 -3
- package/lib/client/triggers/collection.js +39 -48
- package/lib/client/triggers/index.d.ts +5 -2
- package/lib/client/triggers/index.js +34 -12
- package/lib/client/triggers/schedule/index.d.ts +7 -5
- package/lib/client/triggers/schedule/index.js +38 -79
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +38 -0
- package/lib/client/variable.d.ts +21 -0
- package/lib/client/variable.js +147 -0
- package/lib/server/Plugin.d.ts +3 -3
- package/lib/server/Plugin.js +12 -21
- package/lib/server/Processor.d.ts +9 -2
- package/lib/server/Processor.js +33 -33
- package/lib/server/actions/index.js +2 -4
- package/lib/server/actions/workflows.d.ts +1 -0
- package/lib/server/actions/workflows.js +80 -23
- package/lib/server/collections/executions.js +5 -7
- package/lib/server/collections/flow_nodes.js +6 -18
- package/lib/server/collections/jobs.js +3 -1
- package/lib/server/collections/workflows.js +8 -4
- package/lib/server/constants.d.ts +9 -3
- package/lib/server/constants.js +11 -5
- package/lib/server/functions/index.d.ts +4 -0
- package/lib/server/functions/index.js +38 -0
- package/lib/server/index.d.ts +0 -1
- package/lib/server/index.js +0 -14
- package/lib/server/instructions/calculation.d.ts +2 -7
- package/lib/server/instructions/calculation.js +32 -37
- package/lib/server/instructions/condition.d.ts +4 -4
- package/lib/server/instructions/condition.js +126 -54
- package/lib/server/instructions/index.js +1 -1
- package/lib/server/instructions/manual/actions.js +101 -0
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.d.ts +2 -0
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/jobs.js +2 -1
- package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.js +10 -10
- package/lib/server/instructions/manual/index.d.ts +25 -0
- package/lib/server/instructions/manual/index.js +200 -0
- package/lib/server/instructions/parallel.js +11 -7
- package/lib/server/instructions/request.d.ts +5 -4
- package/lib/server/instructions/request.js +60 -79
- package/lib/server/migrations/20230221032941-change-request-body-type.d.ts +5 -0
- package/lib/server/migrations/20230221032941-change-request-body-type.js +113 -0
- package/lib/server/migrations/20230221071831-calculation-expression.d.ts +4 -0
- package/lib/server/migrations/20230221071831-calculation-expression.js +143 -0
- package/lib/server/migrations/20230221121203-condition-calculation.d.ts +4 -0
- package/lib/server/migrations/20230221121203-condition-calculation.js +126 -0
- package/lib/server/migrations/20230221162902-jsonb-to-json.d.ts +4 -0
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +81 -0
- package/lib/server/triggers/schedule.js +11 -3
- package/package.json +10 -10
- package/lib/client/calculators.d.ts +0 -89
- package/lib/client/calculators.js +0 -668
- package/lib/client/components/CollectionFieldSelect.d.ts +0 -2
- package/lib/client/components/CollectionFieldSelect.js +0 -106
- package/lib/client/components/EjsTextArea.d.ts +0 -2
- package/lib/client/components/EjsTextArea.js +0 -232
- package/lib/server/actions/jobs.d.ts +0 -2
- package/lib/server/actions/jobs.js +0 -39
- package/lib/server/calculators/index.d.ts +0 -40
- package/lib/server/calculators/index.js +0 -187
- package/lib/server/extensions/assignees/actions.js +0 -75
- package/lib/server/extensions/assignees/index.d.ts +0 -2
- package/lib/server/extensions/assignees/index.js +0 -273
- package/lib/server/extensions/index.d.ts +0 -3
- package/lib/server/extensions/index.js +0 -13
- package/lib/server/instructions/prompt.d.ts +0 -19
- package/lib/server/instructions/prompt.js +0 -131
- /package/lib/server/{extensions/assignees → instructions/manual}/actions.d.ts +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.d.ts +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users.js +0 -0
- /package/lib/server/{extensions/assignees/collections → instructions/manual/collecions}/users_jobs.d.ts +0 -0
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import EjsTextArea from '../components/EjsTextArea';
|
|
1
|
+
import { useWorkflowVariableOptions } from '../variable';
|
|
3
2
|
declare const _default: {
|
|
4
3
|
title: string;
|
|
5
4
|
type: string;
|
|
6
5
|
group: string;
|
|
7
6
|
fieldset: {
|
|
8
|
-
'config.
|
|
7
|
+
'config.method': {
|
|
9
8
|
type: string;
|
|
10
9
|
name: string;
|
|
11
10
|
required: boolean;
|
|
12
11
|
title: string;
|
|
13
12
|
'x-decorator': string;
|
|
14
|
-
'x-decorator-props': {};
|
|
15
13
|
'x-component': string;
|
|
16
14
|
'x-component-props': {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
placeholder: string;
|
|
21
|
-
description: string;
|
|
15
|
+
showSearch: boolean;
|
|
16
|
+
allowClear: boolean;
|
|
22
17
|
};
|
|
18
|
+
enum: {
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
default: string;
|
|
23
23
|
};
|
|
24
|
-
'config.
|
|
24
|
+
'config.url': {
|
|
25
25
|
type: string;
|
|
26
26
|
name: string;
|
|
27
27
|
required: boolean;
|
|
28
28
|
title: string;
|
|
29
29
|
'x-decorator': string;
|
|
30
|
-
'x-decorator-props': {
|
|
30
|
+
'x-decorator-props': {
|
|
31
|
+
className: string;
|
|
32
|
+
};
|
|
31
33
|
'x-component': string;
|
|
32
34
|
'x-component-props': {
|
|
33
|
-
|
|
34
|
-
min: number;
|
|
35
|
-
step: number;
|
|
36
|
-
defaultValue: number;
|
|
35
|
+
placeholder: string;
|
|
37
36
|
};
|
|
38
37
|
};
|
|
39
38
|
'config.headers': {
|
|
@@ -63,7 +62,7 @@ declare const _default: {
|
|
|
63
62
|
'x-decorator': string;
|
|
64
63
|
'x-component': string;
|
|
65
64
|
'x-component-props': {
|
|
66
|
-
|
|
65
|
+
scope: typeof useWorkflowVariableOptions;
|
|
67
66
|
};
|
|
68
67
|
};
|
|
69
68
|
remove: {
|
|
@@ -83,37 +82,81 @@ declare const _default: {
|
|
|
83
82
|
};
|
|
84
83
|
};
|
|
85
84
|
};
|
|
86
|
-
'config.
|
|
85
|
+
'config.params': {
|
|
87
86
|
type: string;
|
|
88
87
|
name: string;
|
|
89
|
-
required: boolean;
|
|
90
|
-
title: string;
|
|
91
|
-
'x-decorator': string;
|
|
92
88
|
'x-component': string;
|
|
93
|
-
'x-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
'x-decorator': string;
|
|
90
|
+
title: string;
|
|
91
|
+
items: {
|
|
92
|
+
type: string;
|
|
93
|
+
properties: {
|
|
94
|
+
space: {
|
|
95
|
+
type: string;
|
|
96
|
+
'x-component': string;
|
|
97
|
+
properties: {
|
|
98
|
+
name: {
|
|
99
|
+
type: string;
|
|
100
|
+
'x-decorator': string;
|
|
101
|
+
'x-component': string;
|
|
102
|
+
'x-component-props': {
|
|
103
|
+
placeholder: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
value: {
|
|
107
|
+
type: string;
|
|
108
|
+
'x-decorator': string;
|
|
109
|
+
'x-component': string;
|
|
110
|
+
'x-component-props': {
|
|
111
|
+
scope: typeof useWorkflowVariableOptions;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
remove: {
|
|
115
|
+
type: string;
|
|
116
|
+
'x-decorator': string;
|
|
117
|
+
'x-component': string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
properties: {
|
|
124
|
+
add: {
|
|
125
|
+
type: string;
|
|
126
|
+
title: string;
|
|
127
|
+
'x-component': string;
|
|
128
|
+
};
|
|
97
129
|
};
|
|
98
|
-
enum: {
|
|
99
|
-
label: string;
|
|
100
|
-
value: string;
|
|
101
|
-
}[];
|
|
102
130
|
};
|
|
103
131
|
'config.data': {
|
|
104
132
|
type: string;
|
|
105
133
|
name: string;
|
|
106
|
-
'x-hidden': boolean;
|
|
107
134
|
title: string;
|
|
108
135
|
'x-decorator': string;
|
|
109
136
|
'x-decorator-props': {};
|
|
110
137
|
'x-component': string;
|
|
111
138
|
'x-component-props': {
|
|
139
|
+
scope: typeof useWorkflowVariableOptions;
|
|
112
140
|
autoSize: {
|
|
113
141
|
minRows: number;
|
|
114
142
|
};
|
|
115
143
|
placeholder: string;
|
|
116
|
-
|
|
144
|
+
className: string;
|
|
145
|
+
};
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
'config.timeout': {
|
|
149
|
+
type: string;
|
|
150
|
+
name: string;
|
|
151
|
+
title: string;
|
|
152
|
+
'x-decorator': string;
|
|
153
|
+
'x-decorator-props': {};
|
|
154
|
+
'x-component': string;
|
|
155
|
+
'x-component-props': {
|
|
156
|
+
addonAfter: string;
|
|
157
|
+
min: number;
|
|
158
|
+
step: number;
|
|
159
|
+
defaultValue: number;
|
|
117
160
|
};
|
|
118
161
|
};
|
|
119
162
|
'config.ignoreFail': {
|
|
@@ -127,12 +170,11 @@ declare const _default: {
|
|
|
127
170
|
view: {};
|
|
128
171
|
scope: {};
|
|
129
172
|
components: {
|
|
130
|
-
ArrayItems:
|
|
131
|
-
Item?:
|
|
173
|
+
ArrayItems: import("react").FC<import("react").HTMLAttributes<HTMLDivElement>> & import("@formily/antd").ArrayBaseMixins & {
|
|
174
|
+
Item?: import("react").FC<import("react").HTMLAttributes<HTMLDivElement> & {
|
|
132
175
|
type?: "divide" | "card";
|
|
133
176
|
}>;
|
|
134
177
|
};
|
|
135
|
-
EjsTextArea: typeof EjsTextArea;
|
|
136
178
|
};
|
|
137
179
|
};
|
|
138
180
|
export default _default;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _locale = require("../locale");
|
|
9
|
-
|
|
10
8
|
function _antd() {
|
|
11
9
|
const data = require("@formily/antd");
|
|
12
10
|
|
|
@@ -17,44 +15,73 @@ function _antd() {
|
|
|
17
15
|
return data;
|
|
18
16
|
}
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
function _css() {
|
|
19
|
+
const data = require("@emotion/css");
|
|
20
|
+
|
|
21
|
+
_css = function _css() {
|
|
22
|
+
return data;
|
|
23
|
+
};
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
return data;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var _locale = require("../locale");
|
|
29
|
+
|
|
30
|
+
var _variable = require("../variable");
|
|
23
31
|
|
|
24
32
|
var _default = {
|
|
25
33
|
title: `{{t("HTTP request", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
26
34
|
type: 'request',
|
|
27
35
|
group: 'extended',
|
|
28
36
|
fieldset: {
|
|
29
|
-
'config.
|
|
37
|
+
'config.method': {
|
|
30
38
|
type: 'string',
|
|
31
|
-
name: 'config.
|
|
39
|
+
name: 'config.method',
|
|
32
40
|
required: true,
|
|
33
|
-
title: `{{t("
|
|
41
|
+
title: `{{t("HTTP method", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
34
42
|
'x-decorator': 'FormItem',
|
|
35
|
-
'x-
|
|
36
|
-
'x-component': 'EjsTextArea',
|
|
43
|
+
'x-component': 'Select',
|
|
37
44
|
'x-component-props': {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
showSearch: false,
|
|
46
|
+
allowClear: false
|
|
47
|
+
},
|
|
48
|
+
enum: [{
|
|
49
|
+
label: 'GET',
|
|
50
|
+
value: 'GET'
|
|
51
|
+
}, {
|
|
52
|
+
label: 'POST',
|
|
53
|
+
value: 'POST'
|
|
54
|
+
}, {
|
|
55
|
+
label: 'PUT',
|
|
56
|
+
value: 'PUT'
|
|
57
|
+
}, {
|
|
58
|
+
label: 'PATCH',
|
|
59
|
+
value: 'PATCH'
|
|
60
|
+
}, {
|
|
61
|
+
label: 'DELETE',
|
|
62
|
+
value: 'DELETE'
|
|
63
|
+
}],
|
|
64
|
+
default: 'POST'
|
|
44
65
|
},
|
|
45
|
-
'config.
|
|
46
|
-
type: '
|
|
47
|
-
name: 'config.
|
|
66
|
+
'config.url': {
|
|
67
|
+
type: 'string',
|
|
68
|
+
name: 'config.url',
|
|
48
69
|
required: true,
|
|
49
|
-
title: `{{t("
|
|
70
|
+
title: `{{t("URL", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
50
71
|
'x-decorator': 'FormItem',
|
|
51
|
-
'x-decorator-props': {
|
|
52
|
-
|
|
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
|
+
},
|
|
82
|
+
'x-component': 'Input',
|
|
53
83
|
'x-component-props': {
|
|
54
|
-
|
|
55
|
-
min: 1,
|
|
56
|
-
step: 1000,
|
|
57
|
-
defaultValue: 5000
|
|
84
|
+
placeholder: 'https://www.nocobase.com'
|
|
58
85
|
}
|
|
59
86
|
},
|
|
60
87
|
'config.headers': {
|
|
@@ -62,8 +89,8 @@ var _default = {
|
|
|
62
89
|
name: 'config.headers',
|
|
63
90
|
'x-component': 'ArrayItems',
|
|
64
91
|
'x-decorator': 'FormItem',
|
|
65
|
-
title: `{{t("
|
|
66
|
-
description: `{{t("
|
|
92
|
+
title: `{{t("Headers", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
93
|
+
description: `{{t('"Content-Type" only support "application/json", and no need to specify', { ns: "${_locale.NAMESPACE}" })}}`,
|
|
67
94
|
items: {
|
|
68
95
|
type: 'object',
|
|
69
96
|
properties: {
|
|
@@ -76,15 +103,15 @@ var _default = {
|
|
|
76
103
|
'x-decorator': 'FormItem',
|
|
77
104
|
'x-component': 'Input',
|
|
78
105
|
'x-component-props': {
|
|
79
|
-
placeholder: `{{t("Name
|
|
106
|
+
placeholder: `{{t("Name")}}`
|
|
80
107
|
}
|
|
81
108
|
},
|
|
82
109
|
value: {
|
|
83
110
|
type: 'string',
|
|
84
111
|
'x-decorator': 'FormItem',
|
|
85
|
-
'x-component': 'Input',
|
|
112
|
+
'x-component': 'Variable.Input',
|
|
86
113
|
'x-component-props': {
|
|
87
|
-
|
|
114
|
+
scope: _variable.useWorkflowVariableOptions
|
|
88
115
|
}
|
|
89
116
|
},
|
|
90
117
|
remove: {
|
|
@@ -104,49 +131,84 @@ var _default = {
|
|
|
104
131
|
}
|
|
105
132
|
}
|
|
106
133
|
},
|
|
107
|
-
'config.
|
|
108
|
-
type: '
|
|
109
|
-
name: 'config.
|
|
110
|
-
|
|
111
|
-
title: `{{t("HTTP method", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
134
|
+
'config.params': {
|
|
135
|
+
type: 'array',
|
|
136
|
+
name: 'config.params',
|
|
137
|
+
'x-component': 'ArrayItems',
|
|
112
138
|
'x-decorator': 'FormItem',
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
title: `{{t("Parameters", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
140
|
+
items: {
|
|
141
|
+
type: 'object',
|
|
142
|
+
properties: {
|
|
143
|
+
space: {
|
|
144
|
+
type: 'void',
|
|
145
|
+
'x-component': 'Space',
|
|
146
|
+
properties: {
|
|
147
|
+
name: {
|
|
148
|
+
type: 'string',
|
|
149
|
+
'x-decorator': 'FormItem',
|
|
150
|
+
'x-component': 'Input',
|
|
151
|
+
'x-component-props': {
|
|
152
|
+
placeholder: `{{t("Name")}}`
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
value: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
'x-decorator': 'FormItem',
|
|
158
|
+
'x-component': 'Variable.Input',
|
|
159
|
+
'x-component-props': {
|
|
160
|
+
scope: _variable.useWorkflowVariableOptions
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
remove: {
|
|
164
|
+
type: 'void',
|
|
165
|
+
'x-decorator': 'FormItem',
|
|
166
|
+
'x-component': 'ArrayItems.Remove'
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
118
171
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
label: 'PUT',
|
|
127
|
-
value: 'PUT'
|
|
128
|
-
}, {
|
|
129
|
-
label: 'PATCH',
|
|
130
|
-
value: 'PATCH'
|
|
131
|
-
}, {
|
|
132
|
-
label: 'DELETE',
|
|
133
|
-
value: 'DELETE'
|
|
134
|
-
}]
|
|
172
|
+
properties: {
|
|
173
|
+
add: {
|
|
174
|
+
type: 'void',
|
|
175
|
+
title: `{{t("Add parameter", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
176
|
+
'x-component': 'ArrayItems.Addition'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
135
179
|
},
|
|
136
180
|
'config.data': {
|
|
137
181
|
type: 'string',
|
|
138
182
|
name: 'config.data',
|
|
139
|
-
|
|
140
|
-
title: `{{t("Request data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
183
|
+
title: `{{t("Body", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
141
184
|
'x-decorator': 'FormItem',
|
|
142
185
|
'x-decorator-props': {},
|
|
143
|
-
'x-component': '
|
|
186
|
+
'x-component': 'Variable.JSON',
|
|
144
187
|
'x-component-props': {
|
|
188
|
+
scope: _variable.useWorkflowVariableOptions,
|
|
145
189
|
autoSize: {
|
|
146
|
-
minRows:
|
|
190
|
+
minRows: 10
|
|
147
191
|
},
|
|
148
192
|
placeholder: `{{t("Input request data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
149
|
-
|
|
193
|
+
className: (0, _css().css)`
|
|
194
|
+
font-size: 85%;
|
|
195
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
196
|
+
`
|
|
197
|
+
},
|
|
198
|
+
description: `{{t("Only support standard JSON data", { ns: "${_locale.NAMESPACE}" })}}`
|
|
199
|
+
},
|
|
200
|
+
'config.timeout': {
|
|
201
|
+
type: 'number',
|
|
202
|
+
name: 'config.timeout',
|
|
203
|
+
title: `{{t("Timeout config", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
204
|
+
'x-decorator': 'FormItem',
|
|
205
|
+
'x-decorator-props': {},
|
|
206
|
+
'x-component': 'InputNumber',
|
|
207
|
+
'x-component-props': {
|
|
208
|
+
addonAfter: `{{t("ms", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
209
|
+
min: 1,
|
|
210
|
+
step: 1000,
|
|
211
|
+
defaultValue: 5000
|
|
150
212
|
}
|
|
151
213
|
},
|
|
152
214
|
'config.ignoreFail': {
|
|
@@ -160,8 +222,7 @@ var _default = {
|
|
|
160
222
|
view: {},
|
|
161
223
|
scope: {},
|
|
162
224
|
components: {
|
|
163
|
-
ArrayItems: _antd().ArrayItems
|
|
164
|
-
EjsTextArea: _EjsTextArea.default
|
|
225
|
+
ArrayItems: _antd().ArrayItems
|
|
165
226
|
}
|
|
166
227
|
};
|
|
167
228
|
exports.default = _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCollectionDataSource } from '@nocobase/client';
|
|
2
|
-
import {
|
|
2
|
+
import { FilterDynamicComponent } from '../components/FilterDynamicComponent';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
5
5
|
type: string;
|
|
@@ -53,7 +53,7 @@ declare const _default: {
|
|
|
53
53
|
useCollectionDataSource: typeof useCollectionDataSource;
|
|
54
54
|
};
|
|
55
55
|
components: {
|
|
56
|
-
|
|
56
|
+
FilterDynamicComponent: typeof FilterDynamicComponent;
|
|
57
57
|
CollectionFieldset: import("react").MemoExoticComponent<import("react").FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
58
58
|
};
|
|
59
59
|
};
|
|
@@ -15,7 +15,7 @@ function _client() {
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _FilterDynamicComponent = require("../components/FilterDynamicComponent");
|
|
19
19
|
|
|
20
20
|
var _CollectionFieldset = _interopRequireDefault(require("../components/CollectionFieldset"));
|
|
21
21
|
|
|
@@ -47,7 +47,7 @@ var _default = {
|
|
|
47
47
|
useCollectionDataSource: _client().useCollectionDataSource
|
|
48
48
|
},
|
|
49
49
|
components: {
|
|
50
|
-
|
|
50
|
+
FilterDynamicComponent: _FilterDynamicComponent.FilterDynamicComponent,
|
|
51
51
|
CollectionFieldset: _CollectionFieldset.default
|
|
52
52
|
}
|
|
53
53
|
};
|
package/lib/client/style.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { useCollectionDataSource } from '@nocobase/client';
|
|
2
|
+
import { SchemaInitializerItemOptions, useCollectionDataSource } from '@nocobase/client';
|
|
3
|
+
import { CollectionFieldInitializers } from '../components/CollectionFieldInitializers';
|
|
3
4
|
declare const _default: {
|
|
4
5
|
title: string;
|
|
5
6
|
type: string;
|
|
@@ -83,7 +84,10 @@ declare const _default: {
|
|
|
83
84
|
components: {
|
|
84
85
|
FieldsSelect: React.MemoExoticComponent<React.FunctionComponent<unknown>>;
|
|
85
86
|
};
|
|
86
|
-
getOptions(config: any): any[];
|
|
87
|
-
|
|
87
|
+
getOptions(config: any, types: any): any[];
|
|
88
|
+
useInitializers(config: any): SchemaInitializerItemOptions | null;
|
|
89
|
+
initializers: {
|
|
90
|
+
CollectionFieldInitializers: typeof CollectionFieldInitializers;
|
|
91
|
+
};
|
|
88
92
|
};
|
|
89
93
|
export default _default;
|
|
@@ -25,56 +25,46 @@ function _antd() {
|
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function
|
|
29
|
-
const data = require("@formily/
|
|
28
|
+
function _core() {
|
|
29
|
+
const data = require("@formily/core");
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
_core = function _core() {
|
|
32
32
|
return data;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function
|
|
39
|
-
const data = require("@
|
|
38
|
+
function _react2() {
|
|
39
|
+
const data = require("@formily/react");
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
_react2 = function _react2() {
|
|
42
42
|
return data;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
return data;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _collection = require("../schemas/collection");
|
|
51
|
-
|
|
52
|
-
function _css() {
|
|
53
|
-
const data = require("@emotion/css");
|
|
48
|
+
function _client() {
|
|
49
|
+
const data = require("@nocobase/client");
|
|
54
50
|
|
|
55
|
-
|
|
51
|
+
_client = function _client() {
|
|
56
52
|
return data;
|
|
57
53
|
};
|
|
58
54
|
|
|
59
55
|
return data;
|
|
60
56
|
}
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
const data = require("@formily/core");
|
|
58
|
+
var _collection = require("../schemas/collection");
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
60
|
+
var _variable = require("../variable");
|
|
68
61
|
|
|
69
|
-
|
|
70
|
-
}
|
|
62
|
+
var _CollectionBlockInitializer = require("../components/CollectionBlockInitializer");
|
|
71
63
|
|
|
72
|
-
var
|
|
64
|
+
var _CollectionFieldInitializers = require("../components/CollectionFieldInitializers");
|
|
73
65
|
|
|
74
66
|
var _locale = require("../locale");
|
|
75
67
|
|
|
76
|
-
var _calculators = require("../calculators");
|
|
77
|
-
|
|
78
68
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
79
69
|
|
|
80
70
|
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; }
|
|
@@ -103,11 +93,7 @@ const FieldsSelect = (0, _react2().observer)(props => {
|
|
|
103
93
|
setValuesIn('config.condition', null);
|
|
104
94
|
});
|
|
105
95
|
});
|
|
106
|
-
return _react().default.createElement(_antd().Select, _objectSpread(
|
|
107
|
-
className: (0, _css().css)`
|
|
108
|
-
min-width: 6em;
|
|
109
|
-
`
|
|
110
|
-
}), fields.filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true) && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type)).map(field => {
|
|
96
|
+
return _react().default.createElement(_antd().Select, _objectSpread({}, props), fields.filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : true) && !['linkTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type)).map(field => {
|
|
111
97
|
var _field$uiSchema;
|
|
112
98
|
|
|
113
99
|
return _react().default.createElement(_antd().Select.Option, {
|
|
@@ -207,34 +193,39 @@ var _default = {
|
|
|
207
193
|
FieldsSelect
|
|
208
194
|
},
|
|
209
195
|
|
|
210
|
-
getOptions(config) {
|
|
196
|
+
getOptions(config, types) {
|
|
211
197
|
const _useWorkflowTranslati = (0, _locale.useWorkflowTranslation)(),
|
|
212
198
|
t = _useWorkflowTranslati.t;
|
|
213
199
|
|
|
214
|
-
const
|
|
200
|
+
const fieldOptions = (0, _variable.useCollectionFieldOptions)({
|
|
201
|
+
collection: config.collection,
|
|
202
|
+
types
|
|
203
|
+
});
|
|
204
|
+
const options = [...((fieldOptions === null || fieldOptions === void 0 ? void 0 : fieldOptions.length) ? [{
|
|
205
|
+
label: t('Trigger data'),
|
|
206
|
+
key: 'data',
|
|
215
207
|
value: 'data',
|
|
216
|
-
|
|
217
|
-
}];
|
|
208
|
+
children: fieldOptions
|
|
209
|
+
}] : [])];
|
|
218
210
|
return options;
|
|
219
211
|
},
|
|
220
212
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
213
|
+
useInitializers(config) {
|
|
214
|
+
if (!config.collection) {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return {
|
|
219
|
+
type: 'item',
|
|
220
|
+
title: `{{t("Trigger data", { ns: "${_locale.NAMESPACE}" })}}`,
|
|
221
|
+
component: _CollectionBlockInitializer.CollectionBlockInitializer,
|
|
222
|
+
collection: config.collection,
|
|
223
|
+
dataSource: '{{$context.data}}'
|
|
224
|
+
};
|
|
225
|
+
},
|
|
229
226
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
value: options === null || options === void 0 ? void 0 : options.path,
|
|
233
|
-
onChange: path => {
|
|
234
|
-
_onChange(`{{$context.data.${path}}}`);
|
|
235
|
-
}
|
|
236
|
-
});
|
|
227
|
+
initializers: {
|
|
228
|
+
CollectionFieldInitializers: _CollectionFieldInitializers.CollectionFieldInitializers
|
|
237
229
|
}
|
|
238
|
-
|
|
239
230
|
};
|
|
240
231
|
exports.default = _default;
|