@nocobase/plugin-workflow-request 1.5.0-beta.1 → 1.6.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.
@@ -7,20 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(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"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(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,o,r,x,c,f,l,i,t,m){"use strict";var P=Object.defineProperty,W=Object.defineProperties;var R=Object.getOwnPropertyDescriptors;var k=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var T=(e,o,r)=>o in e?P(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,S=(e,o)=>{for(var r in o||(o={}))j.call(o,r)&&T(e,r,o[r]);if(k)for(var r of k(o))E.call(o,r)&&T(e,r,o[r]);return e},q=(e,o)=>W(e,R(o));var n=(e,o,r)=>(T(e,typeof o!="symbol"?o+"":o,r),r);var u=(e,o,r)=>new Promise((x,c)=>{var f=t=>{try{i(r.next(t))}catch(m){c(m)}},l=t=>{try{i(r.throw(t))}catch(m){c(m)}},i=t=>t.done?x(t.value):Promise.resolve(t.value).then(f,l);i((r=r.apply(e,o)).next())});const a="workflow-request";function y(s,p={}){const{t:d}=N(p);return d(s)}function N(s){return m.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"}}}}},"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:o.css`
11
- font-size: 80%;
12
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
13
- `}}}},"text/plain":{type:"void",properties:{data:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{autoSize:{minRows:10},className:o.css`
14
- font-size: 80%;
15
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
16
- `}}}}};function g(s){const p=l.useField(),{values:d,setValuesIn:w,clearFormGraph:b}=l.useForm(),{contentType:A}=d,[h,v]=x.useState(F[A]);return l.useFormEffects(()=>{c.onFieldValueChange("contentType",I=>{b(`${p.address}.*`),v(q(S({},F[I.value]),{name:f.uid()})),w("data",null)})}),r.jsx(o.SchemaComponent,{basePath:p.address,schema:h,onlyRenderProperties:!0})}class V extends t.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"},{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: "${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:o.css`
17
- & > .ant-space-item:first-child,
18
- & > .ant-space-item:last-child {
19
- flex-shrink: 0;
20
- }
21
- `},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:o.css`
22
- & > .ant-space-item:first-child,
23
- & > .ant-space-item:last-child {
24
- flex-shrink: 0;
25
- }
26
- `},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","x-content":`{{t("Ignore failed request and continue workflow", { ns: "${a}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox"}});n(this,"components",{ArrayItems:i.ArrayItems,BodyComponent:g,WorkflowVariableJSON:t.WorkflowVariableJSON,WorkflowVariableTextArea:t.WorkflowVariableTextArea,WorkflowVariableRawTextArea:t.WorkflowVariableRawTextArea});n(this,"testable",!0)}useVariables({key:d,title:w,config:b},{types:A}){const h=y("Status code"),v=y("Data"),I=y("Response headers");return{[t.defaultFieldNames.value]:d,[t.defaultFieldNames.label]:w,[t.defaultFieldNames.children]:b.onlyData?null:[{[t.defaultFieldNames.value]:"status",[t.defaultFieldNames.label]:h},{[t.defaultFieldNames.value]:"data",[t.defaultFieldNames.label]:v},{[t.defaultFieldNames.value]:"headers",[t.defaultFieldNames.label]:I}]}}}class C extends o.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",V)})}}e.default=C,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@formily/antd-v5"),require("@nocobase/plugin-workflow/client"),require("react-i18next"),require("@formily/shared"),require("@formily/react"),require("@formily/core"),require("@nocobase/client"),require("react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-request",["@formily/antd-v5","@nocobase/plugin-workflow/client","react-i18next","@formily/shared","@formily/react","@formily/core","@nocobase/client","react"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-request"]=t(require("@formily/antd-v5"),require("@nocobase/plugin-workflow/client"),require("react-i18next"),require("@formily/shared"),require("@formily/react"),require("@formily/core"),require("@nocobase/client"),require("react")):e["@nocobase/plugin-workflow-request"]=t(e["@formily/antd-v5"],e["@nocobase/plugin-workflow/client"],e["react-i18next"],e["@formily/shared"],e["@formily/react"],e["@formily/core"],e["@nocobase/client"],e.react)}(self,function(e,t,r,o,n,a,c,i){return function(){"use strict";var l={632:function(t){t.exports=e},563:function(e){e.exports=a},505:function(e){e.exports=n},875:function(e){e.exports=o},772:function(e){e.exports=c},433:function(e){e.exports=t},156:function(e){e.exports=i},238:function(e){e.exports=r}},u={};function p(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}};return l[e](r,r.exports,p),r.exports}p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var r in t)p.o(t,r)&&!p.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};p.r(s),p.d(s,{default:function(){return G}});var f=p("772"),m=p("156"),d=p.n(m),y=p("563"),b=p("875"),x=p("505"),v=p("632"),h=p("433"),w=p("238"),g="workflow-request";function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,function(e){return(0,w.useTranslation)(g,e)}(t).t)(e)}function j(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 T(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)}}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function S(e){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function P(e,t){return(P=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function k(e,t){return!t&&(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function F(){var e=k(["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "]);return F=function(){return e},e}function q(){var e=k(["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "]);return q=function(){return e},e}function E(){var e=k(["\n & > .ant-space-item:first-child,\n & > .ant-space-item:last-child {\n flex-shrink: 0;\n }\n "]);return E=function(){return e},e}function N(){var e=k(["\n & > .ant-space-item:first-child,\n & > .ant-space-item:last-child {\n flex-shrink: 0;\n }\n "]);return N=function(){return e},e}var R={"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(g,'" })}}')}}}},"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(g,'" })}}'),"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,f.css)(F())}}}},"text/plain":{type:"void",properties:{data:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{autoSize:{minRows:10},className:(0,f.css)(q())}}}}};function _(e){var t,r,o=(0,x.useField)(),n=(0,x.useForm)(),a=n.values,c=n.setValuesIn,i=n.clearFormGraph,l=a.contentType;var u=(t=(0,m.useState)(R[l]),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,o,n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a=[],c=!0,i=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,o=e}finally{try{!c&&null!=n.return&&n.return()}finally{if(i)throw o}}return a}}(t,2)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(e,t)}}(t,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),p=u[0],s=u[1];return(0,x.useFormEffects)(function(){(0,y.onFieldValueChange)("contentType",function(e){var t,r;i("".concat(o.address,".*")),s((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){I(e,t,r[t])})}return e}({},R[e.value]),r=(r={name:(0,b.uid)()},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r.push.apply(r,o)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)),c("data",null)})}),d().createElement(f.SchemaComponent,{basePath:o.address,schema:p,onlyRenderProperties:!0})}var C=function(e){var t,r,o;function n(){var e,t,r,o;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),t=this,r=n,o=arguments,r=S(r),I(e=function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(t,A()?Reflect.construct(r,o||[],S(t).constructor):r.apply(t,o)),"title",'{{t("HTTP request", { ns: "'.concat(g,'" })}}')),I(e,"type","request"),I(e,"group","extended"),I(e,"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(g,'" })}}')),I(e,"fieldset",{method:{type:"string",required:!0,title:'{{t("HTTP method", { ns: "'.concat(g,'" })}}'),"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(g,'" })}}'),"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(g,'" })}}'),"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:"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(g,'" })}}'),description:'{{t(\'"Content-Type" will be ignored from headers.\', { ns: "'.concat(g,'" })}}'),items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:(0,f.css)(E())},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(g,'" })}}'),"x-component":"ArrayItems.Addition"}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:'{{t("Parameters", { ns: "'.concat(g,'" })}}'),items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:(0,f.css)(N())},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(g,'" })}}'),"x-component":"ArrayItems.Addition"}}},data:{type:"void",title:'{{t("Body", { ns: "'.concat(g,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"BodyComponent"},timeout:{type:"number",title:'{{t("Timeout config", { ns: "'.concat(g,'" })}}'),"x-decorator":"FormItem","x-decorator-props":{},"x-component":"InputNumber","x-component-props":{addonAfter:'{{t("ms", { ns: "'.concat(g,'" })}}'),min:1,step:1e3,defaultValue:5e3}},ignoreFail:{type:"boolean","x-content":'{{t("Ignore failed request and continue workflow", { ns: "'.concat(g,'" })}}'),"x-decorator":"FormItem","x-component":"Checkbox"}}),I(e,"components",{ArrayItems:v.ArrayItems,BodyComponent:_,WorkflowVariableJSON:h.WorkflowVariableJSON,WorkflowVariableTextArea:h.WorkflowVariableTextArea,WorkflowVariableRawTextArea:h.WorkflowVariableRawTextArea}),I(e,"testable",!0),e}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&P(e,t)}(n,e),t=n,r=[{key:"useVariables",value:function(e,t){var r,o,n,a,c=e.key,i=e.title,l=e.config;t.types;var u=O("Status code"),p=O("Data"),s=O("Response headers");return I(a={},h.defaultFieldNames.value,c),I(a,h.defaultFieldNames.label,i),I(a,h.defaultFieldNames.children,l.onlyData?null:[(I(r={},h.defaultFieldNames.value,"status"),I(r,h.defaultFieldNames.label,u),r),(I(o={},h.defaultFieldNames.value,"data"),I(o,h.defaultFieldNames.label,p),o),(I(n={},h.defaultFieldNames.value,"headers"),I(n,h.defaultFieldNames.label,s),n)]),a}}],T(t.prototype,r),n}(h.Instruction);function V(e,t,r,o,n,a,c){try{var i=e[a](c),l=i.value}catch(e){r(e);return}i.done?t(l):Promise.resolve(l).then(o,n)}function W(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){var a=e.apply(t,r);function c(e){V(a,o,n,c,i,"next",e)}function i(e){V(a,o,n,c,i,"throw",e)}c(void 0)})}}function M(e,t,r){return(M=H()?Reflect.construct:function(e,t,r){var o=[null];o.push.apply(o,t);var n=new(Function.bind.apply(e,o));return r&&z(n,r.prototype),n}).apply(null,arguments)}function D(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)}}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function z(e,t){return(z=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function B(e){var t="function"==typeof Map?new Map:void 0;return(B=function(e){var r;if(null===e||(r=e,-1===Function.toString.call(r).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,o)}function o(){return M(e,arguments,U(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),z(o,e)})(e)}function H(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(H=function(){return!!e})()}function L(e,t){var r,o,n,a,c={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(r)throw TypeError("Generator is already executing.");for(;c;)try{if(r=1,o&&(n=2&a[0]?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,o=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(n=(n=c.trys).length>0&&n[n.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){c.label=a[1];break}if(6===a[0]&&c.label<n[1]){c.label=n[1],n=a;break}if(n&&c.label<n[2]){c.label=n[2],c.ops.push(a);break}n[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],o=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}var G=function(e){var t,r,o;function n(){var e,t,r;return!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),e=this,t=n,r=arguments,t=U(t),function(e,t){return t&&("object"===function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}(t)||"function"==typeof t)?t:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,H()?Reflect.construct(t,r||[],U(e).constructor):t.apply(e,r))}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&z(e,t)}(n,e),t=n,r=[{key:"afterAdd",value:function(){return W(function(){return L(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return W(function(){return L(this,function(e){return[2]})})()}},{key:"load",value:function(){var e=this;return W(function(){return L(this,function(t){return e.app.pm.get("workflow").registerInstruction("request",C),[2]})})()}}],D(t.prototype,r),n}(B(f.Plugin));return s}()});
@@ -13,10 +13,10 @@ module.exports = {
13
13
  "@formily/shared": "2.3.2",
14
14
  "@formily/react": "2.3.0",
15
15
  "@formily/antd-v5": "1.1.9",
16
- "@nocobase/plugin-workflow": "1.5.0-beta.1",
17
- "@nocobase/client": "1.5.0-beta.1",
16
+ "@nocobase/plugin-workflow": "1.6.0-alpha.2",
17
+ "@nocobase/client": "1.6.0-alpha.2",
18
18
  "react-i18next": "11.18.6",
19
- "@nocobase/server": "1.5.0-beta.1",
19
+ "@nocobase/server": "1.6.0-alpha.2",
20
20
  "axios": "1.7.7",
21
21
  "lodash": "4.17.21"
22
22
  };
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.5.0-beta.1",
7
+ "version": "1.6.0-alpha.2",
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": "10c6f1f3d90e91f3aabfa80449c7ef062e90f6af",
25
+ "gitHead": "08bbc34c21727fc0ad0880f397a42bf7741091ee",
26
26
  "keywords": [
27
27
  "Workflow"
28
28
  ]