@nocobase/plugin-workflow-javascript 2.1.0-beta.13 → 2.1.0-beta.15
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/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/dist/node_modules/isolated-vm/package.json +1 -1
- package/dist/node_modules/winston-transport/package.json +1 -1
- package/package.json +2 -2
- /package/dist/client/{d608e8e5c2f2b5cf.js → 222.14d8875e2c6f2280.js} +0 -0
- /package/dist/client/{907399554f340b0a.js → 701.b08b27a00a835b5b.js} +0 -0
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("ahooks"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("lodash"),require("antd"),require("antd-style"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-javascript",["ahooks","@nocobase/client","@nocobase/plugin-workflow/client","@formily/antd-v5","react","@ant-design/icons","lodash","antd","antd-style","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-javascript"]=t(require("ahooks"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("lodash"),require("antd"),require("antd-style"),require("react-i18next")):e["@nocobase/plugin-workflow-javascript"]=t(e.ahooks,e["@nocobase/client"],e["@nocobase/plugin-workflow/client"],e["@formily/antd-v5"],e.react,e["@ant-design/icons"],e.lodash,e.antd,e["antd-style"],e["react-i18next"])}(self,function(e,t,n,r,o,i,c,u,a,l){return function(){var s,p,f,d,b,y,m={3581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=i},4632:function(e){"use strict";e.exports=r},3772:function(e){"use strict";e.exports=t},8433:function(e){"use strict";e.exports=n},2749:function(t){"use strict";t.exports=e},2721:function(e){"use strict";e.exports=u},8202:function(e){"use strict";e.exports=a},467:function(e){"use strict";e.exports=c},8156:function(e){"use strict";e.exports=o},3238:function(e){"use strict";e.exports=l}},v={};function h(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return m[e](n,n.exports,h),n.exports}h.m=m,h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.f={},h.e=function(e){return Promise.all(Object.keys(h.f).reduce(function(t,n){return h.f[n](e,t),t},[]))},h.u=function(e){return""+({222:"d608e8e5c2f2b5cf",701:"907399554f340b0a"})[e]+".js"},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},p="@nocobase/plugin-workflow-javascript:",h.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var a=c[u];if(a.getAttribute("src")==e||a.getAttribute("data-webpack")==p+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,h.nc&&o.setAttribute("nonce",h.nc),o.setAttribute("data-webpack",p+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=s[e];if(delete s[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)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(f=window.__webpack_public_path__||"/").endsWith("/")||(f+="/"),h.p=f+"static/plugins/@nocobase/plugin-workflow-javascript/dist/client/",d={909:0},h.f.j=function(e,t){var n=h.o(d,e)?d[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=h.p+h.u(e),i=Error();h.l(o,function(t){if(h.o(d,e)&&(0!==(n=d[e])&&(d[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)}},b=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==d[e]})){for(n in i)h.o(i,n)&&(h.m[n]=i[n]);c&&c(h)}for(e&&e(t);u<o.length;u++)r=o[u],h.o(d,r)&&d[r]&&d[r][0](),d[r]=0},(y=self.webpackChunk_nocobase_plugin_workflow_javascript=self.webpackChunk_nocobase_plugin_workflow_javascript||[]).forEach(b.bind(null,0)),y.push=b.bind(null,y.push.bind(y));var g={};return!function(){"use strict";h.r(g),h.d(g,{PluginWorkflowScriptClient:function(){return _},default:function(){return S}});var e=h(3772),t=h(4632),n=h(482),r=h(8433),o=h(2721),i=h(8156),c=h.n(i);h(3238);var u="workflow-javascript";function a(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.i18n.t(t,(n=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}({},o),r=r={ns:u},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}var l=h(3581);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=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 b=(0,i.lazy)(function(){return l("imported_-9r67ij_component",Promise.all([h.e("701"),h.e("222")]).then(h.bind(h,1706)))});function y(){return c().createElement("div",null,c().createElement("span",null,a("Node.js features supported can be found in the documentaion: ")),c().createElement("a",{href:a("https://docs.nocobase.com/handbook/workflow-javascript"),target:"_blank",rel:"noreferrer"},a("JavaScript node")))}var m=function(e){var i;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,i,f;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return i=l,f=arguments,i=p(i),s(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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(i,f||[],p(this).constructor):i.apply(this,f)),"title","JavaScript"),s(e,"type","script"),s(e,"group","extended"),s(e,"description",'{{t("Execute a piece of JavaScript in an isolated Node.js environment.", { ns: "'.concat(u,'" })}}')),s(e,"icon",c().createElement(n.CodeOutlined,null)),s(e,"fieldset",{arguments:{type:"array",title:'{{t("Arguments", { ns: "'.concat(u,'" })}}'),description:'{{t("The arguments that will be used in script with same name.", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"ArrayItems",default:[],items:{type:"object","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'},"x-validator":function(e,t,n){var r=RegExp("^[\\p{L}$_][\\p{L}\\p{N}$_]*$","u"),o=n.form.getValuesIn().arguments.filter(function(t){return t.name===e});return r.test(e)?!(o.length>1)||a("Argument name duplicated"):a("Argument name is invalid")}},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{changeOnSelect:!0,useTypedConstant:!0,placeholder:'{{t("Value")}}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add argument", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}},content:{type:"string",title:'{{t("Script content", { ns: "'.concat(u,'" })}}'),description:"{{useScriptDescription()}}","x-decorator":"FormItem","x-component":"CodeEditor",default:'return "Hello world!";'},timeout:{type:"number",title:'{{t("Timeout", { ns: "'.concat(u,'" })}}'),description:'{{t("The maximum execution time of the script. 0 means no timeout.", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:0,className:"auto-width",addonAfter:'{{t("Milliseconds", { ns: "'.concat(u,'" })}}')},default:0},continue:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Continue when exception thrown", { ns: "'.concat(u,'" })}}'),default:!1}}),s(e,"scope",{useScriptDescription:y}),s(e,"components",{ArrayItems:t.ArrayItems,CodeEditor:b,WorkflowVariableInput:r.WorkflowVariableInput,Space:o.Space}),s(e,"testable",!0),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&f(l,e),i=[{key:"useVariables",value:function(e,t){var n=e.key,o=e.title,i=t.types;return(void 0===t.fieldNames&&r.defaultFieldNames,i&&!i.some(function(e){return e in r.BaseTypeSets||Object.values(r.BaseTypeSets).some(function(t){return t.has(e)})}))?null:{value:n,label:o}}},{key:"useInitializers",value:function(e){var t,n;return{name:null!=(t=e.title)?t:"#".concat(e.id),type:"item",title:null!=(n=e.title)?n:"#".concat(e.id),Component:r.ValueBlock.Initializer,node:e,resultTitle:a("Script result")}}},{key:"getCreateModelMenuItem",value:function(e){var t,n,r=e.node;return{key:null!=(t=r.title)?t:"#".concat(r.id),label:null!=(n=r.title)?n:"#".concat(r.id),useModel:"NodeValueModel",createModelOptions:{use:"NodeValueModel",stepParams:{valueSettings:{init:{dataSource:"{{$jobsMapByNodeKey.".concat(r.key,"}}"),defaultValue:a("Script result")}},cardSettings:{titleDescription:{title:'{{t("JavaScript", { ns: "'.concat(u,'" })}}')}}}}}}}],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)}}(l.prototype,i),l}(r.Instruction);function v(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function w(e,t,n){return(w=k()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&j(o,n.prototype),o}).apply(null,arguments)}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=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 w(e,arguments,x(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),j(n,e)})(e)}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}var _=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=x(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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,k()?Reflect.construct(e,t||[],x(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&j(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.pm.get("workflow").registerInstruction("script",m),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){v(i,r,o,c,u,"next",e)}function u(e){v(i,r,o,c,u,"throw",e)}c(void 0)})})()}}],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}(O(e.Plugin)),S=_}(),g}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("lodash"),require("antd"),require("antd-style"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-javascript",["ahooks","@nocobase/client","@nocobase/plugin-workflow/client","@formily/antd-v5","react","@ant-design/icons","lodash","antd","antd-style","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-javascript"]=t(require("ahooks"),require("@nocobase/client"),require("@nocobase/plugin-workflow/client"),require("@formily/antd-v5"),require("react"),require("@ant-design/icons"),require("lodash"),require("antd"),require("antd-style"),require("react-i18next")):e["@nocobase/plugin-workflow-javascript"]=t(e.ahooks,e["@nocobase/client"],e["@nocobase/plugin-workflow/client"],e["@formily/antd-v5"],e.react,e["@ant-design/icons"],e.lodash,e.antd,e["antd-style"],e["react-i18next"])}(self,function(e,t,n,r,o,i,c,u,a,l){return function(){var s,p,f,d,b,y,m={3581:function(e){e.exports=function(e,t){return"undefined"!=typeof __deoptimization_sideEffect__&&__deoptimization_sideEffect__(e,t),t}},482:function(e){"use strict";e.exports=i},4632:function(e){"use strict";e.exports=r},3772:function(e){"use strict";e.exports=t},8433:function(e){"use strict";e.exports=n},2749:function(t){"use strict";t.exports=e},2721:function(e){"use strict";e.exports=u},8202:function(e){"use strict";e.exports=a},467:function(e){"use strict";e.exports=c},8156:function(e){"use strict";e.exports=o},3238:function(e){"use strict";e.exports=l}},v={};function h(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return m[e](n,n.exports,h),n.exports}h.m=m,h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.f={},h.e=function(e){return Promise.all(Object.keys(h.f).reduce(function(t,n){return h.f[n](e,t),t},[]))},h.u=function(e){return""+e+"."+({222:"14d8875e2c6f2280",701:"b08b27a00a835b5b"})[e]+".js"},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s={},p="@nocobase/plugin-workflow-javascript:",h.l=function(e,t,n,r){if(s[e])return void s[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var a=c[u];if(a.getAttribute("src")==e||a.getAttribute("data-webpack")==p+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,h.nc&&o.setAttribute("nonce",h.nc),o.setAttribute("data-webpack",p+n),o.src=e),s[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(f);var r=s[e];if(delete s[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)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(f=window.__webpack_public_path__||"/").endsWith("/")||(f+="/"),h.p=f+"static/plugins/@nocobase/plugin-workflow-javascript/dist/client/",d={909:0},h.f.j=function(e,t){var n=h.o(d,e)?d[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=d[e]=[t,r]});t.push(n[2]=r);var o=h.p+h.u(e),i=Error();h.l(o,function(t){if(h.o(d,e)&&(0!==(n=d[e])&&(d[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)}},b=function(e,t){var n,r,o=t[0],i=t[1],c=t[2],u=0;if(o.some(function(e){return 0!==d[e]})){for(n in i)h.o(i,n)&&(h.m[n]=i[n]);c&&c(h)}for(e&&e(t);u<o.length;u++)r=o[u],h.o(d,r)&&d[r]&&d[r][0](),d[r]=0},(y=self.webpackChunk_nocobase_plugin_workflow_javascript=self.webpackChunk_nocobase_plugin_workflow_javascript||[]).forEach(b.bind(null,0)),y.push=b.bind(null,y.push.bind(y));var g={};return!function(){"use strict";h.r(g),h.d(g,{PluginWorkflowScriptClient:function(){return _},default:function(){return S}});var e=h(3772),t=h(4632),n=h(482),r=h(8433),o=h(2721),i=h(8156),c=h.n(i);h(3238);var u="workflow-javascript";function a(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.i18n.t(t,(n=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}({},o),r=r={ns:u},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}var l=h(3581);function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=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 b=(0,i.lazy)(function(){return l("imported_-9r67ij_component",Promise.all([h.e("701"),h.e("222")]).then(h.bind(h,1706)))});function y(){return c().createElement("div",null,c().createElement("span",null,a("Node.js features supported can be found in the documentaion: ")),c().createElement("a",{href:a("https://docs.nocobase.com/handbook/workflow-javascript"),target:"_blank",rel:"noreferrer"},a("JavaScript node")))}var m=function(e){var i;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function l(){var e,i,f;if(!(this instanceof l))throw TypeError("Cannot call a class as a function");return i=l,f=arguments,i=p(i),s(e=function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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(i,f||[],p(this).constructor):i.apply(this,f)),"title","JavaScript"),s(e,"type","script"),s(e,"group","extended"),s(e,"description",'{{t("Execute a piece of JavaScript in an isolated Node.js environment.", { ns: "'.concat(u,'" })}}')),s(e,"icon",c().createElement(n.CodeOutlined,null)),s(e,"fieldset",{arguments:{type:"array",title:'{{t("Arguments", { ns: "'.concat(u,'" })}}'),description:'{{t("The arguments that will be used in script with same name.", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"ArrayItems",default:[],items:{type:"object","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'},"x-validator":function(e,t,n){var r=RegExp("^[\\p{L}$_][\\p{L}\\p{N}$_]*$","u"),o=n.form.getValuesIn().arguments.filter(function(t){return t.name===e});return r.test(e)?!(o.length>1)||a("Argument name duplicated"):a("Argument name is invalid")}},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{changeOnSelect:!0,useTypedConstant:!0,placeholder:'{{t("Value")}}'}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}},properties:{add:{type:"void",title:'{{t("Add argument", { ns: "'.concat(u,'" })}}'),"x-component":"ArrayItems.Addition"}}},content:{type:"string",title:'{{t("Script content", { ns: "'.concat(u,'" })}}'),description:"{{useScriptDescription()}}","x-decorator":"FormItem","x-component":"CodeEditor",default:'return "Hello world!";'},timeout:{type:"number",title:'{{t("Timeout", { ns: "'.concat(u,'" })}}'),description:'{{t("The maximum execution time of the script. 0 means no timeout.", { ns: "'.concat(u,'" })}}'),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{min:0,className:"auto-width",addonAfter:'{{t("Milliseconds", { ns: "'.concat(u,'" })}}')},default:0},continue:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Continue when exception thrown", { ns: "'.concat(u,'" })}}'),default:!1}}),s(e,"scope",{useScriptDescription:y}),s(e,"components",{ArrayItems:t.ArrayItems,CodeEditor:b,WorkflowVariableInput:r.WorkflowVariableInput,Space:o.Space}),s(e,"testable",!0),e}return l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),e&&f(l,e),i=[{key:"useVariables",value:function(e,t){var n=e.key,o=e.title,i=t.types;return(void 0===t.fieldNames&&r.defaultFieldNames,i&&!i.some(function(e){return e in r.BaseTypeSets||Object.values(r.BaseTypeSets).some(function(t){return t.has(e)})}))?null:{value:n,label:o}}},{key:"useInitializers",value:function(e){var t,n;return{name:null!=(t=e.title)?t:"#".concat(e.id),type:"item",title:null!=(n=e.title)?n:"#".concat(e.id),Component:r.ValueBlock.Initializer,node:e,resultTitle:a("Script result")}}},{key:"getCreateModelMenuItem",value:function(e){var t,n,r=e.node;return{key:null!=(t=r.title)?t:"#".concat(r.id),label:null!=(n=r.title)?n:"#".concat(r.id),useModel:"NodeValueModel",createModelOptions:{use:"NodeValueModel",stepParams:{valueSettings:{init:{dataSource:"{{$jobsMapByNodeKey.".concat(r.key,"}}"),defaultValue:a("Script result")}},cardSettings:{titleDescription:{title:'{{t("JavaScript", { ns: "'.concat(u,'" })}}')}}}}}}}],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)}}(l.prototype,i),l}(r.Instruction);function v(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function w(e,t,n){return(w=k()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&j(o,n.prototype),o}).apply(null,arguments)}function x(e){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function j(e,t){return(j=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=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 w(e,arguments,x(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),j(n,e)})(e)}function k(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(k=function(){return!!e})()}var _=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=x(e),function(e,t){var n;if(t&&("object"==((n=t)&&"undefined"!=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,k()?Reflect.construct(e,t||[],x(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&j(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,i,c={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){var a=[i,u];if(n)throw TypeError("Generator is already executing.");for(;c;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return c.label++,{value:a[1],done:!1};case 5:c.label++,r=a[1],a=[0];continue;case 7:a=c.ops.pop(),c.trys.pop();continue;default:if(!(o=(o=c.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){c=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){c.label=a[1];break}if(6===a[0]&&c.label<o[1]){c.label=o[1],o=a;break}if(o&&c.label<o[2]){c.label=o[2],c.ops.push(a);break}o[2]&&c.ops.pop(),c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return t.app.pm.get("workflow").registerInstruction("script",m),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function c(e){v(i,r,o,c,u,"next",e)}function u(e){v(i,r,o,c,u,"throw",e)}c(void 0)})})()}}],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}(O(e.Plugin)),S=_}(),g}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -13,11 +13,11 @@ module.exports = {
|
|
|
13
13
|
"antd-style": "3.7.1",
|
|
14
14
|
"@formily/antd-v5": "1.2.3",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
|
-
"@nocobase/client": "2.1.0-beta.
|
|
17
|
-
"@nocobase/plugin-workflow": "2.1.0-beta.
|
|
16
|
+
"@nocobase/client": "2.1.0-beta.15",
|
|
17
|
+
"@nocobase/plugin-workflow": "2.1.0-beta.15",
|
|
18
18
|
"antd": "5.24.2",
|
|
19
|
-
"@nocobase/flow-engine": "2.1.0-beta.
|
|
19
|
+
"@nocobase/flow-engine": "2.1.0-beta.15",
|
|
20
20
|
"react-i18next": "11.18.6",
|
|
21
21
|
"winston": "3.13.0",
|
|
22
|
-
"@nocobase/server": "2.1.0-beta.
|
|
22
|
+
"@nocobase/server": "2.1.0-beta.15"
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"isolated-vm","version":"5.0.4","description":"Access to multiple isolates","main":"isolated-vm.js","types":"isolated-vm.d.ts","engines":{"node":">=18.0.0"},"scripts":{"install":"prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)","rebuild":"node-gyp rebuild --release -j max","lint":"find src -name '*.cc' | xargs -n1 clang-tidy","test":"node test.js"},"dependencies":{"prebuild-install":"^7.1.2"},"devDependencies":{"isolated-vm":".","prebuild":"^13.0.1"},"binary":{"module_path":"out"},"repository":{"type":"git","url":"git+https://github.com/laverdet/isolated-vm.git"},"author":"https://github.com/laverdet/","license":"ISC","gypfile":true,"bugs":{"url":"https://github.com/laverdet/isolated-vm/issues"},"homepage":"https://github.com/laverdet/isolated-vm#readme","_lastModified":"2026-04-
|
|
1
|
+
{"name":"isolated-vm","version":"5.0.4","description":"Access to multiple isolates","main":"isolated-vm.js","types":"isolated-vm.d.ts","engines":{"node":">=18.0.0"},"scripts":{"install":"prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)","rebuild":"node-gyp rebuild --release -j max","lint":"find src -name '*.cc' | xargs -n1 clang-tidy","test":"node test.js"},"dependencies":{"prebuild-install":"^7.1.2"},"devDependencies":{"isolated-vm":".","prebuild":"^13.0.1"},"binary":{"module_path":"out"},"repository":{"type":"git","url":"git+https://github.com/laverdet/isolated-vm.git"},"author":"https://github.com/laverdet/","license":"ISC","gypfile":true,"bugs":{"url":"https://github.com/laverdet/isolated-vm/issues"},"homepage":"https://github.com/laverdet/isolated-vm#readme","_lastModified":"2026-04-24T08:11:49.689Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-04-
|
|
1
|
+
{"name":"winston-transport","description":"Base stream implementations for winston@3 and up.","version":"4.7.0","main":"index.js","browser":"dist/index.js","scripts":{"lint":"eslint test/*.js index.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist","pretest":"npm run lint && npm run build","test":"nyc mocha test/*.test.js","report":"nyc report --reporter=lcov","build":"rimraf dist && babel *.js -d ./dist","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git@github.com:winstonjs/winston-transport.git"},"keywords":["winston","transport","winston3"],"author":"Charlie Robbins <charlie.robbins@gmail.com>","license":"MIT","bugs":{"url":"https://github.com/winstonjs/winston-transport/issues"},"homepage":"https://github.com/winstonjs/winston-transport#readme","dependencies":{"logform":"^2.3.2","readable-stream":"^3.6.0","triple-beam":"^1.3.0"},"devDependencies":{"@types/node":"^20.8.6","abstract-winston-transport":">=0.5.1","assume":"^2.3.0","babel-cli":"^6.26.0","babel-preset-env":"^1.7.0","deep-equal":"^2.0.5","eslint":"^8.8.0","@dabh/eslint-config-populist":"^5.0.0","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^5.0.5","winston-compat":"^0.1.5"},"engines":{"node":">= 12.0.0"},"_lastModified":"2026-04-24T08:11:50.146Z"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-workflow-javascript",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.15",
|
|
4
4
|
"displayName": "Workflow: JavaScript",
|
|
5
5
|
"displayName.zh-CN": "工作流:JavaScript 节点",
|
|
6
6
|
"description": "Execute a piece of JavaScript in an isolated Node.js environment.",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"Workflow"
|
|
38
38
|
],
|
|
39
39
|
"license": "Apache-2.0",
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "dc1aceea6357e6ab149976c2a236fc4b6bee1370"
|
|
41
41
|
}
|
|
File without changes
|
|
File without changes
|