@nocobase/plugin-workflow-sql 2.1.0-alpha.40 → 2.1.0-alpha.46

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,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-sql",["react-i18next","@formily/antd-v5","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/plugin-workflow/client","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-sql"]=t(require("react-i18next"),require("@formily/antd-v5"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-workflow-sql"]=t(e["react-i18next"],e["@formily/antd-v5"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/plugin-workflow/client"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,i,a,c,u,l){return function(){"use strict";var s={375:function(e){e.exports=a},418:function(e){e.exports=t},230:function(e){e.exports=i},342:function(e){e.exports=o},990:function(e){e.exports=c},768:function(e){e.exports=u},59:function(e){e.exports=n},773:function(e){e.exports=l},155:function(e){e.exports=r},953:function(t){t.exports=e}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return s[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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(y=p.g.location+"");var y,b=p.g.document;if(!y&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(y=b.currentScript.src),!y)){var d=b.getElementsByTagName("script");if(d.length)for(var m=d.length-1;m>-1&&(!y||!/^http(s?):/.test(y));)y=d[m--].src}if(!y)throw Error("Automatic publicPath is not supported in this browser");p.p=y.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-sql/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-sql/dist/client/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return P}});var e=p(342),t=p(418),r=p(230),n=p(59),o=p(768),i=p(773),a=p(990),c=p(155),u=p.n(c),l=p(375),s=p(953),f="@nocobase/plugin-workflow-sql";function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function w(){var e,t,r=(e=["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return w=function(){return r},r}function g(e){return(0,r.useForm)().values.unsafeInjection?u().createElement(a.WorkflowVariableRawTextArea,e):u().createElement(n.Input.TextArea,e)}function x(){var e=(0,s.useTranslation)(f).t,t=(0,r.useForm)(),a=t.values;return!a.unsafeInjection||t.disabled?null:u().createElement(n.Alert,{type:"error",showIcon:!0,message:e("Current node is using unsafe injection mode (legacy), which has SQL injection risks."),action:u().createElement(n.Button,{size:"small",type:"primary",onClick:function(){var e,r=a.sql||"",n=(0,o.parse)(r),c=function(e){if(Array.isArray(e))return y(e)}(e=new Set((n.parameters||[]).map(function(e){return e.key}).filter(function(e){return e&&"string"==typeof e})))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return y(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u={};c.forEach(function(e,t){(0,i.set)(u,e,":var".concat(t))});var l=c.map(function(e,t){return{name:"var".concat(t),value:"{{".concat(e,"}}")}}),s=n(u);t.setValues({sql:s,variables:l,unsafeInjection:!1})}},e("Migrate to safe mode")),style:{marginBottom:16}})}var S=function(r){var o;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function i(){var r,o,c;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return o=i,c=arguments,o=d(o),b(r=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(o,c||[],d(this).constructor):o.apply(this,c)),"title",'{{t("SQL action", { ns: "'.concat(f,'" })}}')),b(r,"type","sql"),b(r,"group","collection"),b(r,"description",'{{t("Execute a SQL statement in database.", { ns: "'.concat(f,'" })}}')),b(r,"icon",u().createElement(l.ConsoleSqlOutlined,{style:{}})),b(r,"fieldset",{dataSource:{type:"string",required:!0,title:'{{t("Data source")}}',description:'{{t("Select a data source to execute SQL.", { ns: "'.concat(f,'" })}}'),"x-decorator":"FormItem","x-component":"DataSourceSelect","x-component-props":{className:"auto-width",filter:function(t){return t.options.isDBInstance||t.key===e.DEFAULT_DATA_SOURCE_KEY}},default:"main"},unsafeInjection:{type:"void","x-component":"UnsafeInjectionWarning"},sql:{type:"string",required:!0,title:"SQL",description:"{{sqlDescription()}}","x-decorator":"FormItem","x-component":"SQLTextArea","x-component-props":{rows:20,className:(0,e.css)(w())}},variables:{type:"array",title:'{{t("Parameters", { ns: "'.concat(f,'" })}}'),description:'{{t("SQL parameters. Use :name as placeholders in SQL and provide values here.", { ns: "'.concat(f,'" })}}'),"x-decorator":"FormItem","x-component":"ArrayItems","x-reactions":[{dependencies:["unsafeInjection"],fulfill:{state:{visible:"{{!$deps[0]}}"}}}],items:{type:"object",properties:{space1:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name", { ns: "'.concat(f,'" })}}')},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{rows:1,placeholder:'{{t("Value", { ns: "'.concat(f,'" })}}')},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void","x-component":"ArrayItems.Addition",title:'{{t("Add parameter", { ns: "'.concat(f,'" })}}')}}},withMeta:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Include meta information of this query in result", { ns: "'.concat(f,'" })}}')}}),b(r,"scope",{sqlDescription:function(){return u().createElement(s.Trans,{ns:f},"SQL query result could be used through ",u().createElement("a",{href:"https://docs-cn.nocobase.com/handbook/workflow-json-query",target:"_blank",rel:"noreferrer"},"JSON query node"),".")}}),b(r,"components",{SQLTextArea:g,UnsafeInjectionWarning:x,WorkflowVariableInput:a.WorkflowVariableInput,ArrayItems:t.ArrayItems,Space:n.Space}),b(r,"testable",!0),r}return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),r&&m(i,r),o=[{key:"useVariables",value:function(e,t){var r,n=e.key,o=e.title,i=(t.types,t.fieldNames),c=void 0===i?a.defaultFieldNames:i;return b(r={},c.value,n),b(r,c.label,o),r}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,o),i}(a.Instruction);function j(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}function q(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){j(i,n,o,a,c,"next",e)}function c(e){j(i,n,o,a,c,"throw",e)}a(void 0)})}}function O(e,t,r){return(O=A()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&k(o,r.prototype),o}).apply(null,arguments)}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return O(e,arguments,_(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),k(r,e)})(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function E(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var l=[c,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=_(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,A()?Reflect.construct(e,t||[],_(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&k(r,e),t=[{key:"afterAdd",value:function(){return q(function(){return E(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return q(function(){return E(this,function(e){return[2]})})()}},{key:"load",value:function(){return q(function(){return E(this,function(e){return this.app.pm.get("workflow").registerInstruction("sql",S),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(I(e.Plugin))}(),v}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/antd-v5"),require("antd"),require("react"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-workflow-sql",["react-i18next","@formily/antd-v5","antd","react","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/plugin-workflow/client","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-workflow-sql"]=t(require("react-i18next"),require("@formily/antd-v5"),require("antd"),require("react"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/plugin-workflow/client"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-workflow-sql"]=t(e["react-i18next"],e["@formily/antd-v5"],e.antd,e.react,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/plugin-workflow/client"],e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,r,n,o,i,a,c,u,l){return function(){"use strict";var s={375:function(e){e.exports=a},418:function(e){e.exports=t},230:function(e){e.exports=i},342:function(e){e.exports=o},990:function(e){e.exports=c},768:function(e){e.exports=u},59:function(e){e.exports=r},773:function(e){e.exports=l},155:function(e){e.exports=n},953:function(t){t.exports=e}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var r=f[e]={exports:{}};return s[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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(y=p.g.location+"");var y,b=p.g.document;if(!y&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(y=b.currentScript.src),!y)){var d=b.getElementsByTagName("script");if(d.length)for(var m=d.length-1;m>-1&&(!y||!/^http(s?):/.test(y));)y=d[m--].src}if(!y)throw Error("Automatic publicPath is not supported in this browser");p.p=y.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-workflow-sql/dist/client/")}if(!e){var n=window.__nocobase_modern_client_prefix__||"v",o="/"+(n=String(n).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",a=i.indexOf(o);e=a>=0?i.slice(0,a+1):"/"}e&&(e=e.replace(RegExp("/"+n+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-workflow-sql/dist/client/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return P}});var e=p(342),t=p(418),r=p(230),n=p(59),o=p(768),i=p(773),a=p(990),c=p(155),u=p.n(c),l=p(375),s=p(953),f="@nocobase/plugin-workflow-sql";function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function b(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function w(){var e,t,r=(e=["\n font-size: 80%;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return w=function(){return r},r}function g(e){return(0,r.useForm)().values.unsafeInjection?u().createElement(a.WorkflowVariableRawTextArea,e):u().createElement(n.Input.TextArea,e)}function x(){var e=(0,s.useTranslation)(f).t,t=(0,r.useForm)(),a=t.values;return!a.unsafeInjection||t.disabled?null:u().createElement(n.Alert,{type:"error",showIcon:!0,message:e("Current node is using unsafe injection mode (legacy), which has SQL injection risks."),action:u().createElement(n.Button,{size:"small",type:"primary",onClick:function(){var e,r=a.sql||"",n=(0,o.parse)(r),c=function(e){if(Array.isArray(e))return y(e)}(e=new Set((n.parameters||[]).map(function(e){return e.key}).filter(function(e){return e&&"string"==typeof e})))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return y(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return y(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u={};c.forEach(function(e,t){(0,i.set)(u,e,":var".concat(t))});var l=c.map(function(e,t){return{name:"var".concat(t),value:"{{".concat(e,"}}")}}),s=n(u);t.setValues({sql:s,variables:l,unsafeInjection:!1})}},e("Migrate to safe mode")),style:{marginBottom:16}})}var S=function(r){var o;if("function"!=typeof r&&null!==r)throw TypeError("Super expression must either be null or a function");function i(){var r,o,c;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return o=i,c=arguments,o=d(o),b(r=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,h()?Reflect.construct(o,c||[],d(this).constructor):o.apply(this,c)),"title",'{{t("SQL action", { ns: "'.concat(f,'" })}}')),b(r,"type","sql"),b(r,"group","collection"),b(r,"description",'{{t("Execute a SQL statement in database.", { ns: "'.concat(f,'" })}}')),b(r,"icon",u().createElement(l.ConsoleSqlOutlined,{style:{}})),b(r,"fieldset",{dataSource:{type:"string",required:!0,title:'{{t("Data source")}}',description:'{{t("Select a data source to execute SQL.", { ns: "'.concat(f,'" })}}'),"x-decorator":"FormItem","x-component":"DataSourceSelect","x-component-props":{className:"auto-width",filter:function(t){return t.options.isDBInstance||t.key===e.DEFAULT_DATA_SOURCE_KEY}},default:"main"},unsafeInjection:{type:"void","x-component":"UnsafeInjectionWarning"},sql:{type:"string",required:!0,title:"SQL",description:"{{sqlDescription()}}","x-decorator":"FormItem","x-component":"SQLTextArea","x-component-props":{rows:20,className:(0,e.css)(w())}},variables:{type:"array",title:'{{t("Parameters", { ns: "'.concat(f,'" })}}'),description:'{{t("SQL parameters. Use :name as placeholders in SQL and provide values here.", { ns: "'.concat(f,'" })}}'),"x-decorator":"FormItem","x-component":"ArrayItems","x-reactions":[{dependencies:["unsafeInjection"],fulfill:{state:{visible:"{{!$deps[0]}}"}}}],items:{type:"object",properties:{space1:{type:"void","x-component":"Space",properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name", { ns: "'.concat(f,'" })}}')},required:!0},value:{type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{rows:1,placeholder:'{{t("Value", { ns: "'.concat(f,'" })}}')},required:!0},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void","x-component":"ArrayItems.Addition",title:'{{t("Add parameter", { ns: "'.concat(f,'" })}}')}}},withMeta:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Include meta information of this query in result", { ns: "'.concat(f,'" })}}')}}),b(r,"scope",{sqlDescription:function(){return u().createElement(s.Trans,{ns:f},"SQL query result could be used through ",u().createElement("a",{href:"https://docs-cn.nocobase.com/handbook/workflow-json-query",target:"_blank",rel:"noreferrer"},"JSON query node"),".")}}),b(r,"components",{SQLTextArea:g,UnsafeInjectionWarning:x,WorkflowVariableInput:a.WorkflowVariableInput,ArrayItems:t.ArrayItems,Space:n.Space}),b(r,"testable",!0),r}return i.prototype=Object.create(r&&r.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),r&&m(i,r),o=[{key:"useVariables",value:function(e,t){var r,n=e.key,o=e.title,i=(t.types,t.fieldNames),c=void 0===i?a.defaultFieldNames:i;return b(r={},c.value,n),b(r,c.label,o),r}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(i.prototype,o),i}(a.Instruction);function j(e,t,r,n,o,i,a){try{var c=e[i](a),u=c.value}catch(e){r(e);return}c.done?t(u):Promise.resolve(u).then(n,o)}function _(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){j(i,n,o,a,c,"next",e)}function c(e){j(i,n,o,a,c,"throw",e)}a(void 0)})}}function q(e,t,r){return(q=A()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&k(o,r.prototype),o}).apply(null,arguments)}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return q(e,arguments,O(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),k(r,e)})(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function E(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(a,"next",{value:u(0)}),c(a,"throw",{value:u(1)}),c(a,"return",{value:u(2)}),"function"==typeof Symbol&&c(a,Symbol.iterator,{value:function(){return this}}),a;function u(c){return function(u){var l=[c,u];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=O(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,A()?Reflect.construct(e,t||[],O(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&k(r,e),t=[{key:"afterAdd",value:function(){return _(function(){return E(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return _(function(){return E(this,function(e){return[2]})})()}},{key:"load",value:function(){return _(function(){return E(this,function(e){return this.app.pm.get("workflow").registerInstruction("sql",S),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(I(e.Plugin))}(),v}()});
@@ -8,18 +8,18 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-alpha.40",
11
+ "@nocobase/client": "2.1.0-alpha.46",
12
12
  "@formily/antd-v5": "1.2.3",
13
13
  "@formily/react": "2.3.7",
14
14
  "antd": "5.24.2",
15
- "@nocobase/utils": "2.1.0-alpha.40",
15
+ "@nocobase/utils": "2.1.0-alpha.46",
16
16
  "lodash": "4.18.1",
17
- "@nocobase/plugin-workflow": "2.1.0-alpha.40",
17
+ "@nocobase/plugin-workflow": "2.1.0-alpha.46",
18
18
  "react": "18.2.0",
19
19
  "@ant-design/icons": "5.6.1",
20
20
  "react-i18next": "11.18.6",
21
- "@nocobase/server": "2.1.0-alpha.40",
22
- "@nocobase/data-source-manager": "2.1.0-alpha.40",
23
- "@nocobase/plugin-workflow-test": "2.1.0-alpha.40",
24
- "@nocobase/test": "2.1.0-alpha.40"
21
+ "@nocobase/server": "2.1.0-alpha.46",
22
+ "@nocobase/data-source-manager": "2.1.0-alpha.46",
23
+ "@nocobase/plugin-workflow-test": "2.1.0-alpha.46",
24
+ "@nocobase/test": "2.1.0-alpha.46"
25
25
  };
@@ -1 +1 @@
1
- {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-05-21T22:23:24.042Z"}
1
+ {"name":"joi","description":"Object schema validation","version":"17.13.3","repository":"git://github.com/hapijs/joi","main":"lib/index.js","types":"lib/index.d.ts","browser":"dist/joi-browser.min.js","files":["lib/**/*","dist/*"],"keywords":["schema","validation"],"dependencies":{"@hapi/hoek":"^9.3.0","@hapi/topo":"^5.1.0","@sideway/address":"^4.1.5","@sideway/formula":"^3.0.1","@sideway/pinpoint":"^2.0.0"},"devDependencies":{"@hapi/bourne":"2.x.x","@hapi/code":"8.x.x","@hapi/joi-legacy-test":"npm:@hapi/joi@15.x.x","@hapi/lab":"^25.1.3","@types/node":"^14.18.63","typescript":"4.3.x"},"scripts":{"prepublishOnly":"cd browser && npm install && npm run build","test":"lab -t 100 -a @hapi/code -L -Y","test-cov-html":"lab -r html -o coverage.html -a @hapi/code"},"license":"BSD-3-Clause","_lastModified":"2026-06-04T11:31:26.036Z"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "description": "Execute SQL statements in workflow.",
7
7
  "description.ru-RU": "Выполняет SQL-запросы в рамках рабочего процесса.",
8
8
  "description.zh-CN": "可用于在工作流中对数据库执行任意 SQL 语句。",
9
- "version": "2.1.0-alpha.40",
9
+ "version": "2.1.0-alpha.46",
10
10
  "license": "Apache-2.0",
11
11
  "main": "./dist/server/index.js",
12
12
  "homepage": "https://docs.nocobase.com/handbook/workflow-sql",
@@ -25,7 +25,7 @@
25
25
  "@nocobase/server": "2.x",
26
26
  "@nocobase/test": "2.x"
27
27
  },
28
- "gitHead": "e73f99dd0abefe847f2e50ff0fea1f41a82fd048",
28
+ "gitHead": "42b269944cdd1908d7a848c0af4936fe94c03bb7",
29
29
  "keywords": [
30
30
  "Workflow"
31
31
  ]