@nocobase/plugin-workflow-request 1.2.13-alpha → 1.3.0-alpha.20240710084543
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/package.json +2 -2
- package/dist/client/RequestInstruction.d.ts +0 -219
- package/dist/client/index.d.ts +0 -14
- package/dist/client/index.js +0 -20
- package/dist/externalVersion.js +0 -21
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -20
- package/dist/locale/es-ES.json +0 -19
- package/dist/locale/fr-FR.json +0 -19
- package/dist/locale/index.d.ts +0 -11
- package/dist/locale/index.js +0 -48
- package/dist/locale/ko_KR.json +0 -22
- package/dist/locale/pt-BR.json +0 -19
- package/dist/locale/zh-CN.json +0 -24
- package/dist/server/Plugin.d.ts +0 -12
- package/dist/server/Plugin.js +0 -50
- package/dist/server/RequestInstruction.d.ts +0 -24
- package/dist/server/RequestInstruction.js +0 -175
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/migrations/20240518105632-make-legacy-config-compatible.d.ts +0 -13
- package/dist/server/migrations/20240518105632-make-legacy-config-compatible.js +0 -58
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "工作流:HTTP 请求节点",
|
|
5
5
|
"description": "Send HTTP requests to any HTTP service for data interaction in workflow.",
|
|
6
6
|
"description.zh-CN": "可用于在工作流中向任意 HTTP 服务发送请求,进行数据交互。",
|
|
7
|
-
"version": "1.
|
|
7
|
+
"version": "1.3.0-alpha.20240710084543",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/workflow-request",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@nocobase/server": "1.x",
|
|
23
23
|
"@nocobase/test": "1.x"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "07a8b596fc64a9779a194cb9b0dc2ca7570ed9d4",
|
|
26
26
|
"keywords": [
|
|
27
27
|
"Workflow"
|
|
28
28
|
]
|
|
@@ -1,219 +0,0 @@
|
|
|
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, WorkflowVariableJSON, WorkflowVariableTextArea } from '@nocobase/plugin-workflow/client';
|
|
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
|
-
fieldset: {
|
|
18
|
-
method: {
|
|
19
|
-
type: string;
|
|
20
|
-
required: boolean;
|
|
21
|
-
title: string;
|
|
22
|
-
'x-decorator': string;
|
|
23
|
-
'x-component': string;
|
|
24
|
-
'x-component-props': {
|
|
25
|
-
showSearch: boolean;
|
|
26
|
-
allowClear: boolean;
|
|
27
|
-
className: string;
|
|
28
|
-
};
|
|
29
|
-
enum: {
|
|
30
|
-
label: string;
|
|
31
|
-
value: string;
|
|
32
|
-
}[];
|
|
33
|
-
default: string;
|
|
34
|
-
};
|
|
35
|
-
url: {
|
|
36
|
-
type: string;
|
|
37
|
-
required: boolean;
|
|
38
|
-
title: string;
|
|
39
|
-
'x-decorator': string;
|
|
40
|
-
'x-decorator-props': {};
|
|
41
|
-
'x-component': string;
|
|
42
|
-
'x-component-props': {
|
|
43
|
-
placeholder: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
contentType: {
|
|
47
|
-
type: string;
|
|
48
|
-
title: string;
|
|
49
|
-
'x-decorator': string;
|
|
50
|
-
'x-component': string;
|
|
51
|
-
'x-component-props': {
|
|
52
|
-
allowClear: boolean;
|
|
53
|
-
};
|
|
54
|
-
enum: {
|
|
55
|
-
label: string;
|
|
56
|
-
value: string;
|
|
57
|
-
}[];
|
|
58
|
-
default: string;
|
|
59
|
-
};
|
|
60
|
-
headers: {
|
|
61
|
-
type: string;
|
|
62
|
-
'x-component': string;
|
|
63
|
-
'x-decorator': string;
|
|
64
|
-
title: string;
|
|
65
|
-
description: string;
|
|
66
|
-
items: {
|
|
67
|
-
type: string;
|
|
68
|
-
properties: {
|
|
69
|
-
space: {
|
|
70
|
-
type: string;
|
|
71
|
-
'x-component': string;
|
|
72
|
-
'x-component-props': {
|
|
73
|
-
style: {
|
|
74
|
-
flexWrap: string;
|
|
75
|
-
maxWidth: string;
|
|
76
|
-
};
|
|
77
|
-
className: string;
|
|
78
|
-
};
|
|
79
|
-
properties: {
|
|
80
|
-
name: {
|
|
81
|
-
type: string;
|
|
82
|
-
'x-decorator': string;
|
|
83
|
-
'x-component': string;
|
|
84
|
-
'x-component-props': {
|
|
85
|
-
placeholder: string;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
value: {
|
|
89
|
-
type: string;
|
|
90
|
-
'x-decorator': string;
|
|
91
|
-
'x-component': string;
|
|
92
|
-
'x-component-props': {
|
|
93
|
-
useTypedConstant: boolean;
|
|
94
|
-
placeholder: string;
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
remove: {
|
|
98
|
-
type: string;
|
|
99
|
-
'x-decorator': string;
|
|
100
|
-
'x-component': string;
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
};
|
|
105
|
-
};
|
|
106
|
-
properties: {
|
|
107
|
-
add: {
|
|
108
|
-
type: string;
|
|
109
|
-
title: string;
|
|
110
|
-
'x-component': string;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
params: {
|
|
115
|
-
type: string;
|
|
116
|
-
'x-component': string;
|
|
117
|
-
'x-decorator': string;
|
|
118
|
-
title: string;
|
|
119
|
-
items: {
|
|
120
|
-
type: string;
|
|
121
|
-
properties: {
|
|
122
|
-
space: {
|
|
123
|
-
type: string;
|
|
124
|
-
'x-component': string;
|
|
125
|
-
'x-component-props': {
|
|
126
|
-
style: {
|
|
127
|
-
flexWrap: string;
|
|
128
|
-
maxWidth: string;
|
|
129
|
-
};
|
|
130
|
-
className: string;
|
|
131
|
-
};
|
|
132
|
-
properties: {
|
|
133
|
-
name: {
|
|
134
|
-
type: string;
|
|
135
|
-
'x-decorator': string;
|
|
136
|
-
'x-component': string;
|
|
137
|
-
'x-component-props': {
|
|
138
|
-
placeholder: string;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
value: {
|
|
142
|
-
type: string;
|
|
143
|
-
'x-decorator': string;
|
|
144
|
-
'x-component': string;
|
|
145
|
-
'x-component-props': {
|
|
146
|
-
useTypedConstant: boolean;
|
|
147
|
-
placeholder: string;
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
remove: {
|
|
151
|
-
type: string;
|
|
152
|
-
'x-decorator': string;
|
|
153
|
-
'x-component': string;
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
};
|
|
158
|
-
};
|
|
159
|
-
properties: {
|
|
160
|
-
add: {
|
|
161
|
-
type: string;
|
|
162
|
-
title: string;
|
|
163
|
-
'x-component': string;
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
};
|
|
167
|
-
data: {
|
|
168
|
-
type: string;
|
|
169
|
-
title: string;
|
|
170
|
-
'x-decorator': string;
|
|
171
|
-
'x-decorator-props': {};
|
|
172
|
-
'x-component': string;
|
|
173
|
-
};
|
|
174
|
-
timeout: {
|
|
175
|
-
type: string;
|
|
176
|
-
title: string;
|
|
177
|
-
'x-decorator': string;
|
|
178
|
-
'x-decorator-props': {};
|
|
179
|
-
'x-component': string;
|
|
180
|
-
'x-component-props': {
|
|
181
|
-
addonAfter: string;
|
|
182
|
-
min: number;
|
|
183
|
-
step: number;
|
|
184
|
-
defaultValue: number;
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
ignoreFail: {
|
|
188
|
-
type: string;
|
|
189
|
-
title: string;
|
|
190
|
-
'x-decorator': string;
|
|
191
|
-
'x-component': string;
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
components: {
|
|
195
|
-
ArrayItems: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement>> & import("@formily/antd-v5").ArrayBaseMixins & {
|
|
196
|
-
Item: import("@formily/react").ReactFC<React.HTMLAttributes<HTMLDivElement> & {
|
|
197
|
-
type?: "card" | "divide";
|
|
198
|
-
}>;
|
|
199
|
-
};
|
|
200
|
-
BodyComponent: typeof BodyComponent;
|
|
201
|
-
WorkflowVariableTextArea: typeof WorkflowVariableTextArea;
|
|
202
|
-
WorkflowVariableJSON: typeof WorkflowVariableJSON;
|
|
203
|
-
};
|
|
204
|
-
useVariables({ key, title, config }: {
|
|
205
|
-
key: any;
|
|
206
|
-
title: any;
|
|
207
|
-
config: any;
|
|
208
|
-
}, { types }: {
|
|
209
|
-
types: any;
|
|
210
|
-
}): {
|
|
211
|
-
value: any;
|
|
212
|
-
label: any;
|
|
213
|
-
children: {
|
|
214
|
-
value: string;
|
|
215
|
-
label: string;
|
|
216
|
-
}[];
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
export {};
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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 { Plugin } from '@nocobase/client';
|
|
10
|
-
export default class extends Plugin {
|
|
11
|
-
afterAdd(): Promise<void>;
|
|
12
|
-
beforeLoad(): Promise<void>;
|
|
13
|
-
load(): Promise<void>;
|
|
14
|
-
}
|
package/dist/client/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("react"),require("@formily/core"),require("@formily/shared"),require("@formily/react"),require("@formily/antd-v5"),require("@nocobase/plugin-workflow/client"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","react","@formily/core","@formily/shared","@formily/react","@formily/antd-v5","@nocobase/plugin-workflow/client","react-i18next"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@nocobase/plugin-workflow-request"]={},e["@nocobase/client"],e.jsxRuntime,e.react,e["@formily/core"],e["@formily/shared"],e["@formily/react"],e["@formily/antd-v5"],e["@nocobase/plugin-workflow"],e["react-i18next"]))})(this,function(e,t,o,x,c,y,l,i,r,d){"use strict";var V=Object.defineProperty,j=Object.defineProperties;var $=Object.getOwnPropertyDescriptors;var q=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var T=(e,t,o)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,S=(e,t)=>{for(var o in t||(t={}))W.call(t,o)&&T(e,o,t[o]);if(q)for(var o of q(t))E.call(t,o)&&T(e,o,t[o]);return e},k=(e,t)=>j(e,$(t));var n=(e,t,o)=>(T(e,typeof t!="symbol"?t+"":t,o),o);var u=(e,t,o)=>new Promise((x,c)=>{var y=r=>{try{i(o.next(r))}catch(d){c(d)}},l=r=>{try{i(o.throw(r))}catch(d){c(d)}},i=r=>r.done?x(r.value):Promise.resolve(r.value).then(y,l);i((o=o.apply(e,t)).next())});const a="workflow-request";function f(s,p={}){const{t:m}=N(p);return m(s)}function N(s){return d.useTranslation(a,s)}const F={"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: "${a}" })}}`}}}},"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: "${a}" })}}`,"x-component":"ArrayItems.Addition"}}}}}};function g(s){const p=l.useField(),{values:m,setValuesIn:h,clearFormGraph:w}=l.useForm(),{contentType:A}=m,[v,I]=x.useState(F[A]);return l.useFormEffects(()=>{c.onFieldValueChange("contentType",b=>{w(`${p.address}.*`),I(k(S({},F[b.value]),{name:y.uid()})),h("data",null)})}),o.jsx(t.SchemaComponent,{basePath:p.address,schema:v,onlyRenderProperties:!0})}class P extends r.Instruction{constructor(){super(...arguments);n(this,"title",`{{t("HTTP request", { ns: "${a}" })}}`);n(this,"type","request");n(this,"group","extended");n(this,"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: "${a}" })}}`);n(this,"fieldset",{method:{type:"string",required:!0,title:`{{t("HTTP method", { ns: "${a}" })}}`,"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: "${a}" })}}`,"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: "${a}" })}}`,"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"}],default:"application/json"},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Headers", { ns: "${a}" })}}`,description:`{{t('"Content-Type" will be ignored from headers.', { ns: "${a}" })}}`,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:t.css`
|
|
11
|
-
& > .ant-space-item:first-child,
|
|
12
|
-
& > .ant-space-item:last-child {
|
|
13
|
-
flex-shrink: 0;
|
|
14
|
-
}
|
|
15
|
-
`},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: "${a}" })}}`,"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Parameters", { ns: "${a}" })}}`,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:t.css`
|
|
16
|
-
& > .ant-space-item:first-child,
|
|
17
|
-
& > .ant-space-item:last-child {
|
|
18
|
-
flex-shrink: 0;
|
|
19
|
-
}
|
|
20
|
-
`},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: "${a}" })}}`,"x-component":"ArrayItems.Addition"}}},data:{type:"void",title:`{{t("Body", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"BodyComponent"},timeout:{type:"number",title:`{{t("Timeout config", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:`{{t("ms", { ns: "${a}" })}}`,min:1,step:1e3,defaultValue:5e3}},ignoreFail:{type:"boolean",title:`{{t("Ignore failed request and continue workflow", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox"}});n(this,"components",{ArrayItems:i.ArrayItems,BodyComponent:g,WorkflowVariableTextArea:r.WorkflowVariableTextArea,WorkflowVariableJSON:r.WorkflowVariableJSON})}useVariables({key:m,title:h,config:w},{types:A}){const v=f("Status code"),I=f("Data"),b=f("Response headers");return{[r.defaultFieldNames.value]:m,[r.defaultFieldNames.label]:h,[r.defaultFieldNames.children]:w.onlyData?null:[{[r.defaultFieldNames.value]:"status",[r.defaultFieldNames.label]:v},{[r.defaultFieldNames.value]:"data",[r.defaultFieldNames.label]:I},{[r.defaultFieldNames.value]:"headers",[r.defaultFieldNames.label]:b}]}}}class C extends t.Plugin{afterAdd(){return u(this,null,function*(){})}beforeLoad(){return u(this,null,function*(){})}load(){return u(this,null,function*(){this.app.pm.get("workflow").registerInstruction("request",P)})}}e.default=C,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
module.exports = {
|
|
11
|
-
"react": "18.2.0",
|
|
12
|
-
"@formily/core": "2.3.0",
|
|
13
|
-
"@formily/shared": "2.3.0",
|
|
14
|
-
"@formily/react": "2.3.0",
|
|
15
|
-
"@formily/antd-v5": "1.1.9",
|
|
16
|
-
"@nocobase/plugin-workflow": "1.2.13-alpha",
|
|
17
|
-
"@nocobase/client": "1.2.13-alpha",
|
|
18
|
-
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/server": "1.2.13-alpha",
|
|
20
|
-
"axios": "0.26.1"
|
|
21
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
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 * from './server';
|
|
10
|
-
export { default } from './server';
|
package/dist/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var src_exports = {};
|
|
39
|
-
__export(src_exports, {
|
|
40
|
-
default: () => import_server.default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(src_exports);
|
|
43
|
-
__reExport(src_exports, require("./server"), module.exports);
|
|
44
|
-
var import_server = __toESM(require("./server"));
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
...require("./server")
|
|
48
|
-
});
|
package/dist/locale/en-US.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "HTTP request",
|
|
3
|
-
"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.",
|
|
4
|
-
"HTTP method": "HTTP method",
|
|
5
|
-
"URL": "URL",
|
|
6
|
-
"Headers": "Headers",
|
|
7
|
-
"Add request header": "Add request header",
|
|
8
|
-
"Parameters": "Parameters",
|
|
9
|
-
"Add parameter": "Add parameter",
|
|
10
|
-
"Body": "Body",
|
|
11
|
-
"Use variable": "Use variable",
|
|
12
|
-
"Format": "Format",
|
|
13
|
-
"Insert": "Insert",
|
|
14
|
-
"Timeout config": "Timeout config",
|
|
15
|
-
"ms": "ms",
|
|
16
|
-
"Input request data": "Input request data",
|
|
17
|
-
"Only support standard JSON data": "Only support standard JSON data",
|
|
18
|
-
"\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" only support \"application/json\", and no need to specify",
|
|
19
|
-
"Ignore failed request and continue workflow": "Ignore failed request and continue workflow"
|
|
20
|
-
}
|
package/dist/locale/es-ES.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "Petición HTTP",
|
|
3
|
-
"HTTP method": "Método HTTP",
|
|
4
|
-
"URL": "URL",
|
|
5
|
-
"Headers": "Encabezados",
|
|
6
|
-
"Add request header": "Añadir encabezado de petición",
|
|
7
|
-
"Parameters": "Parámetros",
|
|
8
|
-
"Add parameter": "Añadir parámetro",
|
|
9
|
-
"Body": "Cuerpo",
|
|
10
|
-
"Use variable": "Utilizar variable",
|
|
11
|
-
"Format": "Formato",
|
|
12
|
-
"Insert": "Insertar",
|
|
13
|
-
"Timeout config": "Tiempo de espera config",
|
|
14
|
-
"ms": "ms",
|
|
15
|
-
"Input request data": "Datos de solicitud de entrada",
|
|
16
|
-
"Only support standard JSON data": "Sólo admite datos JSON estándar",
|
|
17
|
-
"\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" sólo admite \"application/json\", y no es necesario especificar",
|
|
18
|
-
"Ignore fail request and continue workflow": "Ignorar solicitud fallida y continuar flujo de trabajo"
|
|
19
|
-
}
|
package/dist/locale/fr-FR.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "Requête HTTP",
|
|
3
|
-
"HTTP method": "Méthode HTTP",
|
|
4
|
-
"URL": "URL",
|
|
5
|
-
"Headers": "En-têtes",
|
|
6
|
-
"Add request header": "Ajouter un en-tête de requête",
|
|
7
|
-
"Parameters": "Paramètres",
|
|
8
|
-
"Add parameter": "Ajouter un paramètre",
|
|
9
|
-
"Body": "Corps",
|
|
10
|
-
"Use variable": "Utiliser une variable",
|
|
11
|
-
"Format": "Format",
|
|
12
|
-
"Insert": "Insérer",
|
|
13
|
-
"Timeout config": "Configuration du délai d'expiration",
|
|
14
|
-
"ms": "ms",
|
|
15
|
-
"Input request data": "Entrée des données de requête",
|
|
16
|
-
"Only support standard JSON data": "Prend uniquement en charge les données JSON standard",
|
|
17
|
-
"\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" prend uniquement en charge \"application/json\" et n'a pas besoin d'être spécifié",
|
|
18
|
-
"Ignore fail request and continue workflow": "Ignorer l'échec de la requête et continuer le workflow"
|
|
19
|
-
}
|
package/dist/locale/index.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
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 useLang(key: string, options?: {}): string;
|
|
11
|
-
export declare function usePluginTranslation(options: any): import("react-i18next").UseTranslationResponse<"workflow-request", undefined>;
|
package/dist/locale/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var locale_exports = {};
|
|
28
|
-
__export(locale_exports, {
|
|
29
|
-
NAMESPACE: () => NAMESPACE,
|
|
30
|
-
useLang: () => useLang,
|
|
31
|
-
usePluginTranslation: () => usePluginTranslation
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(locale_exports);
|
|
34
|
-
var import_react_i18next = require("react-i18next");
|
|
35
|
-
const NAMESPACE = "workflow-request";
|
|
36
|
-
function useLang(key, options = {}) {
|
|
37
|
-
const { t } = usePluginTranslation(options);
|
|
38
|
-
return t(key);
|
|
39
|
-
}
|
|
40
|
-
function usePluginTranslation(options) {
|
|
41
|
-
return (0, import_react_i18next.useTranslation)(NAMESPACE, options);
|
|
42
|
-
}
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
NAMESPACE,
|
|
46
|
-
useLang,
|
|
47
|
-
usePluginTranslation
|
|
48
|
-
});
|
package/dist/locale/ko_KR.json
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "HTTP 요청",
|
|
3
|
-
"Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.":
|
|
4
|
-
"URL에 HTTP 요청을 보냅니다. 상류 노드의 변수를 요청 헤더, 매개변수 및 요청 본문으로 사용할 수 있습니다.",
|
|
5
|
-
"HTTP method": "HTTP 메서드",
|
|
6
|
-
"URL": "주소",
|
|
7
|
-
"Headers": "헤더",
|
|
8
|
-
"Add request header": "요청 헤더 추가",
|
|
9
|
-
"Parameters": "매개변수",
|
|
10
|
-
"Add parameter": "매개변수 추가",
|
|
11
|
-
"Body": "본문",
|
|
12
|
-
"Use variable": "변수 사용",
|
|
13
|
-
"Format": "형식",
|
|
14
|
-
"Insert": "삽입",
|
|
15
|
-
"Timeout config": "시간 초과 설정",
|
|
16
|
-
"ms": "밀리초",
|
|
17
|
-
"Input request data": "요청 데이터 입력",
|
|
18
|
-
"Only support standard JSON data": "표준 JSON 데이터만 지원합니다",
|
|
19
|
-
"\"Content-Type\" only support \"application/json\", and no need to specify":
|
|
20
|
-
"\"Content-Type\" 헤더는 \"application/json\"만 지원하며 지정할 필요가 없습니다",
|
|
21
|
-
"Ignore failed request and continue workflow": "실패한 요청을 무시하고 워크플로를 계속합니다"
|
|
22
|
-
}
|
package/dist/locale/pt-BR.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "Requisição HTTP",
|
|
3
|
-
"HTTP method": "Método HTTP",
|
|
4
|
-
"URL": "URL",
|
|
5
|
-
"Headers": "Cabeçalhos",
|
|
6
|
-
"Add request header": "Adicionar cabeçalho de requisição",
|
|
7
|
-
"Parameters": "Parâmetros",
|
|
8
|
-
"Add parameter": "Adicionar parâmetro",
|
|
9
|
-
"Body": "Corpo",
|
|
10
|
-
"Use variable": "Usar variável",
|
|
11
|
-
"Format": "Formato",
|
|
12
|
-
"Insert": "Inserir",
|
|
13
|
-
"Timeout config": "Configuração de tempo limite",
|
|
14
|
-
"ms": "ms",
|
|
15
|
-
"Input request data": "Dados de entrada da requisição",
|
|
16
|
-
"Only support standard JSON data": "Suporta somente dados JSON padrão",
|
|
17
|
-
"\"Content-Type\" only support \"application/json\", and no need to specify": "\"Content-Type\" somente suporta \"application/json\" e não precisa ser especificado",
|
|
18
|
-
"Ignore fail request and continue workflow": "Ignorar falhas na requisição e continuar o fluxo de trabalho"
|
|
19
|
-
}
|
package/dist/locale/zh-CN.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"HTTP request": "HTTP 请求",
|
|
3
|
-
"Send HTTP request to a URL. You can use the variables in the upstream nodes as request headers, parameters and request body.": "向指定 URL 发送 HTTP 请求。可以使用上游节点里的变量作为请求头、参数和请求体。",
|
|
4
|
-
"HTTP method": "HTTP 方法",
|
|
5
|
-
"URL": "地址",
|
|
6
|
-
"Headers": "请求头",
|
|
7
|
-
"Add request header": "添加请求头",
|
|
8
|
-
"Parameters": "参数",
|
|
9
|
-
"Add parameter": "添加参数",
|
|
10
|
-
"Body": "请求体",
|
|
11
|
-
"Use variable": "使用变量",
|
|
12
|
-
"Add key-value pairs": "添加键值对",
|
|
13
|
-
"Format": "格式化",
|
|
14
|
-
"Insert": "插入",
|
|
15
|
-
"Timeout config": "超时设置",
|
|
16
|
-
"ms": "毫秒",
|
|
17
|
-
"Input request data": "输入请求数据",
|
|
18
|
-
"Only support standard JSON data": "仅支持标准 JSON 数据",
|
|
19
|
-
"\"Content-Type\" will be ignored from headers.": "请求头中配置的 \"Content-Type\" 将被忽略。",
|
|
20
|
-
"Ignore failed request and continue workflow": "忽略失败的请求并继续工作流",
|
|
21
|
-
"Status code": "状态码",
|
|
22
|
-
"Data": "数据",
|
|
23
|
-
"Response headers": "响应头"
|
|
24
|
-
}
|
package/dist/server/Plugin.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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 { Plugin } from '@nocobase/server';
|
|
10
|
-
export default class extends Plugin {
|
|
11
|
-
load(): Promise<void>;
|
|
12
|
-
}
|
package/dist/server/Plugin.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var Plugin_exports = {};
|
|
38
|
-
__export(Plugin_exports, {
|
|
39
|
-
default: () => Plugin_default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(Plugin_exports);
|
|
42
|
-
var import_server = require("@nocobase/server");
|
|
43
|
-
var import_plugin_workflow = __toESM(require("@nocobase/plugin-workflow"));
|
|
44
|
-
var import_RequestInstruction = __toESM(require("./RequestInstruction"));
|
|
45
|
-
class Plugin_default extends import_server.Plugin {
|
|
46
|
-
async load() {
|
|
47
|
-
const workflowPlugin = this.app.getPlugin(import_plugin_workflow.default);
|
|
48
|
-
workflowPlugin.registerInstruction("request", import_RequestInstruction.default);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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 { AxiosRequestConfig } from 'axios';
|
|
10
|
-
import { Processor, Instruction, FlowNodeModel } from '@nocobase/plugin-workflow';
|
|
11
|
-
export interface Header {
|
|
12
|
-
name: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}
|
|
15
|
-
export type RequestConfig = Pick<AxiosRequestConfig, 'url' | 'method' | 'params' | 'data' | 'timeout'> & {
|
|
16
|
-
headers: Array<Header>;
|
|
17
|
-
contentType: string;
|
|
18
|
-
ignoreFail: boolean;
|
|
19
|
-
onlyData?: boolean;
|
|
20
|
-
};
|
|
21
|
-
export default class extends Instruction {
|
|
22
|
-
run(node: FlowNodeModel, prevJob: any, processor: Processor): Promise<any>;
|
|
23
|
-
resume(node: FlowNodeModel, job: any, processor: Processor): Promise<any>;
|
|
24
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
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
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var RequestInstruction_exports = {};
|
|
38
|
-
__export(RequestInstruction_exports, {
|
|
39
|
-
default: () => RequestInstruction_default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(RequestInstruction_exports);
|
|
42
|
-
var import_axios = __toESM(require("axios"));
|
|
43
|
-
var import_plugin_workflow = require("@nocobase/plugin-workflow");
|
|
44
|
-
const ContentTypeTransformers = {
|
|
45
|
-
"application/json"(data) {
|
|
46
|
-
return data;
|
|
47
|
-
},
|
|
48
|
-
"application/x-www-form-urlencoded"(data) {
|
|
49
|
-
return new URLSearchParams(
|
|
50
|
-
data.filter(({ name, value }) => name && typeof value !== "undefined").map(({ name, value }) => [name, value])
|
|
51
|
-
).toString();
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
async function request(config) {
|
|
55
|
-
const { url, method = "POST", contentType = "application/json", data, timeout = 5e3 } = config;
|
|
56
|
-
const headers = (config.headers ?? []).reduce((result, header) => {
|
|
57
|
-
var _a, _b;
|
|
58
|
-
const name = (_a = header.name) == null ? void 0 : _a.trim();
|
|
59
|
-
if (name.toLowerCase() === "content-type") {
|
|
60
|
-
return result;
|
|
61
|
-
}
|
|
62
|
-
return Object.assign(result, { [name]: (_b = header.value) == null ? void 0 : _b.trim() });
|
|
63
|
-
}, {});
|
|
64
|
-
const params = (config.params ?? []).reduce(
|
|
65
|
-
(result, param) => {
|
|
66
|
-
var _a;
|
|
67
|
-
return Object.assign(result, { [param.name]: (_a = param.value) == null ? void 0 : _a.trim() });
|
|
68
|
-
},
|
|
69
|
-
{}
|
|
70
|
-
);
|
|
71
|
-
headers["Content-Type"] = contentType;
|
|
72
|
-
return import_axios.default.request({
|
|
73
|
-
url: url == null ? void 0 : url.trim(),
|
|
74
|
-
method,
|
|
75
|
-
headers,
|
|
76
|
-
params,
|
|
77
|
-
timeout,
|
|
78
|
-
...method.toLowerCase() !== "get" && data != null ? {
|
|
79
|
-
data: ContentTypeTransformers[contentType](data)
|
|
80
|
-
} : {}
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
function responseSuccess(response, onlyData = false) {
|
|
84
|
-
return onlyData ? response.data : {
|
|
85
|
-
status: response.status,
|
|
86
|
-
statusText: response.statusText,
|
|
87
|
-
headers: response.headers,
|
|
88
|
-
config: response.config,
|
|
89
|
-
data: response.data
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
function responseFailure(error) {
|
|
93
|
-
let result = {
|
|
94
|
-
message: error.message,
|
|
95
|
-
stack: error.stack
|
|
96
|
-
};
|
|
97
|
-
if (error.isAxiosError) {
|
|
98
|
-
if (error.response) {
|
|
99
|
-
Object.assign(result, {
|
|
100
|
-
status: error.response.status,
|
|
101
|
-
statusText: error.response.statusText,
|
|
102
|
-
headers: error.response.headers,
|
|
103
|
-
config: error.response.config,
|
|
104
|
-
data: error.response.data
|
|
105
|
-
});
|
|
106
|
-
} else if (error.request) {
|
|
107
|
-
result = error.toJSON();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return result;
|
|
111
|
-
}
|
|
112
|
-
class RequestInstruction_default extends import_plugin_workflow.Instruction {
|
|
113
|
-
async run(node, prevJob, processor) {
|
|
114
|
-
const config = processor.getParsedValue(node.config, node.id);
|
|
115
|
-
const { workflow } = processor.execution;
|
|
116
|
-
const sync = this.workflow.isWorkflowSync(workflow);
|
|
117
|
-
if (sync) {
|
|
118
|
-
try {
|
|
119
|
-
const response = await request(config);
|
|
120
|
-
return {
|
|
121
|
-
status: import_plugin_workflow.JOB_STATUS.RESOLVED,
|
|
122
|
-
result: responseSuccess(response, config.onlyData)
|
|
123
|
-
};
|
|
124
|
-
} catch (error) {
|
|
125
|
-
return {
|
|
126
|
-
status: config.ignoreFail ? import_plugin_workflow.JOB_STATUS.RESOLVED : import_plugin_workflow.JOB_STATUS.FAILED,
|
|
127
|
-
result: error.isAxiosError ? error.toJSON() : error.message
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
const job = await processor.saveJob({
|
|
132
|
-
status: import_plugin_workflow.JOB_STATUS.PENDING,
|
|
133
|
-
nodeId: node.id,
|
|
134
|
-
nodeKey: node.key,
|
|
135
|
-
upstreamId: (prevJob == null ? void 0 : prevJob.id) ?? null
|
|
136
|
-
});
|
|
137
|
-
request(config).then((response) => {
|
|
138
|
-
processor.logger.info(`request (#${node.id}) response success, status: ${response.status}`);
|
|
139
|
-
job.set({
|
|
140
|
-
status: import_plugin_workflow.JOB_STATUS.RESOLVED,
|
|
141
|
-
result: responseSuccess(response, config.onlyData)
|
|
142
|
-
});
|
|
143
|
-
}).catch((error) => {
|
|
144
|
-
if (error.isAxiosError) {
|
|
145
|
-
if (error.response) {
|
|
146
|
-
processor.logger.info(`request (#${node.id}) failed with response, status: ${error.response.status}`);
|
|
147
|
-
} else if (error.request) {
|
|
148
|
-
processor.logger.error(`request (#${node.id}) failed without resposne: ${error.message}`);
|
|
149
|
-
} else {
|
|
150
|
-
processor.logger.error(`request (#${node.id}) initiation failed: ${error.message}`);
|
|
151
|
-
}
|
|
152
|
-
} else {
|
|
153
|
-
processor.logger.error(`request (#${node.id}) failed unexpectedly: ${error.message}`);
|
|
154
|
-
}
|
|
155
|
-
job.set({
|
|
156
|
-
status: import_plugin_workflow.JOB_STATUS.FAILED,
|
|
157
|
-
result: responseFailure(error)
|
|
158
|
-
});
|
|
159
|
-
}).finally(() => {
|
|
160
|
-
processor.logger.debug(`request (#${node.id}) ended, resume workflow...`);
|
|
161
|
-
setImmediate(() => {
|
|
162
|
-
this.workflow.resume(job);
|
|
163
|
-
});
|
|
164
|
-
});
|
|
165
|
-
processor.logger.info(`request (#${node.id}) sent to "${config.url}", waiting for response...`);
|
|
166
|
-
return processor.exit();
|
|
167
|
-
}
|
|
168
|
-
async resume(node, job, processor) {
|
|
169
|
-
const { ignoreFail } = node.config;
|
|
170
|
-
if (ignoreFail) {
|
|
171
|
-
job.set("status", import_plugin_workflow.JOB_STATUS.RESOLVED);
|
|
172
|
-
}
|
|
173
|
-
return job;
|
|
174
|
-
}
|
|
175
|
-
}
|
package/dist/server/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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';
|
package/dist/server/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var server_exports = {};
|
|
38
|
-
__export(server_exports, {
|
|
39
|
-
default: () => import_Plugin.default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(server_exports);
|
|
42
|
-
var import_Plugin = __toESM(require("./Plugin"));
|
|
@@ -1,13 +0,0 @@
|
|
|
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 { Migration } from '@nocobase/server';
|
|
10
|
-
export default class extends Migration {
|
|
11
|
-
appVersion: string;
|
|
12
|
-
up(): Promise<void>;
|
|
13
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var make_legacy_config_compatible_exports = {};
|
|
28
|
-
__export(make_legacy_config_compatible_exports, {
|
|
29
|
-
default: () => make_legacy_config_compatible_default
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(make_legacy_config_compatible_exports);
|
|
32
|
-
var import_server = require("@nocobase/server");
|
|
33
|
-
class make_legacy_config_compatible_default extends import_server.Migration {
|
|
34
|
-
appVersion = "<1.0.0-alpha.15";
|
|
35
|
-
async up() {
|
|
36
|
-
const { db } = this.context;
|
|
37
|
-
const NodeRepo = db.getRepository("flow_nodes");
|
|
38
|
-
await db.sequelize.transaction(async (transaction) => {
|
|
39
|
-
const nodes = await NodeRepo.find({
|
|
40
|
-
filter: {
|
|
41
|
-
type: "request"
|
|
42
|
-
},
|
|
43
|
-
transaction
|
|
44
|
-
});
|
|
45
|
-
await nodes.reduce(
|
|
46
|
-
(promise, node) => promise.then(() => {
|
|
47
|
-
node.set("config", { ...node.config, onlyData: true });
|
|
48
|
-
node.changed("config", true);
|
|
49
|
-
return node.save({
|
|
50
|
-
silent: true,
|
|
51
|
-
transaction
|
|
52
|
-
});
|
|
53
|
-
}),
|
|
54
|
-
Promise.resolve()
|
|
55
|
-
);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
}
|