@nocobase/plugin-workflow-request 0.18.0-alpha.8 → 0.18.0-alpha.9

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.
@@ -1,4 +1,4 @@
1
- import { Instruction, WorkflowVariableInput, WorkflowVariableJSON } from '@nocobase/plugin-workflow/client';
1
+ import { Instruction, WorkflowVariableInput, WorkflowVariableJSON, WorkflowVariableTextArea } from '@nocobase/plugin-workflow/client';
2
2
  export default class extends Instruction {
3
3
  title: string;
4
4
  type: string;
@@ -166,6 +166,7 @@ export default class extends Instruction {
166
166
  }>;
167
167
  };
168
168
  WorkflowVariableInput: typeof WorkflowVariableInput;
169
+ WorkflowVariableTextArea: typeof WorkflowVariableTextArea;
169
170
  WorkflowVariableJSON: typeof WorkflowVariableJSON;
170
171
  };
171
172
  useVariables({ key, title }: {
@@ -1 +1 @@
1
- (function(t,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@nocobase/client"),require("@formily/antd-v5"),require("@nocobase/plugin-workflow/client"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@formily/antd-v5","@nocobase/plugin-workflow/client","react-i18next"],o):(t=typeof globalThis!="undefined"?globalThis:t||self,o(t["@nocobase/plugin-workflow-request"]={},t["@nocobase/client"],t["@formily/antd-v5"],t["@nocobase/plugin-workflow"]))})(this,function(t,o,r,s){"use strict";var x=Object.defineProperty;var y=(t,o,r)=>o in t?x(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r;var a=(t,o,r)=>(y(t,typeof o!="symbol"?o+"":o,r),r);var l=(t,o,r)=>new Promise((s,e)=>{var d=n=>{try{p(r.next(n))}catch(i){e(i)}},m=n=>{try{p(r.throw(n))}catch(i){e(i)}},p=n=>n.done?s(n.value):Promise.resolve(n.value).then(d,m);p((r=r.apply(t,o)).next())});const e="workflow-request";class d extends s.Instruction{constructor(){super(...arguments);a(this,"title",`{{t("HTTP request", { ns: "${e}" })}}`);a(this,"type","request");a(this,"group","extended");a(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: "${e}" })}}`);a(this,"fieldset",{method:{type:"string",required:!0,title:`{{t("HTTP method", { ns: "${e}" })}}`,"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: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"Input","x-component-props":{placeholder:"https://www.nocobase.com"}},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Headers", { ns: "${e}" })}}`,description:`{{t('"Content-Type" only support "application/json", and no need to specify', { ns: "${e}" })}}`,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":"WorkflowVariableInput","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add request header", { ns: "${e}" })}}`,"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Parameters", { ns: "${e}" })}}`,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":"WorkflowVariableInput","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add parameter", { ns: "${e}" })}}`,"x-component":"ArrayItems.Addition"}}},data:{type:"string",title:`{{t("Body", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"WorkflowVariableJSON","x-component-props":{changeOnSelect:!0,autoSize:{minRows:10},placeholder:`{{t("Input request data", { ns: "${e}" })}}`},description:`{{t("Only support standard JSON data", { ns: "${e}" })}}`},timeout:{type:"number",title:`{{t("Timeout config", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:`{{t("ms", { ns: "${e}" })}}`,min:1,step:1e3,defaultValue:5e3}},ignoreFail:{type:"boolean",title:`{{t("Ignore failed request and continue workflow", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox"}});a(this,"components",{ArrayItems:r.ArrayItems,WorkflowVariableInput:s.WorkflowVariableInput,WorkflowVariableJSON:s.WorkflowVariableJSON})}useVariables({key:i,title:u},{types:f,fieldNames:c=s.defaultFieldNames}){return{[c.value]:i,[c.label]:u}}}class m extends o.Plugin{afterAdd(){return l(this,null,function*(){})}beforeLoad(){return l(this,null,function*(){})}load(){return l(this,null,function*(){this.app.pm.get("workflow").registerInstruction("request",d)})}}t.default=m,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(t,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@nocobase/client"),require("@formily/antd-v5"),require("@nocobase/plugin-workflow/client"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","@formily/antd-v5","@nocobase/plugin-workflow/client","react-i18next"],o):(t=typeof globalThis!="undefined"?globalThis:t||self,o(t["@nocobase/plugin-workflow-request"]={},t["@nocobase/client"],t["@formily/antd-v5"],t["@nocobase/plugin-workflow"]))})(this,function(t,o,r,a){"use strict";var x=Object.defineProperty;var y=(t,o,r)=>o in t?x(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r;var s=(t,o,r)=>(y(t,typeof o!="symbol"?o+"":o,r),r);var l=(t,o,r)=>new Promise((a,e)=>{var d=n=>{try{p(r.next(n))}catch(i){e(i)}},m=n=>{try{p(r.throw(n))}catch(i){e(i)}},p=n=>n.done?a(n.value):Promise.resolve(n.value).then(d,m);p((r=r.apply(t,o)).next())});const e="workflow-request";class d extends a.Instruction{constructor(){super(...arguments);s(this,"title",`{{t("HTTP request", { ns: "${e}" })}}`);s(this,"type","request");s(this,"group","extended");s(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: "${e}" })}}`);s(this,"fieldset",{method:{type:"string",required:!0,title:`{{t("HTTP method", { ns: "${e}" })}}`,"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: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"WorkflowVariableTextArea","x-component-props":{placeholder:"https://www.nocobase.com"}},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Headers", { ns: "${e}" })}}`,description:`{{t('"Content-Type" only support "application/json", and no need to specify', { ns: "${e}" })}}`,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":"WorkflowVariableInput","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add request header", { ns: "${e}" })}}`,"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Parameters", { ns: "${e}" })}}`,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":"WorkflowVariableInput","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add parameter", { ns: "${e}" })}}`,"x-component":"ArrayItems.Addition"}}},data:{type:"string",title:`{{t("Body", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"WorkflowVariableJSON","x-component-props":{changeOnSelect:!0,autoSize:{minRows:10},placeholder:`{{t("Input request data", { ns: "${e}" })}}`},description:`{{t("Only support standard JSON data", { ns: "${e}" })}}`},timeout:{type:"number",title:`{{t("Timeout config", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:`{{t("ms", { ns: "${e}" })}}`,min:1,step:1e3,defaultValue:5e3}},ignoreFail:{type:"boolean",title:`{{t("Ignore failed request and continue workflow", { ns: "${e}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox"}});s(this,"components",{ArrayItems:r.ArrayItems,WorkflowVariableInput:a.WorkflowVariableInput,WorkflowVariableTextArea:a.WorkflowVariableTextArea,WorkflowVariableJSON:a.WorkflowVariableJSON})}useVariables({key:i,title:u},{types:f,fieldNames:c=a.defaultFieldNames}){return{[c.value]:i,[c.label]:u}}}class m extends o.Plugin{afterAdd(){return l(this,null,function*(){})}beforeLoad(){return l(this,null,function*(){})}load(){return l(this,null,function*(){this.app.pm.get("workflow").registerInstruction("request",d)})}}t.default=m,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
2
  "@formily/antd-v5": "1.1.9",
3
- "@nocobase/plugin-workflow": "0.18.0-alpha.8",
4
- "@nocobase/client": "0.18.0-alpha.8",
3
+ "@nocobase/plugin-workflow": "0.18.0-alpha.9",
4
+ "@nocobase/client": "0.18.0-alpha.9",
5
5
  "react-i18next": "11.18.6",
6
- "@nocobase/server": "0.18.0-alpha.8",
6
+ "@nocobase/server": "0.18.0-alpha.9",
7
7
  "axios": "0.26.1"
8
8
  };
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": "0.18.0-alpha.8",
7
+ "version": "0.18.0-alpha.9",
8
8
  "license": "AGPL-3.0",
9
9
  "main": "./dist/server/index.js",
10
10
  "devDependencies": {
@@ -19,5 +19,5 @@
19
19
  "@nocobase/server": "0.x",
20
20
  "@nocobase/test": "0.x"
21
21
  },
22
- "gitHead": "727d42f6f14e5f863831da3dbf3255ba1165b567"
22
+ "gitHead": "34ca0df4eede2e83fc86297b0fe19eba970e2b1b"
23
23
  }
@@ -4,6 +4,7 @@ import {
4
4
  Instruction,
5
5
  WorkflowVariableInput,
6
6
  WorkflowVariableJSON,
7
+ WorkflowVariableTextArea,
7
8
  defaultFieldNames,
8
9
  } from '@nocobase/plugin-workflow/client';
9
10
 
@@ -41,7 +42,7 @@ export default class extends Instruction {
41
42
  title: `{{t("URL", { ns: "${NAMESPACE}" })}}`,
42
43
  'x-decorator': 'FormItem',
43
44
  'x-decorator-props': {},
44
- 'x-component': 'Input',
45
+ 'x-component': 'WorkflowVariableTextArea',
45
46
  'x-component-props': {
46
47
  placeholder: 'https://www.nocobase.com',
47
48
  },
@@ -175,6 +176,7 @@ export default class extends Instruction {
175
176
  components = {
176
177
  ArrayItems,
177
178
  WorkflowVariableInput,
179
+ WorkflowVariableTextArea,
178
180
  WorkflowVariableJSON,
179
181
  };
180
182
  useVariables({ key, title }, { types, fieldNames = defaultFieldNames }) {