@nocobase/plugin-workflow-request 2.2.0-alpha.1 → 2.2.0-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.
- package/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/305.140661137327023c.js +10 -0
- package/dist/client/RequestInstruction.d.ts +2 -222
- package/dist/client/index.js +1 -1
- package/dist/client-v2/305.4d97590a17776080.js +10 -0
- package/dist/client-v2/RequestInstruction.d.ts +35 -0
- package/dist/client-v2/components/RequestFieldset.d.ts +11 -0
- package/dist/client-v2/constants.d.ts +43 -0
- package/dist/client-v2/index.d.ts +10 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +11 -0
- package/dist/client-v2/plugin.d.ts +12 -0
- package/dist/client-v2/types.d.ts +26 -0
- package/dist/client-v2/utils.d.ts +15 -0
- package/dist/externalVersion.js +8 -9
- package/dist/locale/de-DE.json +2 -2
- package/dist/locale/es-ES.json +3 -3
- package/dist/locale/fr-FR.json +3 -3
- package/dist/locale/hu-HU.json +2 -2
- package/dist/locale/id-ID.json +2 -2
- package/dist/locale/it-IT.json +4 -4
- package/dist/locale/nl-NL.json +4 -4
- package/dist/locale/pt-BR.json +3 -3
- package/dist/locale/tr-TR.json +3 -3
- package/dist/locale/uk-UA.json +3 -3
- package/dist/locale/vi-VN.json +2 -2
- package/dist/locale/zh-CN.json +2 -2
- package/dist/locale/zh-TW.json +3 -3
- package/dist/node_modules/joi/package.json +1 -1
- package/dist/server/RequestInstruction.js +1 -2
- package/package.json +3 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_request=self.webpackChunk_nocobase_plugin_workflow_request||[]).push([["305"],{160:function(e,t,n){n.d(t,{RequestFieldset:function(){return b}});var r=n(59),a=n(155),l=n.n(a),o=n(375),i=n(197),c=n(401),m=n(488),u=n(1);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.name,n=e.label,a=e.addLabel,c=e.addButtonFullWidth,u=void 0!==c&&c,s=e.extra,d=e.valueName,f=void 0===d?"value":d,p=e.renderValueInput,y=(0,m.kj)();return l().createElement(r.Form.Item,{label:n,extra:s},l().createElement(r.Form.List,{name:t},function(e,t){var n=t.add,c=t.remove;return l().createElement(r.Space,{direction:"vertical",style:{display:"flex"}},e.map(function(e){var t;return l().createElement(r.Flex,{key:e.key,align:"flex-start",gap:"small",style:{width:"100%"}},l().createElement(r.Form.Item,{name:[e.name,"name"],style:{flex:1,marginBottom:0}},l().createElement(r.Input,{placeholder:y("Name")})),l().createElement(r.Form.Item,{name:[e.name,f],style:{flex:1,marginBottom:0}},null!=(t=null==p?void 0:p(e))?t:l().createElement(i.WorkflowVariableInput,{placeholder:y("Value")})),l().createElement(r.Form.Item,{style:{marginBottom:0}},l().createElement(r.Button,{"aria-label":y("Delete"),icon:l().createElement(o.DeleteOutlined,null),onClick:function(){return c(e.name)}})))}),l().createElement(r.Button,{icon:l().createElement(o.PlusOutlined,null),onClick:function(){return n()},style:u?{width:"100%"}:{alignSelf:"flex-start"}},a))}))}function f(e){var t,n=e.field,u=e.listName,d=e.onRemove,f=(0,m.kj)(),p=r.Form.useFormInstance(),y=null!=(t=r.Form.useWatch(((function(e){if(Array.isArray(e))return s(e)})(u)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e){if(e){if("string"==typeof e)return s(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([n.name,"valueType"]),p))?t:c.qg,b=(0,a.useMemo)(function(){return"file"===y?l().createElement(i.WorkflowVariableInput,{variableOptions:{types:[c.nd]}}):l().createElement(i.WorkflowVariableInput,{placeholder:f("Value")})},[f,y]),g="file"===y?"file":"text";return l().createElement(r.Flex,{align:"flex-start",gap:"small",style:{width:"100%"}},l().createElement(r.Form.Item,{name:[n.name,"name"],style:{flex:1,marginBottom:0}},l().createElement(r.Input,{placeholder:f("Name")})),l().createElement(r.Form.Item,{name:[n.name,"valueType"],initialValue:c.qg,style:{marginBottom:0}},l().createElement(r.Select,{allowClear:!1,options:c.LC.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={label:f(e.label)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})})),l().createElement(r.Form.Item,{key:"".concat(n.key,"-").concat(g),name:[n.name,g],style:{flex:1,marginBottom:0}},b),l().createElement(r.Form.Item,{style:{marginBottom:0}},l().createElement(r.Button,{"aria-label":f("Delete"),icon:l().createElement(o.DeleteOutlined,null),onClick:function(){return d(n.name)}})))}function p(e){var t=e.name,n=e.label,a=(0,m.kj)(),i=Array.isArray(t)?t:[t];return l().createElement(r.Form.Item,{label:n},l().createElement(r.Form.List,{name:t},function(e,t){var n=t.add,m=t.remove;return l().createElement(r.Space,{direction:"vertical",style:{display:"flex"}},e.map(function(e){return l().createElement(f,{key:e.key,field:e,listName:i,onRemove:m})}),l().createElement(r.Button,{icon:l().createElement(o.PlusOutlined,null),onClick:function(){return n({valueType:c.qg})},style:{width:"100%"}},a("Add key-value pairs")))}))}function y(){var e,t,n=(0,m.kj)(),a=r.Form.useFormInstance(),o=r.Form.useWatch(["config","contentType"],a),s=null!=(e=null!=(t=a.getFieldValue(["config","contentType"]))?t:o)?e:c.xh,f=(0,u.xh)(s);return"json"===f?l().createElement(r.Form.Item,{name:["config","data"],label:n("Body"),initialValue:(0,u.WN)(s)},l().createElement(i.WorkflowVariableJsonTextArea,{autoSize:{minRows:10},placeholder:n("Input request data")})):"pairs"===f?l().createElement(d,{name:["config","data"],label:n("Body"),addLabel:n("Add key-value pairs"),renderValueInput:function(){return l().createElement(i.WorkflowVariableInput,{placeholder:n("Value")})}}):"multipart"===f?l().createElement(p,{name:["config","data"],label:n("Body")}):l().createElement(r.Form.Item,{name:["config","data"],label:n("Body"),initialValue:(0,u.WN)(s)},l().createElement(i.WorkflowVariableTextArea,{autoSize:{minRows:10},placeholder:"application/xml"===s?'<?xml version="1.0" encoding="UTF-8"?>':void 0}))}function b(){var e,t,n,o,s=(0,m.kj)();return e=r.Form.useFormInstance(),t=r.Form.useWatch(["config","contentType"],e),n=(0,a.useRef)(),o=(0,a.useRef)(!1),(0,a.useEffect)(function(){var r,a,l=null!=(r=null!=(a=e.getFieldValue(["config","contentType"]))?a:t)?r:c.xh,i=e.getFieldValue(["config","data"]);if(!o.current){o.current=!0,n.current=l,void 0===i&&e.setFieldValue(["config","data"],(0,u.WN)(l));return}n.current!==l&&e.setFieldValue(["config","data"],(0,u.WN)(l)),n.current=l},[t,e]),l().createElement(l().Fragment,null,l().createElement(r.Form.Item,{name:["config","method"],label:s("HTTP method"),rules:[{required:!0}],initialValue:c.OQ},l().createElement(r.Select,{showSearch:!1,allowClear:!1,options:c.Tm,className:"auto-width"})),l().createElement(r.Form.Item,{name:["config","url"],label:s("URL"),rules:[{required:!0}]},l().createElement(i.WorkflowVariableInput,{placeholder:"https://www.nocobase.com"})),l().createElement(r.Form.Item,{name:["config","contentType"],label:s("Content-Type"),initialValue:c.xh},l().createElement(r.Select,{allowClear:!1,options:c.cf})),l().createElement(d,{name:["config","headers"],label:s("Headers"),addLabel:s("Add request header"),addButtonFullWidth:!0,extra:s('"Content-Type" will be ignored from headers.')}),l().createElement(d,{name:["config","params"],label:s("Parameters"),addLabel:s("Add parameter"),addButtonFullWidth:!0}),l().createElement(y,null),l().createElement(r.Form.Item,{name:["config","timeout"],label:s("Timeout config"),initialValue:c.cS},l().createElement(r.InputNumber,{addonAfter:s("ms"),min:1,step:1e3,style:{width:"100%"}})),l().createElement(r.Form.Item,{name:["config","onlyData"],label:s("Only return response data"),valuePropName:"checked",extra:s("If enabled, only the response data will be saved into result, and the status code and headers will be ignored."),initialValue:!0},l().createElement(r.Checkbox,null)),l().createElement(r.Form.Item,{name:["config","ignoreFail"],label:s("Ignore failed request and continue workflow"),valuePropName:"checked"},l().createElement(r.Checkbox,null)))}}}]);
|
|
@@ -6,226 +6,6 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
declare function BodyComponent(props: any): React.JSX.Element;
|
|
12
|
-
export default class extends Instruction {
|
|
13
|
-
title: string;
|
|
14
|
-
type: string;
|
|
15
|
-
group: string;
|
|
16
|
-
description: string;
|
|
17
|
-
icon: React.JSX.Element;
|
|
18
|
-
fieldset: {
|
|
19
|
-
method: {
|
|
20
|
-
type: string;
|
|
21
|
-
required: boolean;
|
|
22
|
-
title: string;
|
|
23
|
-
'x-decorator': string;
|
|
24
|
-
'x-component': string;
|
|
25
|
-
'x-component-props': {
|
|
26
|
-
showSearch: boolean;
|
|
27
|
-
allowClear: boolean;
|
|
28
|
-
className: string;
|
|
29
|
-
};
|
|
30
|
-
enum: {
|
|
31
|
-
label: string;
|
|
32
|
-
value: string;
|
|
33
|
-
}[];
|
|
34
|
-
default: string;
|
|
35
|
-
};
|
|
36
|
-
url: {
|
|
37
|
-
type: string;
|
|
38
|
-
required: boolean;
|
|
39
|
-
title: string;
|
|
40
|
-
'x-decorator': string;
|
|
41
|
-
'x-decorator-props': {};
|
|
42
|
-
'x-component': string;
|
|
43
|
-
'x-component-props': {
|
|
44
|
-
placeholder: string;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
contentType: {
|
|
48
|
-
type: string;
|
|
49
|
-
title: string;
|
|
50
|
-
'x-decorator': string;
|
|
51
|
-
'x-component': string;
|
|
52
|
-
'x-component-props': {
|
|
53
|
-
allowClear: boolean;
|
|
54
|
-
};
|
|
55
|
-
enum: {
|
|
56
|
-
label: string;
|
|
57
|
-
value: string;
|
|
58
|
-
}[];
|
|
59
|
-
default: string;
|
|
60
|
-
};
|
|
61
|
-
headers: {
|
|
62
|
-
type: string;
|
|
63
|
-
'x-component': string;
|
|
64
|
-
'x-decorator': string;
|
|
65
|
-
title: string;
|
|
66
|
-
description: string;
|
|
67
|
-
items: {
|
|
68
|
-
type: string;
|
|
69
|
-
properties: {
|
|
70
|
-
space: {
|
|
71
|
-
type: string;
|
|
72
|
-
'x-component': string;
|
|
73
|
-
'x-component-props': {
|
|
74
|
-
style: {
|
|
75
|
-
flexWrap: string;
|
|
76
|
-
maxWidth: string;
|
|
77
|
-
};
|
|
78
|
-
className: string;
|
|
79
|
-
};
|
|
80
|
-
properties: {
|
|
81
|
-
name: {
|
|
82
|
-
type: string;
|
|
83
|
-
'x-decorator': string;
|
|
84
|
-
'x-component': string;
|
|
85
|
-
'x-component-props': {
|
|
86
|
-
placeholder: string;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
value: {
|
|
90
|
-
type: string;
|
|
91
|
-
'x-decorator': string;
|
|
92
|
-
'x-component': string;
|
|
93
|
-
'x-component-props': {
|
|
94
|
-
useTypedConstant: boolean;
|
|
95
|
-
placeholder: string;
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
remove: {
|
|
99
|
-
type: string;
|
|
100
|
-
'x-decorator': string;
|
|
101
|
-
'x-component': string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
};
|
|
107
|
-
properties: {
|
|
108
|
-
add: {
|
|
109
|
-
type: string;
|
|
110
|
-
title: string;
|
|
111
|
-
'x-component': string;
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
params: {
|
|
116
|
-
type: string;
|
|
117
|
-
'x-component': string;
|
|
118
|
-
'x-decorator': string;
|
|
119
|
-
title: string;
|
|
120
|
-
items: {
|
|
121
|
-
type: string;
|
|
122
|
-
properties: {
|
|
123
|
-
space: {
|
|
124
|
-
type: string;
|
|
125
|
-
'x-component': string;
|
|
126
|
-
'x-component-props': {
|
|
127
|
-
style: {
|
|
128
|
-
flexWrap: string;
|
|
129
|
-
maxWidth: string;
|
|
130
|
-
};
|
|
131
|
-
className: string;
|
|
132
|
-
};
|
|
133
|
-
properties: {
|
|
134
|
-
name: {
|
|
135
|
-
type: string;
|
|
136
|
-
'x-decorator': string;
|
|
137
|
-
'x-component': string;
|
|
138
|
-
'x-component-props': {
|
|
139
|
-
placeholder: string;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
value: {
|
|
143
|
-
type: string;
|
|
144
|
-
'x-decorator': string;
|
|
145
|
-
'x-component': string;
|
|
146
|
-
'x-component-props': {
|
|
147
|
-
useTypedConstant: boolean;
|
|
148
|
-
placeholder: string;
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
remove: {
|
|
152
|
-
type: string;
|
|
153
|
-
'x-decorator': string;
|
|
154
|
-
'x-component': string;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
|
-
properties: {
|
|
161
|
-
add: {
|
|
162
|
-
type: string;
|
|
163
|
-
title: string;
|
|
164
|
-
'x-component': string;
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
data: {
|
|
169
|
-
type: string;
|
|
170
|
-
title: string;
|
|
171
|
-
'x-decorator': string;
|
|
172
|
-
'x-decorator-props': {};
|
|
173
|
-
'x-component': string;
|
|
174
|
-
};
|
|
175
|
-
timeout: {
|
|
176
|
-
type: string;
|
|
177
|
-
title: string;
|
|
178
|
-
'x-decorator': string;
|
|
179
|
-
'x-decorator-props': {};
|
|
180
|
-
'x-component': string;
|
|
181
|
-
'x-component-props': {
|
|
182
|
-
addonAfter: string;
|
|
183
|
-
min: number;
|
|
184
|
-
step: number;
|
|
185
|
-
defaultValue: number;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
onlyData: {
|
|
189
|
-
type: string;
|
|
190
|
-
'x-content': string;
|
|
191
|
-
description: string;
|
|
192
|
-
'x-decorator': string;
|
|
193
|
-
'x-component': string;
|
|
194
|
-
default: boolean;
|
|
195
|
-
};
|
|
196
|
-
ignoreFail: {
|
|
197
|
-
type: string;
|
|
198
|
-
'x-content': string;
|
|
199
|
-
'x-decorator': string;
|
|
200
|
-
'x-component': string;
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
components: {
|
|
204
|
-
ArrayItems: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
|
|
205
|
-
Item: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
|
|
206
|
-
type?: "card" | "divide";
|
|
207
|
-
}>;
|
|
208
|
-
};
|
|
209
|
-
BodyComponent: typeof BodyComponent;
|
|
210
|
-
WorkflowVariableJSON: typeof WorkflowVariableJSON;
|
|
211
|
-
WorkflowVariableTextArea: typeof WorkflowVariableTextArea;
|
|
212
|
-
WorkflowVariableRawTextArea: typeof WorkflowVariableRawTextArea;
|
|
213
|
-
WorkflowVariableInput: typeof WorkflowVariableInput;
|
|
214
|
-
};
|
|
215
|
-
useVariables({ key, title, config }: {
|
|
216
|
-
key: any;
|
|
217
|
-
title: any;
|
|
218
|
-
config: any;
|
|
219
|
-
}, { types }: {
|
|
220
|
-
types: any;
|
|
221
|
-
}): {
|
|
222
|
-
value: any;
|
|
223
|
-
label: any;
|
|
224
|
-
children: {
|
|
225
|
-
value: string;
|
|
226
|
-
label: string;
|
|
227
|
-
}[];
|
|
228
|
-
};
|
|
229
|
-
testable: boolean;
|
|
9
|
+
import V2RequestInstruction from '../client-v2/RequestInstruction';
|
|
10
|
+
export default class extends V2RequestInstruction {
|
|
230
11
|
}
|
|
231
|
-
export {};
|
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/shared"),require("react"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-request",["react-i18next","@formily/antd-v5","@formily/core","@formily/shared","react","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/plugin-workflow/client"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-request"]=t(require("react-i18next"),require("@formily/antd-v5"),require("@formily/core"),require("@formily/shared"),require("react"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client")):e["@nocobase/plugin-workflow-request"]=t(e["react-i18next"],e["@formily/antd-v5"],e["@formily/core"],e["@formily/shared"],e.react,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/plugin-workflow/client"])}(self,function(e,t,r,o,n,a,i,c,l){return function(){"use strict";var p={375:function(e){e.exports=c},418:function(e){e.exports=t},452:function(e){e.exports=r},230:function(e){e.exports=i},166:function(e){e.exports=o},342:function(e){e.exports=a},990:function(e){e.exports=l},155:function(e){e.exports=n},953:function(t){t.exports=e}},u={};function s(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return p[e](r,r.exports,s),r.exports}s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(f=s.g.location+"");var f,m=s.g.document;if(!f&&m&&(m.currentScript&&"SCRIPT"===m.currentScript.tagName.toUpperCase()&&(f=m.currentScript.src),!f)){var d=m.getElementsByTagName("script");if(d.length)for(var y=d.length-1;y>-1&&(!f||!/^http(s?):/.test(f));)f=d[y--].src}if(!f)throw Error("Automatic publicPath is not supported in this browser");s.p=f.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-request/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",n="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",i=a.indexOf(n);e=i>=0?a.slice(0,i+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-request/dist/client/"}s.p=e}(),!function(){s.r(b),s.d(b,{default:function(){return N}});var e=s(342),t=s(155),r=s.n(t),o=s(452),n=s(166),a=s(230),i=s(418),c=s(375),l=s(990),p=s(953),u="workflow-request";function f(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,(t=r,(0,p.useTranslation)(u,t)).t)(e)}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t){return(x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function w(){var e=v(["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "]);return w=function(){return e},e}function g(){var e=v(["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "]);return g=function(){return e},e}function O(){var e=v(["\n & > .ant-space-item:first-child,\n & > .ant-space-item:last-child {\n flex-shrink: 0;\n }\n "]);return O=function(){return e},e}function I(){var e=v(["\n & > .ant-space-item:first-child,\n & > .ant-space-item:last-child {\n flex-shrink: 0;\n }\n "]);return I=function(){return e},e}var T={"application/json":{type:"void",properties:{data:{type:"object","x-decorator":"FormItem","x-decorator-props":{},"x-component":"WorkflowVariableJSON","x-component-props":{changeOnSelect:!0,autoSize:{minRows:10},placeholder:'{{t("Input request data", { ns: "'.concat(u,'" })}}')}}}},"application/x-www-form-urlencoded":{type:"void",properties:{data:{type:"array","x-decorator":"FormItem","x-decorator-props":{},"x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add key-value pairs", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}}}},"multipart/form-data":{type:"void",properties:{data:{type:"array","x-decorator":"FormItem","x-decorator-props":{},"x-component":"ArrayItems",items:{type:"object",properties:{space:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},valueType:{type:"string","x-decorator":"FormItem","x-component":"Select","x-component-props":{allowClear:!1},enum:[{value:"text",label:"Text"},{value:"file",label:"File"}],default:"text"},text:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{useTypedConstant:!0},"x-reactions":[{dependencies:[".valueType"],fulfill:{state:{visible:'{{ $deps[0]==="text" }}'}}}]},file:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{variableOptions:{types:[function(e,t){var r,o=t.collectionManager;return!!e.target&&("attachments"===e.target||(null==(r=o.getCollection(e.target))?void 0:r.template)==="file")}]}},"x-reactions":[{dependencies:[".valueType"],fulfill:{state:{visible:'{{ $deps[0]==="file" }}'}}}]},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add key-value pairs", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}}}},"application/xml":{type:"void",properties:{data:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{placeholder:'<?xml version="1.0" encoding="UTF-8"?>',autoSize:{minRows:10},className:(0,e.css)(w())}}}},"text/plain":{type:"void",properties:{data:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{autoSize:{minRows:10},className:(0,e.css)(g())}}}}};function j(i){var c,l=(0,a.useField)(),p=(0,a.useForm)(),u=p.values,s=p.setValuesIn,f=p.clearFormGraph,y=u.contentType,b=function(e){if(Array.isArray(e))return e}(c=(0,t.useState)(T[y]))||function(e){var t,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(n.push(t.value),2!==n.length);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return n}}(c)||function(e){if(e){if("string"==typeof e)return m(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,2)}}(c)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),x=b[0],v=b[1];return(0,a.useFormEffects)(function(){(0,o.onFieldValueChange)("contentType",function(e){var t,r;f("".concat(l.address,".*")),v((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){d(e,t,r[t])})}return e}({},T[e.value]),r=r={name:(0,n.uid)()},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)),s("data",null)})}),r().createElement(e.SchemaComponent,{basePath:l.address,schema:x,onlyRenderProperties:!0})}var S=function(t){var o;if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");function n(){var t,o,a;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return o=n,a=arguments,o=y(o),d(t=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(o,a||[],y(this).constructor):o.apply(this,a)),"title",'{{t("HTTP request", { ns: "'.concat(u,'" })}}')),d(t,"type","request"),d(t,"group","extended"),d(t,"description",'{{t("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.", { ns: "'.concat(u,'" })}}')),d(t,"icon",r().createElement(c.GlobalOutlined,null)),d(t,"fieldset",{method:{type:"string",required:!0,title:'{{t("HTTP method", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{showSearch:!1,allowClear:!1,className:"auto-width"},enum:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"PUT",value:"PUT"},{label:"PATCH",value:"PATCH"},{label:"DELETE",value:"DELETE"}],default:"POST"},url:{type:"string",required:!0,title:'{{t("URL", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"WorkflowVariableTextArea","x-component-props":{placeholder:"https://www.nocobase.com"}},contentType:{type:"string",title:'{{t("Content-Type", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"Select","x-component-props":{allowClear:!1},enum:[{label:"application/json",value:"application/json"},{label:"application/x-www-form-urlencoded",value:"application/x-www-form-urlencoded"},{label:"multipart/form-data",value:"multipart/form-data"},{label:"application/xml",value:"application/xml"},{label:"text/plain",value:"text/plain"}],default:"application/json"},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:'{{t("Headers", { ns: "'.concat(u,'" })}}'),description:'{{t(\'"Content-Type" will be ignored from headers.\', { ns: "'.concat(u,'" })}}'),items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:(0,e.css)(O())},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{useTypedConstant:!0,placeholder:'{{t("Value")}}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add request header", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:'{{t("Parameters", { ns: "'.concat(u,'" })}}'),items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:(0,e.css)(I())},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableTextArea","x-component-props":{useTypedConstant:!0,placeholder:'{{t("Value")}}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:'{{t("Add parameter", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}},data:{type:"void",title:'{{t("Body", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"BodyComponent"},timeout:{type:"number",title:'{{t("Timeout config", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:'{{t("ms", { ns: "'.concat(u,'" })}}'),min:1,step:1e3,defaultValue:5e3}},onlyData:{type:"boolean","x-content":'{{t("Only return response data", { ns: "'.concat(u,'" })}}'),description:'{{t("If enabled, only the response data will be saved into result, and the status code and headers will be ignored.", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox",default:!0},ignoreFail:{type:"boolean","x-content":'{{t("Ignore failed request and continue workflow", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox"}}),d(t,"components",{ArrayItems:i.ArrayItems,BodyComponent:j,WorkflowVariableJSON:l.WorkflowVariableJSON,WorkflowVariableTextArea:l.WorkflowVariableTextArea,WorkflowVariableRawTextArea:l.WorkflowVariableRawTextArea,WorkflowVariableInput:l.WorkflowVariableInput}),d(t,"testable",!0),t}return n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),t&&x(n,t),o=[{key:"useVariables",value:function(e,t){var r,o,n,a,i=e.key,c=e.title,p=e.config;t.types;var u=f("Status code"),s=f("Data"),m=f("Response headers");return d(a={},l.defaultFieldNames.value,i),d(a,l.defaultFieldNames.label,c),d(a,l.defaultFieldNames.children,p.onlyData?null:[(d(r={},l.defaultFieldNames.value,"status"),d(r,l.defaultFieldNames.label,u),r),(d(o={},l.defaultFieldNames.value,"data"),d(o,l.defaultFieldNames.label,s),o),(d(n={},l.defaultFieldNames.value,"headers"),d(n,l.defaultFieldNames.label,m),n)]),a}}],function(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(n.prototype,o),n}(l.Instruction);function k(e,t,r,o,n,a,i){try{var c=e[a](i),l=c.value}catch(e){r(e);return}c.done?t(l):Promise.resolve(l).then(o,n)}function A(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){var a=e.apply(t,r);function i(e){k(a,o,n,i,c,"next",e)}function c(e){k(a,o,n,i,c,"throw",e)}i(void 0)})}}function F(e,t,r){return(F=C()?Reflect.construct:function(e,t,r){var o=[null];o.push.apply(o,t);var n=new(Function.bind.apply(e,o));return r&&_(n,r.prototype),n}).apply(null,arguments)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function q(e){var t="function"==typeof Map?new Map:void 0;return(q=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return F(e,arguments,P(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_(r,e)})(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}function E(e,t){var r,o,n,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:l(0)}),c(i,"throw",{value:l(1)}),c(i,"return",{value:l(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function l(c){return function(l){var p=[c,l];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,p[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&p[0]?o.return:p[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,p[1])).done)return n;switch(o=0,n&&(p=[2&p[0],n.value]),p[0]){case 0:case 1:n=p;break;case 4:return a.label++,{value:p[1],done:!1};case 5:a.label++,o=p[1],p=[0];continue;case 7:p=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===p[0]||2===p[0])){a=0;continue}if(3===p[0]&&(!n||p[1]>n[0]&&p[1]<n[3])){a.label=p[1];break}if(6===p[0]&&a.label<n[1]){a.label=n[1],n=p;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(p);break}n[2]&&a.ops.pop(),a.trys.pop();continue}p=t.call(e,a)}catch(e){p=[6,e],o=0}finally{r=n=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}}var N=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=P(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(e,t||[],P(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&_(r,e),t=[{key:"afterAdd",value:function(){return A(function(){return E(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return A(function(){return E(this,function(e){return[2]})})()}},{key:"load",value:function(){return A(function(){return E(this,function(e){return this.app.pm.get("workflow").registerInstruction("request",S),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}(r.prototype,t),r}(q(e.Plugin))}(),b}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-request",["react","antd","@nocobase/plugin-workflow/client-v2","@nocobase/client","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-request"]=t(require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@nocobase/client"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-request"]=t(e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@nocobase/client"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,u){return function(){"use strict";var i,c,a,l={401:function(e,t,n){n.d(t,{LC:function(){return l},OQ:function(){return u},Tm:function(){return r},Un:function(){return f},cS:function(){return a},cf:function(){return o},nd:function(){return s},qg:function(){return c},xh:function(){return i}});var r=["GET","POST","PUT","PATCH","DELETE"].map(function(e){return{label:e,value:e}}),o=["application/json","application/x-www-form-urlencoded","multipart/form-data","application/xml","text/plain"].map(function(e){return{label:e,value:e}}),u="POST",i="application/json",c="text",a=5e3,l=[{label:"Text",value:"text"},{label:"File",value:"file"}],f={"application/json":"json","application/x-www-form-urlencoded":"pairs","multipart/form-data":"multipart","application/xml":"text","text/plain":"text"};function s(e,t){var n,r=t.collectionManager;return!!(null==e?void 0:e.target)&&("attachments"===e.target||(null==r||null==(n=r.getCollection(e.target))?void 0:n.template)==="file")}},488:function(e,t,n){n.d(t,{MZ:function(){return c},kj:function(){return i}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var u="workflow-request";function i(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[u,"client"],nsMode:"fallback"},n))}}function c(e,t){return(0,r.tExpr)(e,o({ns:[u,"client"],nsMode:"fallback"},t))}},1:function(e,t,n){n.d(t,{WN:function(){return u},jg:function(){return i},xh:function(){return o}});var r=n(401);function o(e){return r.Un[null!=e?e:"application/json"]}function u(e){switch(null!=e?e:"application/json"){case"application/json":default:return{};case"application/x-www-form-urlencoded":case"multipart/form-data":return[];case"application/xml":case"text/plain":return""}}function i(e,t){return e?null:[{value:"status",label:t("Status code")},{value:"data",label:t("Data")},{value:"headers",label:t("Response headers")}]}},375:function(e){e.exports=o},342:function(e){e.exports=r},694:function(e){e.exports=u},197:function(e){e.exports=n},59:function(e){e.exports=t},155:function(t){t.exports=e}},f={};function s(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return l[e](n,n.exports,s),n.exports}s.m=l,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+".140661137327023c.js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},s.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,u,i=document.getElementsByTagName("script"),c=0;c<i.length;c++){var a=i[c];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-workflow-request:"+n){o=a;break}}o||(u=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-request:"+n),o.src=e),p[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),u&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(b=s.g.location+"");var p,b,d=s.g.document;if(!b&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(b=d.currentScript.src),!b)){var y=d.getElementsByTagName("script");if(y.length)for(var v=y.length-1;v>-1&&(!b||!/^http(s?):/.test(b));)b=y[v--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");s.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),u=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",u.name="ChunkLoadError",u.type=r,u.request=o,n[1](u)}},"chunk-"+e,e)}},c=function(e,t){var n,r,o=t[0],u=t[1],c=t[2],a=0;if(o.some(function(e){return 0!==i[e]})){for(n in u)s.o(u,n)&&(s.m[n]=u[n]);c&&c(s)}for(e&&e(t);a<o.length;a++)r=o[a],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(a=self.webpackChunk_nocobase_plugin_workflow_request=self.webpackChunk_nocobase_plugin_workflow_request||[]).forEach(c.bind(null,0)),a.push=c.bind(null,a.push.bind(a));var h={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-request/dist/client/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-request/dist/client/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",u="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",c=i.indexOf(u);e=c>=0?i.slice(0,c+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-request/dist/client/"}s.p=e}(),!function(){s.r(h),s.d(h,{default:function(){return k}});var e=s(342),t=s(155),n=s.n(t),r=s(375),o=s(197),u=s(488),i=s(1);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(d=function(){return!!e})()}var y=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return e=t,n=arguments,e=p(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,d()?Reflect.construct(e,n||[],p(this).constructor):e.apply(this,n))}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&b(t,e),t}(function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t,i;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,i=arguments,t=a(t),c(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(t,i||[],a(this).constructor):t.apply(this,i)),"type","request"),c(e,"title",(0,u.MZ)("HTTP request")),c(e,"group","extended"),c(e,"description",(0,u.MZ)("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.")),c(e,"icon",n().createElement(r.GlobalOutlined,null)),c(e,"testable",!0),c(e,"FieldsetLoader",function(){return s.e("305").then(s.bind(s,160)).then(function(e){return{default:e.RequestFieldset}})}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&l(o,e),t=[{key:"useVariables",value:function(e){var t=e.key,n=e.title,r=e.config,o=(0,u.kj)();return{value:t,label:n,children:(0,i.jg)(null==r?void 0:r.onlyData,o)}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,t),o}(o.Instruction));function v(e,t,n,r,o,u,i){try{var c=e[u](i),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function w(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var u=e.apply(t,n);function i(e){v(u,r,o,i,c,"next",e)}function c(e){v(u,r,o,i,c,"throw",e)}i(void 0)})}}function g(e,t,n){return(g=j()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&O(o,n.prototype),o}).apply(null,arguments)}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t="function"==typeof Map?new Map:void 0;return(_=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return g(e,arguments,m(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),O(n,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var n,r,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(i,"next",{value:a(0)}),c(i,"throw",{value:a(1)}),c(i,"return",{value:a(2)}),"function"==typeof Symbol&&c(i,Symbol.iterator,{value:function(){return this}}),i;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return u.label++,{value:l[1],done:!1};case 5:u.label++,r=l[1],l=[0];continue;case 7:l=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){u=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){u.label=l[1];break}if(6===l[0]&&u.label<o[1]){u.label=o[1],o=l;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(l);break}o[2]&&u.ops.pop(),u.trys.pop();continue}l=t.call(e,u)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var k=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=m(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,j()?Reflect.construct(e,t||[],m(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&O(n,e),t=[{key:"afterAdd",value:function(){return w(function(){return x(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return w(function(){return x(this,function(e){return[2]})})()}},{key:"load",value:function(){return w(function(){return x(this,function(e){return this.app.pm.get("workflow").registerInstruction("request",y),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(_(e.Plugin))}(),h}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_workflow_request_client_v2=self.webpackChunk_nocobase_plugin_workflow_request_client_v2||[]).push([["305"],{160:function(e,t,n){n.d(t,{RequestFieldset:function(){return b}});var r=n(440),a=n(155),l=n.n(a),o=n(375),i=n(197),c=n(401),m=n(488),u=n(1);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t=e.name,n=e.label,a=e.addLabel,c=e.addButtonFullWidth,u=void 0!==c&&c,s=e.extra,d=e.valueName,f=void 0===d?"value":d,p=e.renderValueInput,y=(0,m.kj)();return l().createElement(r.Form.Item,{label:n,extra:s},l().createElement(r.Form.List,{name:t},function(e,t){var n=t.add,c=t.remove;return l().createElement(r.Space,{direction:"vertical",style:{display:"flex"}},e.map(function(e){var t;return l().createElement(r.Flex,{key:e.key,align:"flex-start",gap:"small",style:{width:"100%"}},l().createElement(r.Form.Item,{name:[e.name,"name"],style:{flex:1,marginBottom:0}},l().createElement(r.Input,{placeholder:y("Name")})),l().createElement(r.Form.Item,{name:[e.name,f],style:{flex:1,marginBottom:0}},null!=(t=null==p?void 0:p(e))?t:l().createElement(i.WorkflowVariableInput,{placeholder:y("Value")})),l().createElement(r.Form.Item,{style:{marginBottom:0}},l().createElement(r.Button,{"aria-label":y("Delete"),icon:l().createElement(o.DeleteOutlined,null),onClick:function(){return c(e.name)}})))}),l().createElement(r.Button,{icon:l().createElement(o.PlusOutlined,null),onClick:function(){return n()},style:u?{width:"100%"}:{alignSelf:"flex-start"}},a))}))}function f(e){var t,n=e.field,u=e.listName,d=e.onRemove,f=(0,m.kj)(),p=r.Form.useFormInstance(),y=null!=(t=r.Form.useWatch(((function(e){if(Array.isArray(e))return s(e)})(u)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||function(e){if(e){if("string"==typeof e)return s(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,void 0)}}(u)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([n.name,"valueType"]),p))?t:c.qg,b=(0,a.useMemo)(function(){return"file"===y?l().createElement(i.WorkflowVariableInput,{variableOptions:{types:[c.nd]}}):l().createElement(i.WorkflowVariableInput,{placeholder:f("Value")})},[f,y]),g="file"===y?"file":"text";return l().createElement(r.Flex,{align:"flex-start",gap:"small",style:{width:"100%"}},l().createElement(r.Form.Item,{name:[n.name,"name"],style:{flex:1,marginBottom:0}},l().createElement(r.Input,{placeholder:f("Name")})),l().createElement(r.Form.Item,{name:[n.name,"valueType"],initialValue:c.qg,style:{marginBottom:0}},l().createElement(r.Select,{allowClear:!1,options:c.LC.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={label:f(e.label)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})})),l().createElement(r.Form.Item,{key:"".concat(n.key,"-").concat(g),name:[n.name,g],style:{flex:1,marginBottom:0}},b),l().createElement(r.Form.Item,{style:{marginBottom:0}},l().createElement(r.Button,{"aria-label":f("Delete"),icon:l().createElement(o.DeleteOutlined,null),onClick:function(){return d(n.name)}})))}function p(e){var t=e.name,n=e.label,a=(0,m.kj)(),i=Array.isArray(t)?t:[t];return l().createElement(r.Form.Item,{label:n},l().createElement(r.Form.List,{name:t},function(e,t){var n=t.add,m=t.remove;return l().createElement(r.Space,{direction:"vertical",style:{display:"flex"}},e.map(function(e){return l().createElement(f,{key:e.key,field:e,listName:i,onRemove:m})}),l().createElement(r.Button,{icon:l().createElement(o.PlusOutlined,null),onClick:function(){return n({valueType:c.qg})},style:{width:"100%"}},a("Add key-value pairs")))}))}function y(){var e,t,n=(0,m.kj)(),a=r.Form.useFormInstance(),o=r.Form.useWatch(["config","contentType"],a),s=null!=(e=null!=(t=a.getFieldValue(["config","contentType"]))?t:o)?e:c.xh,f=(0,u.xh)(s);return"json"===f?l().createElement(r.Form.Item,{name:["config","data"],label:n("Body"),initialValue:(0,u.WN)(s)},l().createElement(i.WorkflowVariableJsonTextArea,{autoSize:{minRows:10},placeholder:n("Input request data")})):"pairs"===f?l().createElement(d,{name:["config","data"],label:n("Body"),addLabel:n("Add key-value pairs"),renderValueInput:function(){return l().createElement(i.WorkflowVariableInput,{placeholder:n("Value")})}}):"multipart"===f?l().createElement(p,{name:["config","data"],label:n("Body")}):l().createElement(r.Form.Item,{name:["config","data"],label:n("Body"),initialValue:(0,u.WN)(s)},l().createElement(i.WorkflowVariableTextArea,{autoSize:{minRows:10},placeholder:"application/xml"===s?'<?xml version="1.0" encoding="UTF-8"?>':void 0}))}function b(){var e,t,n,o,s=(0,m.kj)();return e=r.Form.useFormInstance(),t=r.Form.useWatch(["config","contentType"],e),n=(0,a.useRef)(),o=(0,a.useRef)(!1),(0,a.useEffect)(function(){var r,a,l=null!=(r=null!=(a=e.getFieldValue(["config","contentType"]))?a:t)?r:c.xh,i=e.getFieldValue(["config","data"]);if(!o.current){o.current=!0,n.current=l,void 0===i&&e.setFieldValue(["config","data"],(0,u.WN)(l));return}n.current!==l&&e.setFieldValue(["config","data"],(0,u.WN)(l)),n.current=l},[t,e]),l().createElement(l().Fragment,null,l().createElement(r.Form.Item,{name:["config","method"],label:s("HTTP method"),rules:[{required:!0}],initialValue:c.OQ},l().createElement(r.Select,{showSearch:!1,allowClear:!1,options:c.Tm,className:"auto-width"})),l().createElement(r.Form.Item,{name:["config","url"],label:s("URL"),rules:[{required:!0}]},l().createElement(i.WorkflowVariableInput,{placeholder:"https://www.nocobase.com"})),l().createElement(r.Form.Item,{name:["config","contentType"],label:s("Content-Type"),initialValue:c.xh},l().createElement(r.Select,{allowClear:!1,options:c.cf})),l().createElement(d,{name:["config","headers"],label:s("Headers"),addLabel:s("Add request header"),addButtonFullWidth:!0,extra:s('"Content-Type" will be ignored from headers.')}),l().createElement(d,{name:["config","params"],label:s("Parameters"),addLabel:s("Add parameter"),addButtonFullWidth:!0}),l().createElement(y,null),l().createElement(r.Form.Item,{name:["config","timeout"],label:s("Timeout config"),initialValue:c.cS},l().createElement(r.InputNumber,{addonAfter:s("ms"),min:1,step:1e3,style:{width:"100%"}})),l().createElement(r.Form.Item,{name:["config","onlyData"],label:s("Only return response data"),valuePropName:"checked",extra:s("If enabled, only the response data will be saved into result, and the status code and headers will be ignored."),initialValue:!0},l().createElement(r.Checkbox,null)),l().createElement(r.Form.Item,{name:["config","ignoreFail"],label:s("Ignore failed request and continue workflow"),valuePropName:"checked"},l().createElement(r.Checkbox,null)))}}}]);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Instruction } from '@nocobase/plugin-workflow/client-v2';
|
|
11
|
+
export default class RequestInstruction extends Instruction {
|
|
12
|
+
type: string;
|
|
13
|
+
title: string;
|
|
14
|
+
group: string;
|
|
15
|
+
description: string;
|
|
16
|
+
icon: React.JSX.Element;
|
|
17
|
+
testable: boolean;
|
|
18
|
+
FieldsetLoader: () => Promise<{
|
|
19
|
+
default: typeof import("./components/RequestFieldset").RequestFieldset;
|
|
20
|
+
}>;
|
|
21
|
+
useVariables({ key, title, config }: {
|
|
22
|
+
key: string;
|
|
23
|
+
title: string;
|
|
24
|
+
config?: {
|
|
25
|
+
onlyData?: boolean;
|
|
26
|
+
};
|
|
27
|
+
}): {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
children: {
|
|
31
|
+
value: string;
|
|
32
|
+
label: string;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
export declare function RequestFieldset(): React.JSX.Element;
|
|
11
|
+
export default RequestFieldset;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { RequestBodyEditorKind, RequestContentType, RequestMethod } from './types';
|
|
10
|
+
export declare const REQUEST_METHODS: RequestMethod[];
|
|
11
|
+
export declare const REQUEST_METHOD_OPTIONS: {
|
|
12
|
+
label: RequestMethod;
|
|
13
|
+
value: RequestMethod;
|
|
14
|
+
}[];
|
|
15
|
+
export declare const REQUEST_CONTENT_TYPES: RequestContentType[];
|
|
16
|
+
export declare const REQUEST_CONTENT_TYPE_OPTIONS: {
|
|
17
|
+
label: RequestContentType;
|
|
18
|
+
value: RequestContentType;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const DEFAULT_REQUEST_METHOD: RequestMethod;
|
|
21
|
+
export declare const DEFAULT_REQUEST_CONTENT_TYPE: RequestContentType;
|
|
22
|
+
export declare const DEFAULT_MULTIPART_VALUE_TYPE = "text";
|
|
23
|
+
export declare const DEFAULT_TIMEOUT = 5000;
|
|
24
|
+
export declare const MULTIPART_VALUE_TYPE_OPTIONS: readonly [{
|
|
25
|
+
readonly label: "Text";
|
|
26
|
+
readonly value: "text";
|
|
27
|
+
}, {
|
|
28
|
+
readonly label: "File";
|
|
29
|
+
readonly value: "file";
|
|
30
|
+
}];
|
|
31
|
+
export declare const REQUEST_BODY_EDITOR_KIND: Record<RequestContentType, RequestBodyEditorKind>;
|
|
32
|
+
type RequestFileMatchField = {
|
|
33
|
+
target?: string;
|
|
34
|
+
};
|
|
35
|
+
type RequestFileMatchOptions = {
|
|
36
|
+
collectionManager?: {
|
|
37
|
+
getCollection?: (collection: string) => {
|
|
38
|
+
template?: string;
|
|
39
|
+
} | undefined;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare function isRequestFileVariableMatch(field: RequestFileMatchField, { collectionManager }: RequestFileMatchOptions): boolean;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './plugin';
|
|
10
|
+
export * from './plugin';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-request/client-v2",["@nocobase/client-v2","react","antd","@nocobase/plugin-workflow/client-v2","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-request/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/plugin-workflow/client-v2"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-workflow-request/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/plugin-workflow/client-v2"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i){return function(){"use strict";var u,a,c,l={401:function(e,t,n){n.d(t,{LC:function(){return l},OQ:function(){return i},Tm:function(){return r},Un:function(){return f},cS:function(){return c},cf:function(){return o},nd:function(){return s},qg:function(){return a},xh:function(){return u}});var r=["GET","POST","PUT","PATCH","DELETE"].map(function(e){return{label:e,value:e}}),o=["application/json","application/x-www-form-urlencoded","multipart/form-data","application/xml","text/plain"].map(function(e){return{label:e,value:e}}),i="POST",u="application/json",a="text",c=5e3,l=[{label:"Text",value:"text"},{label:"File",value:"file"}],f={"application/json":"json","application/x-www-form-urlencoded":"pairs","multipart/form-data":"multipart","application/xml":"text","text/plain":"text"};function s(e,t){var n,r=t.collectionManager;return!!(null==e?void 0:e.target)&&("attachments"===e.target||(null==r||null==(n=r.getCollection(e.target))?void 0:n.template)==="file")}},488:function(e,t,n){n.d(t,{MZ:function(){return a},kj:function(){return u}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var i="workflow-request";function u(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"client"],nsMode:"fallback"},n))}}function a(e,t){return(0,r.tExpr)(e,o({ns:[i,"client"],nsMode:"fallback"},t))}},1:function(e,t,n){n.d(t,{WN:function(){return i},jg:function(){return u},xh:function(){return o}});var r=n(401);function o(e){return r.Un[null!=e?e:"application/json"]}function i(e){switch(null!=e?e:"application/json"){case"application/json":default:return{};case"application/x-www-form-urlencoded":case"multipart/form-data":return[];case"application/xml":case"text/plain":return""}}function u(e,t){return e?null:[{value:"status",label:t("Status code")},{value:"data",label:t("Data")},{value:"headers",label:t("Response headers")}]}},375:function(e){e.exports=o},485:function(t){t.exports=e},694:function(e){e.exports=i},197:function(e){e.exports=r},440:function(e){e.exports=n},155:function(e){e.exports=t}},f={};function s(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return l[e](n,n.exports,s),n.exports}s.m=l,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+".4d97590a17776080.js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p={},s.l=function(e,t,n,r){if(p[e])return void p[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-workflow-request/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-workflow-request/client-v2:"+n),o.src=e),p[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=p[e];if(delete p[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},f=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(b=s.g.location+"");var p,b,d=s.g.document;if(!b&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(b=d.currentScript.src),!b)){var v=d.getElementsByTagName("script");if(v.length)for(var y=v.length-1;y>-1&&(!b||!/^http(s?):/.test(b));)b=v[y--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");s.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),u={889:0},s.f.j=function(e,t){var n=s.o(u,e)?u[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=u[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),i=Error();s.l(o,function(t){if(s.o(u,e)&&(0!==(n=u[e])&&(u[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],c=0;if(o.some(function(e){return 0!==u[e]})){for(n in i)s.o(i,n)&&(s.m[n]=i[n]);a&&a(s)}for(e&&e(t);c<o.length;c++)r=o[c],s.o(u,r)&&u[r]&&u[r][0](),u[r]=0},(c=self.webpackChunk_nocobase_plugin_workflow_request_client_v2=self.webpackChunk_nocobase_plugin_workflow_request_client_v2||[]).forEach(a.bind(null,0)),c.push=a.bind(null,c.push.bind(c));var h={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-workflow-request/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-request/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var u=window.location.pathname||"/",a=u.indexOf(i);e=a>=0?u.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-request/dist/client-v2/"}s.p=e}(),!function(){s.r(h),s.d(h,{default:function(){return m}});var e=s(485),t=s(155),n=s.n(t),r=s(375),o=s(197),i=s(488),u=s(1);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var p=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function o(){var e,t,u;if(!(this instanceof o))throw TypeError("Cannot call a class as a function");return t=o,u=arguments,t=c(t),a(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(t,u||[],c(this).constructor):t.apply(this,u)),"type","request"),a(e,"title",(0,i.MZ)("HTTP request")),a(e,"group","extended"),a(e,"description",(0,i.MZ)("Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.")),a(e,"icon",n().createElement(r.GlobalOutlined,null)),a(e,"testable",!0),a(e,"FieldsetLoader",function(){return s.e("305").then(s.bind(s,160)).then(function(e){return{default:e.RequestFieldset}})}),e}return o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&l(o,e),t=[{key:"useVariables",value:function(e){var t=e.key,n=e.title,r=e.config,o=(0,i.kj)();return{value:t,label:n,children:(0,u.jg)(null==r?void 0:r.onlyData,o)}}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,t),o}(o.Instruction);function b(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function d(e,t,n){return(d=g()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&y(o,n.prototype),o}).apply(null,arguments)}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),y(n,e)})(e)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}var m=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return e=n,t=arguments,e=v(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,g()?Reflect.construct(e,t||[],v(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&y(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var l=[a,c];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(n){return null==(t=this.app.pm.get("workflow"))||null==(e=t.registerInstruction)||e.call(t,"request",p),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function u(e){b(i,r,o,u,a,"next",e)}function a(e){b(i,r,o,u,a,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(w(e.Plugin))}(),h}()});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare const NAMESPACE = "workflow-request";
|
|
10
|
+
export declare function useT(): (key: string, options?: Record<string, any>) => string;
|
|
11
|
+
export declare function tExpr(key: string, options?: Record<string, any>): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { Application, Plugin } from '@nocobase/client-v2';
|
|
10
|
+
export default class PluginWorkflowRequestClientV2 extends Plugin<any, Application> {
|
|
11
|
+
load(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export type RequestMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
10
|
+
export type RequestContentType = 'application/json' | 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'application/xml' | 'text/plain';
|
|
11
|
+
export type RequestBodyEditorKind = 'json' | 'pairs' | 'multipart' | 'text';
|
|
12
|
+
export type RequestHeaderPair = {
|
|
13
|
+
name?: string;
|
|
14
|
+
value?: string;
|
|
15
|
+
};
|
|
16
|
+
export type RequestMultipartTextValue = {
|
|
17
|
+
valueType: 'text';
|
|
18
|
+
name?: string;
|
|
19
|
+
text?: string;
|
|
20
|
+
};
|
|
21
|
+
export type RequestMultipartFileValue = {
|
|
22
|
+
valueType: 'file';
|
|
23
|
+
name?: string;
|
|
24
|
+
file?: string;
|
|
25
|
+
};
|
|
26
|
+
export type RequestMultipartValue = RequestMultipartTextValue | RequestMultipartFileValue;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { RequestContentType } from './types';
|
|
10
|
+
export declare function getRequestBodyEditorKind(contentType?: RequestContentType): import("./types").RequestBodyEditorKind;
|
|
11
|
+
export declare function getDefaultRequestBodyValue(contentType?: RequestContentType): {};
|
|
12
|
+
export declare function buildResponseVariableChildren(onlyData: boolean | undefined, t: (key: string) => string): {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,18 +8,17 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
+
"@nocobase/client": "2.2.0-alpha.2",
|
|
12
|
+
"@nocobase/plugin-workflow": "2.2.0-alpha.2",
|
|
11
13
|
"react": "18.2.0",
|
|
12
|
-
"@formily/core": "2.3.7",
|
|
13
|
-
"@formily/shared": "2.3.7",
|
|
14
|
-
"@formily/react": "2.3.7",
|
|
15
|
-
"@formily/antd-v5": "1.2.3",
|
|
16
14
|
"@ant-design/icons": "5.6.1",
|
|
17
|
-
"@nocobase/
|
|
18
|
-
"@nocobase/
|
|
15
|
+
"@nocobase/flow-engine": "2.2.0-alpha.2",
|
|
16
|
+
"@nocobase/client-v2": "2.2.0-alpha.2",
|
|
19
17
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/server": "2.2.0-alpha.
|
|
18
|
+
"@nocobase/server": "2.2.0-alpha.2",
|
|
21
19
|
"axios": "1.7.7",
|
|
22
20
|
"lodash": "4.18.1",
|
|
23
|
-
"@nocobase/plugin-file-manager": "2.2.0-alpha.
|
|
24
|
-
"@nocobase/utils": "2.2.0-alpha.
|
|
21
|
+
"@nocobase/plugin-file-manager": "2.2.0-alpha.2",
|
|
22
|
+
"@nocobase/utils": "2.2.0-alpha.2",
|
|
23
|
+
"antd": "5.24.2"
|
|
25
24
|
};
|
package/dist/locale/de-DE.json
CHANGED
package/dist/locale/es-ES.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
15
15
|
"Input request data": "Datos de solicitud de entrada",
|
|
16
16
|
"Insert": "Insertar",
|
|
17
|
-
"Milliseconds": "
|
|
17
|
+
"Milliseconds": "Milisegundos",
|
|
18
18
|
"Only support standard JSON data": "Sólo admite datos JSON estándar",
|
|
19
19
|
"Parameters": "Parámetros",
|
|
20
20
|
"Response headers": "Response headers",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"Timeout config": "Tiempo de espera config",
|
|
25
25
|
"URL": "URL",
|
|
26
26
|
"Use variable": "Utilizar variable",
|
|
27
|
-
"ms": "
|
|
28
|
-
}
|
|
27
|
+
"ms": "Milisegundos"
|
|
28
|
+
}
|
package/dist/locale/fr-FR.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
15
15
|
"Input request data": "Entrée des données de requête",
|
|
16
16
|
"Insert": "Insérer",
|
|
17
|
-
"Milliseconds": "
|
|
17
|
+
"Milliseconds": "Millisecondes",
|
|
18
18
|
"Only support standard JSON data": "Prend uniquement en charge les données JSON standard",
|
|
19
19
|
"Parameters": "Paramètres",
|
|
20
20
|
"Response headers": "Response headers",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"Timeout config": "Configuration du délai d'expiration",
|
|
25
25
|
"URL": "URL",
|
|
26
26
|
"Use variable": "Utiliser une variable",
|
|
27
|
-
"ms": "
|
|
28
|
-
}
|
|
27
|
+
"ms": "Millisecondes"
|
|
28
|
+
}
|
package/dist/locale/hu-HU.json
CHANGED
package/dist/locale/id-ID.json
CHANGED
package/dist/locale/it-IT.json
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"Ignore failed request and continue workflow": "Ignora la richiesta fallita e continua il workflow",
|
|
14
14
|
"Input request data": "Inserisci dati richiesta",
|
|
15
15
|
"Insert": "Inserisci",
|
|
16
|
-
"Milliseconds": "
|
|
16
|
+
"Milliseconds": "Millisecondi",
|
|
17
17
|
"Only support standard JSON data": "Supporta solo dati JSON standard",
|
|
18
18
|
"Parameters": "Parametri",
|
|
19
19
|
"Response headers": "Intestazioni risposta",
|
|
20
20
|
"Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.": "Invia una richiesta HTTP a un URL. Puoi usare le variabili nei nodi upstream come intestazioni, parametri e corpo della richiesta.",
|
|
21
21
|
"Status code": "Codice stato",
|
|
22
22
|
"Timeout": "Timeout",
|
|
23
|
-
"Timeout config": "
|
|
23
|
+
"Timeout config": "Configurazione timeout",
|
|
24
24
|
"URL": "URL",
|
|
25
25
|
"Use variable": "Usa variabile",
|
|
26
|
-
"ms": "
|
|
27
|
-
}
|
|
26
|
+
"ms": "Millisecondi"
|
|
27
|
+
}
|
package/dist/locale/nl-NL.json
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
14
14
|
"Input request data": "Input request data",
|
|
15
15
|
"Insert": "Invoegen",
|
|
16
|
-
"Milliseconds": "
|
|
16
|
+
"Milliseconds": "Milliseconden",
|
|
17
17
|
"Only support standard JSON data": "Only support standard JSON data",
|
|
18
18
|
"Parameters": "Parameters",
|
|
19
19
|
"Response headers": "Response headers",
|
|
20
20
|
"Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.": "Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.",
|
|
21
21
|
"Status code": "Status code",
|
|
22
22
|
"Timeout": "Timeout",
|
|
23
|
-
"Timeout config": "
|
|
23
|
+
"Timeout config": "Time-outconfiguratie",
|
|
24
24
|
"URL": "URL",
|
|
25
25
|
"Use variable": "Use variable",
|
|
26
|
-
"ms": "
|
|
27
|
-
}
|
|
26
|
+
"ms": "Milliseconden"
|
|
27
|
+
}
|
package/dist/locale/pt-BR.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
15
15
|
"Input request data": "Dados de entrada da requisição",
|
|
16
16
|
"Insert": "Inserir",
|
|
17
|
-
"Milliseconds": "
|
|
17
|
+
"Milliseconds": "Milissegundos",
|
|
18
18
|
"Only support standard JSON data": "Suporta somente dados JSON padrão",
|
|
19
19
|
"Parameters": "Parâmetros",
|
|
20
20
|
"Response headers": "Response headers",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"Timeout config": "Configuração de tempo limite",
|
|
25
25
|
"URL": "URL",
|
|
26
26
|
"Use variable": "Usar variável",
|
|
27
|
-
"ms": "
|
|
28
|
-
}
|
|
27
|
+
"ms": "Milissegundos"
|
|
28
|
+
}
|
package/dist/locale/tr-TR.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
14
14
|
"Input request data": "Input request data",
|
|
15
15
|
"Insert": "Insert",
|
|
16
|
-
"Milliseconds": "
|
|
16
|
+
"Milliseconds": "Milisaniye",
|
|
17
17
|
"Only support standard JSON data": "Only support standard JSON data",
|
|
18
18
|
"Parameters": "Parameters",
|
|
19
19
|
"Response headers": "Response headers",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"Timeout config": "Timeout config",
|
|
24
24
|
"URL": "URL",
|
|
25
25
|
"Use variable": "Use variable",
|
|
26
|
-
"ms": "
|
|
27
|
-
}
|
|
26
|
+
"ms": "Milisaniye"
|
|
27
|
+
}
|
package/dist/locale/uk-UA.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
14
14
|
"Input request data": "Input request data",
|
|
15
15
|
"Insert": "Insert",
|
|
16
|
-
"Milliseconds": "
|
|
16
|
+
"Milliseconds": "Мілісекунди",
|
|
17
17
|
"Only support standard JSON data": "Only support standard JSON data",
|
|
18
18
|
"Parameters": "Parameters",
|
|
19
19
|
"Response headers": "Response headers",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"Timeout config": "Timeout config",
|
|
24
24
|
"URL": "URL",
|
|
25
25
|
"Use variable": "Use variable",
|
|
26
|
-
"ms": "
|
|
27
|
-
}
|
|
26
|
+
"ms": "Мілісекунди"
|
|
27
|
+
}
|
package/dist/locale/vi-VN.json
CHANGED
package/dist/locale/zh-CN.json
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.": "向指定 URL 发送 HTTP 请求。可以使用上游节点里的变量作为请求头、参数和请求体。",
|
|
23
23
|
"Status code": "状态码",
|
|
24
24
|
"Timeout": "超时设置",
|
|
25
|
-
"Timeout config": "
|
|
25
|
+
"Timeout config": "超时配置",
|
|
26
26
|
"URL": "地址",
|
|
27
27
|
"Use variable": "使用变量",
|
|
28
|
-
"ms": "
|
|
28
|
+
"ms": "毫秒"
|
|
29
29
|
}
|
package/dist/locale/zh-TW.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow",
|
|
14
14
|
"Input request data": "Input request data",
|
|
15
15
|
"Insert": "Insert",
|
|
16
|
-
"Milliseconds": "
|
|
16
|
+
"Milliseconds": "毫秒",
|
|
17
17
|
"Only support standard JSON data": "Only support standard JSON data",
|
|
18
18
|
"Parameters": "Parameters",
|
|
19
19
|
"Response headers": "Response headers",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"Timeout config": "Timeout config",
|
|
24
24
|
"URL": "URL",
|
|
25
25
|
"Use variable": "Use variable",
|
|
26
|
-
"ms": "
|
|
27
|
-
}
|
|
26
|
+
"ms": "毫秒"
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-
|
|
1
|
+
{"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-26T03:51:48.961Z"}
|
|
@@ -216,8 +216,7 @@ class RequestInstruction_default extends import_plugin_workflow.Instruction {
|
|
|
216
216
|
});
|
|
217
217
|
async run(node, prevJob, processor, options) {
|
|
218
218
|
const config = processor.getParsedValue(node.config, node.id);
|
|
219
|
-
const
|
|
220
|
-
const sync = this.workflow.isWorkflowSync(workflow);
|
|
219
|
+
const sync = processor.isInstructionSync(node);
|
|
221
220
|
if (sync) {
|
|
222
221
|
try {
|
|
223
222
|
const response = await request(config, this.workflow.app, options == null ? void 0 : options.signal);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Send HTTP requests to any HTTP service for data interaction in workflow.",
|
|
7
7
|
"description.ru-RU": "Отправляет HTTP-запросы к любому HTTP-сервису для взаимодействия с данными в рабочем процессе.",
|
|
8
8
|
"description.zh-CN": "可用于在工作流中向任意 HTTP 服务发送请求,进行数据交互。",
|
|
9
|
-
"version": "2.2.0-alpha.
|
|
9
|
+
"version": "2.2.0-alpha.2",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "./dist/server/index.js",
|
|
12
12
|
"homepage": "https://docs.nocobase.com/handbook/workflow-request",
|
|
@@ -21,13 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@nocobase/client": "2.x",
|
|
24
|
+
"@nocobase/client-v2": "2.x",
|
|
24
25
|
"@nocobase/database": "2.x",
|
|
25
26
|
"@nocobase/plugin-file-manager": "2.x",
|
|
26
27
|
"@nocobase/plugin-workflow": ">=0.17.0-alpha.3",
|
|
27
28
|
"@nocobase/server": "2.x",
|
|
28
29
|
"@nocobase/test": "2.x"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "9dd5224bb8f6c1ac12d766b9f175bdc29bddd845",
|
|
31
32
|
"keywords": [
|
|
32
33
|
"Workflow"
|
|
33
34
|
]
|