@nocobase/plugin-environment-variables 2.1.0-beta.9 → 2.2.0-alpha.1
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/client-v2.d.ts +2 -0
- package/client-v2.js +1 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/500.b1becd4d3744e64d.js +10 -0
- package/dist/client-v2/components/EnvVariableFilterItem.d.ts +25 -0
- package/dist/client-v2/index.d.ts +9 -0
- package/dist/client-v2/index.js +10 -0
- package/dist/client-v2/locale.d.ts +10 -0
- package/dist/client-v2/pages/EnvironmentPage.d.ts +11 -0
- package/dist/client-v2/plugin.d.ts +14 -0
- package/dist/client-v2/registerEnvProperty.d.ts +48 -0
- package/dist/externalVersion.js +9 -4
- package/dist/server/collections/environmentVariables.js +1 -0
- package/package.json +3 -2
package/client-v2.d.ts
ADDED
package/client-v2.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/client-v2/index.js');
|
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("@formily/core"),require("@nocobase/client"),require("react-router-dom"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):"function"==typeof define&&define.amd?define("@nocobase/plugin-environment-variables",["@formily/core","@nocobase/client","react-router-dom","@formily/antd-v5","react","@nocobase/flow-engine","@formily/react","@ant-design/icons","antd","react-i18next"],t):"object"==typeof exports?exports["@nocobase/plugin-environment-variables"]=t(require("@formily/core"),require("@nocobase/client"),require("react-router-dom"),require("@formily/antd-v5"),require("react"),require("@nocobase/flow-engine"),require("@formily/react"),require("@ant-design/icons"),require("antd"),require("react-i18next")):e["@nocobase/plugin-environment-variables"]=t(e["@formily/core"],e["@nocobase/client"],e["react-router-dom"],e["@formily/antd-v5"],e.react,e["@nocobase/flow-engine"],e["@formily/react"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,r,o,a,l,i,u,c){return function(){"use strict";var s={482:function(e){e.exports=i},632:function(e){e.exports=r},563:function(t){t.exports=e},505:function(e){e.exports=l},772:function(e){e.exports=t},667:function(e){e.exports=a},721:function(e){e.exports=u},156:function(e){e.exports=o},238:function(e){e.exports=c},128:function(e){e.exports=n}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return s[e](n,n.exports,p),n.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 n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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 m={};return!function(){p.r(m),p.d(m,{default:function(){return K},PluginEnvironmentVariablesClient:function(){return L}});var e=p(772),t=p(667),n=p(156),r=p.n(n),o=(0,n.createContext)({}),a=function(t){var n=(0,e.useRequest)({url:"environmentVariables?paginate=false"});return r().createElement(o.Provider,{value:{variablesRequest:n}},t.children)},l=(0,t.observer)(function(t){return(0,e.useIsLoggedIn)()?r().createElement(a,t):r().createElement(r().Fragment,null,t.children)},{displayName:"EnvironmentVariablesAndSecretsProvider"}),i=p(482),u=p(632),c=p(563),s=p(505),f=p(128),d=p(721),b=p(238),y=/^[A-Za-z][A-Za-z0-9_]*$/,v=JSON.parse('{"u2":"@nocobase/plugin-environment-variables"}');function h(){var t=(0,e.useApp)();return function(e){return t.i18n.t(e,{ns:[v.u2,"client"]})}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function x(e){if(Array.isArray(e))return e}function w(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){w(a,r,o,l,i,"next",e)}function i(e){w(a,r,o,l,i,"throw",e)}l(void 0)})}}function S(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(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}function k(e,t){return x(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||A(e,t)||S()}function A(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function q(e,t){var n,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[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){var u=[a,i];if(n)throw TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,r=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(0,c.registerValidateRules)({env_name_rule:function(e){return e?y.test(e)?"":"Only letters, numbers and underscores are allowed, and it must start with a letter.":""}});var j=(0,s.createSchemaField)({components:{FormItem:u.FormItem,Input:u.Input,Checkbox:u.Checkbox,Radio:u.Radio}}),I={type:"object",properties:{variables:{type:"string",title:'{{ t("Plain text") }}',"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:10,maxRows:20},placeholder:"FOO=aaa\nBAR=bbb\n "}},secret:{type:"string",title:'{{ t("Encrypted") }}',"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:10,maxRows:20},placeholder:"FOO=aaa\nBAR=bbb\n "}}}},C={type:"object",properties:{name:{type:"string",title:'{{ t("Name") }}',required:!0,"x-validator":{env_name_rule:!0},"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}"},type:{type:"string",title:'{{ t("Type") }}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",default:"default",enum:[{value:"default",label:'{{t("Plain text")}}'},{value:"secret",label:'{{t("Encrypted")}}'}]},value:{type:"string",title:'{{ t("Value") }}',required:!0,"x-decorator":"FormItem","x-component":"Input.TextArea"}}};function F(t){var n,o=t.request,a=t.setSelectRowKeys,l=d.App.useApp().modal,i=h(),c=(0,e.useAPIClient)(),s=o||{},f=s.data,p=s.loading,m=s.refresh,b=(0,e.useGlobalTheme)().theme,y={default:{label:i("Plain text"),color:"green"},secret:{label:i("Encrypted"),color:"red"}},v=c.resource("environmentVariables"),g=function(e){l.confirm({title:i("Delete variable"),content:i("Are you sure you want to delete it?"),onOk:function(){return E(function(){return q(this,function(t){switch(t.label){case 0:return[4,v.destroy({filterByTk:e.name})];case 1:return t.sent(),m(),[2]}})})()}})},x=(n=E(function(t){var n;return q(this,function(a){return(n=(0,e.FormDrawer)({title:i("Edit")},"edit",function(){var a;return r().createElement(u.FormLayout,{layout:"vertical"},r().createElement(e.SchemaComponentOptions,{scope:{createOnly:!1,t:i}},r().createElement(j,{schema:C})),r().createElement(e.FormDrawer.Footer,null,r().createElement(u.FormButtonGroup,{align:"right"},r().createElement(u.Reset,{onClick:function(){n.close()}},i("Cancel")),r().createElement(u.Submit,{onSubmit:(a=E(function(e){return q(this,function(n){switch(n.label){case 0:return[4,c.request({url:"environmentVariables:update?filterByTk=".concat(t.name),method:"post",data:O({},e)})];case 1:return n.sent(),o.refresh(),[2]}})}),function(e){return a.apply(this,arguments)})},i("Submit")))))},b)).open({initialValues:O({},t)}),[2]})}),function(e){return n.apply(this,arguments)});return r().createElement("div",null,r().createElement(d.Table,{loading:p,size:"middle",rowKey:"name",dataSource:null==f?void 0:f.data,pagination:!1,columns:[{title:i("Name"),dataIndex:"name",ellipsis:!0},{title:i("Type"),dataIndex:"type",render:function(e){return r().createElement(d.Tag,{color:y[e].color},y[e].label)}},{title:i("Value"),ellipsis:!0,render:function(e){return r().createElement("div",null,"default"===e.type?e.value:"******")}},{title:i("Actions"),width:200,render:function(e){return r().createElement(d.Space,null,r().createElement("a",{onClick:function(){return x(e)}},i("Edit")),r().createElement("a",{onClick:function(){return g(e)}},i("Delete")))}}],rowSelection:{type:"checkbox",onChange:function(e,t){a(e)}}}))}function P(){var t,a,l,c=(0,e.useAPIClient)(),p=h(),m=d.App.useApp().modal,y=(0,n.useContext)(o).variablesRequest,v=k((0,n.useState)([]),2),g=v[0],w=v[1],P=c.resource("environmentVariables"),R=(0,e.useGlobalTheme)().theme,T=(0,f.useLocation)();(0,n.useEffect)(function(){var e=y.run,t=y.params;(null==t?void 0:t.length)&&e()},[T.key]);var V=(t=E(function(e){var t;return q(this,function(n){switch(n.label){case 0:return t=Object.entries(e).map(function(e){var t,n=k(e,2),r=n[0];return(t=n[1],t.trim().split("\n").map(function(e){var t,n=x(t=e.split("="))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||A(t)||S(),o=n[0],a=n.slice(1);return o&&{name:o.trim(),value:a.join("=").trim(),type:"secret"===r?"secret":"default"}})).filter(Boolean)}),[4,c.request({url:"environmentVariables:create",method:"post",data:t.flat()})];case 1:return n.sent(),[2]}})}),function(e){return t.apply(this,arguments)}),$=[{name:"name",title:p("Name"),operators:[{label:'{{t("contains")}}',value:"$includes",selected:!0},{label:'{{t("does not contain")}}',value:"$notIncludes"},{label:'{{t("is")}}',value:"$eq"},{label:'{{t("is not")}}',value:"$ne"}],schema:{type:"string",title:p("Name"),"x-component":"Input"}},{name:"type",title:p("Type"),operators:[{label:'{{t("is")}}',value:"$match",selected:!0,schema:{"x-component":"Select","x-component-props":{mode:"tags"}}},{label:'{{t("is not")}}',value:"$notMatch",schema:{"x-component":"Select","x-component-props":{mode:"tags"}}}],schema:{type:"string",title:p("Type"),"x-component":"Select",enum:[{value:"default",label:'{{t("Plain text")}}'},{value:"secret",label:'{{t("Encrypted")}}'}]}},{name:"value",title:p("Value"),operators:[{label:'{{t("contains")}}',value:"$includes",selected:!0},{label:'{{t("does not contain")}}',value:"$notIncludes"},{label:'{{t("is")}}',value:"$eq"},{label:'{{t("is not")}}',value:"$ne"}],schema:{type:"string",title:p("Value"),"x-component":"Input"}}];return r().createElement("div",null,(null==y||null==(l=y.data)||null==(a=l.meta)?void 0:a.updated)&&r().createElement(d.Alert,{type:"warning",style:{marginBottom:"1.2em",alignItems:"center"},description:r().createElement("div",null,p("Variables and secrets have been updated. A restart is required for the changes to take effect.")," "),action:r().createElement(d.Button,{size:"middle",type:"primary",onClick:E(function(){return q(this,function(e){switch(e.label){case 0:return[4,c.resource("app").refresh()];case 1:return e.sent(),[2]}})})},p("Restart now"))}),r().createElement(d.Card,null,r().createElement("div",{style:{float:"left"}},r().createElement(e.SchemaComponent,{schema:{name:"filter",type:"object",title:'{{ t("Filter") }}',default:{$and:[{name:{$includes:""}}]},"x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined"},enum:$,"x-use-component-props":function(){var t,n=(0,s.useField)(),r=y.run,o=(0,b.useTranslation)().t;return{options:$,onSubmit:(t=E(function(t){var a,l;return q(this,function(i){return r(t),n.setValue(t),(null==(l=(null==(a=(0,e.removeNullCondition)(null==t?void 0:t.filter))?void 0:a.$and)||(null==a?void 0:a.$or))?void 0:l.length)?n.title=o("{{count}} filter items",{count:(null==l?void 0:l.length)||0}):n.title=o("Filter"),[2]})}),function(e){return t.apply(this,arguments)}),onReset:function(e){n.setValue(e)}}}},scope:{t:p}})),r().createElement(d.Flex,{justify:"end",style:{marginBottom:16}},r().createElement(d.Space,null,r().createElement(d.Button,{icon:r().createElement(i.ReloadOutlined,null),onClick:function(){var e;null==y||null==(e=y.refresh)||e.call(y)}},p("Refresh")),r().createElement(d.Button,{icon:r().createElement(i.DeleteOutlined,null),onClick:function(){g.length>0&&m.confirm({title:p("Delete variable"),content:p("Are you sure you want to delete it?"),onOk:function(){return E(function(){var e;return q(this,function(t){switch(t.label){case 0:return[4,P.destroy({filterByTk:g})];case 1:return t.sent(),null==y||null==(e=y.refresh)||e.call(y),[2]}})})()}})}},p("Delete")),r().createElement(d.Dropdown,{menu:{onClick:function(t){var n=(0,e.FormDrawer)({variable:p("Add variable"),bulk:p("Bulk import")}[t.key],"add-new",function(){var o;return r().createElement(u.FormLayout,{layout:"vertical"},r().createElement(e.SchemaComponentOptions,{scope:{createOnly:!0,t:p}},r().createElement(j,{schema:"bulk"===t.key?I:C})),r().createElement(e.FormDrawer.Footer,null,r().createElement(u.FormButtonGroup,{align:"right"},r().createElement(u.Reset,{onClick:function(){n.close()}},p("Cancel")),r().createElement(u.Submit,{onSubmit:(o=E(function(e){return q(this,function(n){switch(n.label){case 0:if("bulk"!==t.key)return[3,2];return[4,V(e)];case 1:return n.sent(),y.refresh(),[3,4];case 2:return[4,c.request({url:"environmentVariables:create",method:"post",data:O({},e)})];case 3:n.sent(),y.refresh(),n.label=4;case 4:return[2]}})}),function(e){return o.apply(this,arguments)})},p("Submit")))))},R);n.open({initialValues:{}}).then(console.log).catch(console.log)},items:[{key:"variable",label:p("Add variable")},{type:"divider"},{key:"bulk",label:p("Bulk import")}]}},r().createElement(d.Button,{type:"primary",icon:r().createElement(i.PlusOutlined,null)},p("Add new")," ",r().createElement(i.DownOutlined,null))))),r().createElement(F,{request:y,setSelectRowKeys:w})))}function R(){return r().createElement(P,null)}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var V=function(){var e,t=h(),r=(0,n.useContext)(o).variablesRequest||{},a=r.data;return!r.loading&&(null==a||null==(e=a.data)?void 0:e.length)?{name:"$env",title:t("Variables and secrets"),value:"$env",label:t("Variables and secrets"),children:null==a?void 0:a.data.map(function(e){return{title:e.name,name:e.name,value:e.name,label:e.name,type:e.type}}).filter(Boolean)}:null},$=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=t.map(function(e){var t,n,r;return t={},n=e.name,r=e.value,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t});return{name:"$env",ctx:(e=Object).assign.apply(e,[{}].concat(function(e){if(Array.isArray(e))return T(e)}(n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return T(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return T(e,t)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))}},B=function(){var e,t=(0,n.useContext)(o).variablesRequest,r=t.data,a=t.loading,l=$(null==r?void 0:r.data);return!a&&(null==r||null==(e=r.data)?void 0:e.length)?l:null};function _(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function D(e,t,n){return(D=z()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&G(o,n.prototype),o}).apply(null,arguments)}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function G(e,t){return(G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function N(e){var t="function"==typeof Map?new Map:void 0;return(N=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 D(e,arguments,M(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),G(n,e)})(e)}function z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(z=function(){return!!e})()}var L=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=M(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,z()?Reflect.construct(e,t||[],M(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&G(n,e),t=[{key:"load",value:function(){var e,t=this;return(e=function(){return function(e,t){var n,r,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[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){var u=[a,i];if(n)throw TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return l.label++,{value:u[1],done:!1};case 5:l.label++,r=u[1],u=[0];continue;case 7:u=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){l=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){l.label=u[1];break}if(6===u[0]&&l.label<o[1]){l.label=o[1],o=u;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(u);break}o[2]&&l.ops.pop(),l.trys.pop();continue}u=t.call(e,l)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(e){return t.app.pluginSettingsManager.add("environment",{title:t.t("Variables and secrets"),icon:"TableOutlined",Component:R}),t.app.addGlobalVar("$env",V,B),t.app.use(l),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){_(a,r,o,l,i,"next",e)}function i(e){_(a,r,o,l,i,"throw",e)}l(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}(N(e.Plugin)),K=L}(),m}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/core"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-environment-variables",["react-i18next","react-router-dom","@formily/antd-v5","@formily/core","react","antd","@nocobase/client","@formily/react","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-environment-variables"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/core"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-environment-variables"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/core"],e.react,e.antd,e["@nocobase/client"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,a,l,i,u,c){return function(){"use strict";var s={375:function(e){e.exports=u},418:function(e){e.exports=n},452:function(e){e.exports=r},230:function(e){e.exports=i},342:function(e){e.exports=l},694:function(e){e.exports=c},59:function(e){e.exports=a},155:function(e){e.exports=o},953:function(t){t.exports=e},442:function(e){e.exports=t}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return s[e](n,n.exports,p),n.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 n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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&&(m=p.g.location+"");var m,d=p.g.document;if(!m&&d&&(d.currentScript&&"SCRIPT"===d.currentScript.tagName.toUpperCase()&&(m=d.currentScript.src),!m)){var b=d.getElementsByTagName("script");if(b.length)for(var y=b.length-1;y>-1&&(!m||!/^http(s?):/.test(m));)m=b[y--].src}if(!m)throw Error("Automatic publicPath is not supported in this browser");p.p=m.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 n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-environment-variables/dist/client/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",l=a.indexOf(o);e=l>=0?a.slice(0,l+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-environment-variables/dist/client/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return H},PluginEnvironmentVariablesClient:function(){return J}});var e=p(342),t=p(694),n=p(155),r=p.n(n),o=(0,n.createContext)({}),a=function(t){var n=(0,e.useRequest)({url:"environmentVariables?paginate=false"});return r().createElement(o.Provider,{value:{variablesRequest:n}},t.children)},l=(0,t.observer)(function(t){return(0,e.useIsLoggedIn)()?r().createElement(a,t):r().createElement(r().Fragment,null,t.children)},{displayName:"EnvironmentVariablesAndSecretsProvider"}),i=p(375),u=p(418),c=p(452),s=p(230),f=p(442),m=p(59),d=p(953),b=/^[A-Za-z][A-Za-z0-9_]*$/,y=JSON.parse('{"UU":"@nocobase/plugin-environment-variables"}');function h(){var t=(0,e.useApp)();return function(e){return t.i18n.t(e,{ns:[y.UU,"client"]})}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e){if(Array.isArray(e))return e}function x(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function E(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){x(a,r,o,l,i,"next",e)}function i(e){x(a,r,o,l,i,"throw",e)}l(void 0)})}}function S(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(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}function j(e,t){return w(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,i=!1;try{for(o=o.call(e);!(l=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);l=!0);}catch(e){i=!0,r=e}finally{try{l||null==o.return||o.return()}finally{if(i)throw r}}return a}}(e,t)||k(e,t)||S()}function k(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function A(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(0,c.registerValidateRules)({env_name_rule:function(e){return e?b.test(e)?"":"Only letters, numbers and underscores are allowed, and it must start with a letter.":""}});var q=(0,s.createSchemaField)({components:{FormItem:u.FormItem,Input:u.Input,Checkbox:u.Checkbox,Radio:u.Radio}}),I={type:"object",properties:{variables:{type:"string",title:'{{ t("Plain text") }}',"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:10,maxRows:20},placeholder:"FOO=aaa\nBAR=bbb\n "}},secret:{type:"string",title:'{{ t("Encrypted") }}',"x-decorator":"FormItem","x-component":"Input.TextArea","x-component-props":{autoSize:{minRows:10,maxRows:20},placeholder:"FOO=aaa\nBAR=bbb\n "}}}},P={type:"object",properties:{name:{type:"string",title:'{{ t("Name") }}',required:!0,"x-validator":{env_name_rule:!0},"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}"},type:{type:"string",title:'{{ t("Type") }}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",default:"default",enum:[{value:"default",label:'{{t("Plain text")}}'},{value:"secret",label:'{{t("Encrypted")}}'}]},value:{type:"string",title:'{{ t("Value") }}',required:!0,"x-decorator":"FormItem","x-component":"Input.TextArea"}}};function _(t){var n=t.request,o=t.setSelectRowKeys,a=m.App.useApp().modal,l=h(),i=(0,e.useAPIClient)(),c=n||{},s=c.data,f=c.loading,p=c.refresh,d=(0,e.useGlobalTheme)().theme,b={default:{label:l("Plain text"),color:"green"},secret:{label:l("Encrypted"),color:"red"}},y=i.resource("environmentVariables"),v=function(e){a.confirm({title:l("Delete variable"),content:l("Are you sure you want to delete it?"),onOk:function(){return E(function(){return A(this,function(t){switch(t.label){case 0:return[4,y.destroy({filterByTk:e.name})];case 1:return t.sent(),p(),[2]}})})()}})};return r().createElement("div",null,r().createElement(m.Table,{loading:f,size:"middle",rowKey:"name",dataSource:null==s?void 0:s.data,pagination:!1,columns:[{title:l("Name"),dataIndex:"name",ellipsis:!0},{title:l("Type"),dataIndex:"type",render:function(e){return r().createElement(m.Tag,{color:b[e].color},b[e].label)}},{title:l("Value"),ellipsis:!0,render:function(e){return r().createElement("div",null,"default"===e.type?e.value:"******")}},{title:l("Actions"),width:200,render:function(t){return r().createElement(m.Space,null,r().createElement("a",{onClick:function(){return E(function(){var o;return A(this,function(a){return(o=(0,e.FormDrawer)({title:l("Edit")},"edit",function(){return r().createElement(u.FormLayout,{layout:"vertical"},r().createElement(e.SchemaComponentOptions,{scope:{createOnly:!1,t:l}},r().createElement(q,{schema:P})),r().createElement(e.FormDrawer.Footer,null,r().createElement(u.FormButtonGroup,{align:"right"},r().createElement(u.Reset,{onClick:function(){o.close()}},l("Cancel")),r().createElement(u.Submit,{onSubmit:function(e){return E(function(){return A(this,function(r){switch(r.label){case 0:return[4,i.request({url:"environmentVariables:update?filterByTk=".concat(t.name),method:"post",data:O({},e)})];case 1:return r.sent(),n.refresh(),[2]}})})()}},l("Submit")))))},d)).open({initialValues:O({},t)}),[2]})})()}},l("Edit")),r().createElement("a",{onClick:function(){return v(t)}},l("Delete")))}}],rowSelection:{type:"checkbox",onChange:function(e,t){o(e)}}}))}function C(){var t,a,l=(0,e.useAPIClient)(),c=h(),p=m.App.useApp().modal,b=(0,n.useContext)(o).variablesRequest,y=j((0,n.useState)([]),2),v=y[0],g=y[1],x=l.resource("environmentVariables"),C=(0,e.useGlobalTheme)().theme,F=(0,f.useLocation)();(0,n.useEffect)(function(){var e=b.run,t=b.params;(null==t?void 0:t.length)&&e()},[F.key]);var T=[{name:"name",title:c("Name"),operators:[{label:'{{t("contains")}}',value:"$includes",selected:!0},{label:'{{t("does not contain")}}',value:"$notIncludes"},{label:'{{t("is")}}',value:"$eq"},{label:'{{t("is not")}}',value:"$ne"}],schema:{type:"string",title:c("Name"),"x-component":"Input"}},{name:"type",title:c("Type"),operators:[{label:'{{t("is")}}',value:"$match",selected:!0,schema:{"x-component":"Select","x-component-props":{mode:"tags"}}},{label:'{{t("is not")}}',value:"$notMatch",schema:{"x-component":"Select","x-component-props":{mode:"tags"}}}],schema:{type:"string",title:c("Type"),"x-component":"Select",enum:[{value:"default",label:'{{t("Plain text")}}'},{value:"secret",label:'{{t("Encrypted")}}'}]}},{name:"value",title:c("Value"),operators:[{label:'{{t("contains")}}',value:"$includes",selected:!0},{label:'{{t("does not contain")}}',value:"$notIncludes"},{label:'{{t("is")}}',value:"$eq"},{label:'{{t("is not")}}',value:"$ne"}],schema:{type:"string",title:c("Value"),"x-component":"Input"}}];return r().createElement("div",null,(null==b||null==(a=b.data)||null==(t=a.meta)?void 0:t.updated)&&r().createElement(m.Alert,{type:"warning",style:{marginBottom:"1.2em",alignItems:"center"},description:r().createElement("div",null,c("Variables and secrets have been updated. A restart is required for the changes to take effect.")," "),action:r().createElement(m.Button,{size:"middle",type:"primary",onClick:function(){return E(function(){return A(this,function(e){switch(e.label){case 0:return[4,l.resource("app").refresh()];case 1:return e.sent(),[2]}})})()}},c("Restart now"))}),r().createElement(m.Card,null,r().createElement("div",{style:{float:"left"}},r().createElement(e.SchemaComponent,{schema:{name:"filter",type:"object",title:'{{ t("Filter") }}',default:{$and:[{name:{$includes:""}}]},"x-component":"Filter.Action","x-component-props":{icon:"FilterOutlined"},enum:T,"x-use-component-props":function(){var t=(0,s.useField)(),n=b.run,r=(0,d.useTranslation)().t;return{options:T,onSubmit:function(o){return E(function(){var a,l;return A(this,function(i){return n(o),t.setValue(o),(null==(l=(null==(a=(0,e.removeNullCondition)(null==o?void 0:o.filter))?void 0:a.$and)||(null==a?void 0:a.$or))?void 0:l.length)?t.title=r("{{count}} filter items",{count:(null==l?void 0:l.length)||0}):t.title=r("Filter"),[2]})})()},onReset:function(e){t.setValue(e)}}}},scope:{t:c}})),r().createElement(m.Flex,{justify:"end",style:{marginBottom:16}},r().createElement(m.Space,null,r().createElement(m.Button,{icon:r().createElement(i.ReloadOutlined,null),onClick:function(){var e;null==b||null==(e=b.refresh)||e.call(b)}},c("Refresh")),r().createElement(m.Button,{icon:r().createElement(i.DeleteOutlined,null),onClick:function(){v.length>0&&p.confirm({title:c("Delete variable"),content:c("Are you sure you want to delete it?"),onOk:function(){return E(function(){var e;return A(this,function(t){switch(t.label){case 0:return[4,x.destroy({filterByTk:v})];case 1:return t.sent(),null==b||null==(e=b.refresh)||e.call(b),[2]}})})()}})}},c("Delete")),r().createElement(m.Dropdown,{menu:{onClick:function(t){var n=(0,e.FormDrawer)({variable:c("Add variable"),bulk:c("Bulk import")}[t.key],"add-new",function(){return r().createElement(u.FormLayout,{layout:"vertical"},r().createElement(e.SchemaComponentOptions,{scope:{createOnly:!0,t:c}},r().createElement(q,{schema:"bulk"===t.key?I:P})),r().createElement(e.FormDrawer.Footer,null,r().createElement(u.FormButtonGroup,{align:"right"},r().createElement(u.Reset,{onClick:function(){n.close()}},c("Cancel")),r().createElement(u.Submit,{onSubmit:function(e){return E(function(){return A(this,function(n){switch(n.label){case 0:if("bulk"!==t.key)return[3,2];return[4,E(function(){var t;return A(this,function(n){switch(n.label){case 0:return t=Object.entries(e).map(function(e){var t,n=j(e,2),r=n[0];return(t=n[1],t.trim().split("\n").map(function(e){var t,n=w(t=e.split("="))||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||k(t)||S(),o=n[0],a=n.slice(1);return o&&{name:o.trim(),value:a.join("=").trim(),type:"secret"===r?"secret":"default"}})).filter(Boolean)}),[4,l.request({url:"environmentVariables:create",method:"post",data:t.flat()})];case 1:return n.sent(),[2]}})})()];case 1:return n.sent(),b.refresh(),[3,4];case 2:return[4,l.request({url:"environmentVariables:create",method:"post",data:O({},e)})];case 3:n.sent(),b.refresh(),n.label=4;case 4:return[2]}})})()}},c("Submit")))))},C);n.open({initialValues:{}}).then(console.log).catch(console.log)},items:[{key:"variable",label:c("Add variable")},{type:"divider"},{key:"bulk",label:c("Bulk import")}]}},r().createElement(m.Button,{type:"primary",icon:r().createElement(i.PlusOutlined,null)},c("Add new")," ",r().createElement(i.DownOutlined,null))))),r().createElement(_,{request:b,setSelectRowKeys:g})))}function F(){return r().createElement(C,null)}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var $=function(){var e,t=h(),r=(0,n.useContext)(o).variablesRequest||{},a=r.data;return!r.loading&&(null==a||null==(e=a.data)?void 0:e.length)?{name:"$env",title:t("Variables and secrets"),value:"$env",label:t("Variables and secrets"),children:null==a?void 0:a.data.map(function(e){return{title:e.name,name:e.name,value:e.name,label:e.name,type:e.type}}).filter(Boolean)}:null},R=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=t.map(function(e){var t,n,r;return t={},n=e.name,r=e.value,n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t});return{name:"$env",ctx:(e=Object).assign.apply(e,[{}].concat(function(e){if(Array.isArray(e))return T(e)}(n)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e){if(e){if("string"==typeof e)return T(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 T(e,void 0)}}(n)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()))}},V=function(){var e,t=(0,n.useContext)(o).variablesRequest||{},r=t.data,a=t.loading,l=R(null==r?void 0:r.data);return!a&&(null==r||null==(e=r.data)?void 0:e.length)?l:null};function B(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function D(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){B(a,r,o,l,i,"next",e)}function i(e){B(a,r,o,l,i,"throw",e)}l(void 0)})}}function N(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function G(e){return D(function(){var t,n,r;return N(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e.request({url:"environmentVariables?paginate=false",skipNotify:!0})];case 1:return[2,Array.isArray(r=null==(n=o.sent())||null==(t=n.data)?void 0:t.data)?r:[]];case 2:return o.sent(),[2,[]];case 3:return[2]}})})()}function M(e,t,n,r,o,a,l){try{var i=e[a](l),u=i.value}catch(e){n(e);return}i.done?t(u):Promise.resolve(u).then(r,o)}function U(e,t,n){return(U=Z()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&L(o,n.prototype),o}).apply(null,arguments)}function z(e){return(z=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function L(e,t){return(L=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function K(e){var t="function"==typeof Map?new Map:void 0;return(K=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 U(e,arguments,z(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),L(n,e)})(e)}function Z(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Z=function(){return!!e})()}var J=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=z(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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,Z()?Reflect.construct(e,t||[],z(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&L(n,e),t=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:u(0)}),i(l,"throw",{value:u(1)}),i(l,"return",{value:u(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function u(i){return function(u){var c=[i,u];if(n)throw TypeError("Generator is already executing.");for(;l&&(l=0,c[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,r=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){a.label=c[1];break}if(6===c[0]&&a.label<o[1]){a.label=o[1],o=c;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(c);break}o[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(t){var n,r,o;return e=this,this.app.pluginSettingsManager.add("environment",{title:this.t("Variables and secrets"),icon:"TableOutlined",Component:F}),this.app.addGlobalVar("$env",$,V),this.app.use(l),n=this.app.flowEngine.context,r=this.app.apiClient,o=function(t){return e.t(t)},n.defineProperty("$env",{get:function(){return D(function(){return N(this,function(e){switch(e.label){case 0:return[4,G(r)];case 1:return[2,Object.fromEntries(e.sent().map(function(e){return[e.name,e.value]}))]}})})()},meta:{type:"object",title:String(o("Variables and secrets")),properties:function(){return D(function(){var e,t,n,o,a,l,i,u;return N(this,function(c){switch(c.label){case 0:return[4,G(r)];case 1:e=c.sent(),t={},n=!0,o=!1,a=void 0;try{for(l=e[Symbol.iterator]();!(n=(i=l.next()).done);n=!0)t[(u=i.value).name]={type:"secret"===u.type?"string":u.type||"string",title:u.name}}catch(e){o=!0,a=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw a}}return[2,t]}})})()}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function l(e){M(a,r,o,l,i,"next",e)}function i(e){M(a,r,o,l,i,"throw",e)}l(void 0)})}).call(this)}}],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}(K(e.Plugin)),H=J}(),v}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_environment_variables_client_v2=self.webpackChunk_nocobase_plugin_environment_variables_client_v2||[]).push([["500"],{527:function(e,t,n){n.r(t),n.d(t,{default:function(){return q}});var r=n(375),a=n(477),l=n(485),u=n(694),o=n(768),i=n(625),c=n(59),s=n(992),m=n(230),f=n(155),d=n.n(f),p=/^[A-Za-z][A-Za-z0-9_]*$/;function v(){var e=(0,u.useFlowEngine)();return function(t,n){return e.context.t(t,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}({ns:["@nocobase/plugin-environment-variables","client"]},n))}}var b=function(e){var t=e.value,n=e.onChange;return d().createElement(c.Input,{style:{minWidth:160},value:null!=t?t:"",onChange:function(e){return n(e.target.value)},placeholder:""})},y=function(e){var t=e.value,n=e.onChange,r=v(),a=(0,f.useMemo)(function(){return[{value:"default",label:r("Plain text")},{value:"secret",label:r("Encrypted")}]},[r]);return d().createElement(c.Select,{mode:"tags",style:{minWidth:200},value:Array.isArray(t)?t:null!=t?[t]:[],onChange:function(e){return n(e)},options:a})},h=function(){var e=v();return(0,f.useMemo)(function(){return[{name:"name",title:e("Name"),operators:[{value:"$includes",label:e("contains")},{value:"$notIncludes",label:e("does not contain")},{value:"$eq",label:e("is")},{value:"$ne",label:e("is not")}],ValueComponent:b},{name:"type",title:e("Type"),operators:[{value:"$match",label:e("is")},{value:"$notMatch",label:e("is not")}],ValueComponent:y},{name:"value",title:e("Value"),operators:[{value:"$includes",label:e("contains")},{value:"$notIncludes",label:e("does not contain")},{value:"$eq",label:e("is")},{value:"$ne",label:e("is not")}],ValueComponent:b}]},[e])},E=(0,u.observer)(function(e){var t,n,r=e.value,a=h(),l=a.find(function(e){return e.name===r.path}),u=null!=(t=null==l?void 0:l.operators)?t:[],o=null!=(n=null==l?void 0:l.ValueComponent)?n:b,i=v(),s=(0,f.useMemo)(function(){return a.map(function(e){return{value:e.name,label:e.title}})},[a]);return d().createElement(c.Space,{style:{flex:1},wrap:!0},d().createElement(c.Select,{style:{minWidth:120},placeholder:i("Select field"),value:r.path||void 0,options:s,onChange:function(e){var t,n,l=a.find(function(t){return t.name===e});r.path=e,r.operator=null!=(t=null==l||null==(n=l.operators[0])?void 0:n.value)?t:"",r.value=""}}),d().createElement(c.Select,{style:{minWidth:120},placeholder:i("Comparison"),value:r.operator||void 0,options:u,onChange:function(e){r.operator=e}}),d().createElement(o,{value:r.value,operator:r.operator,onChange:function(e){r.value=e}}))},{displayName:"EnvVariableFilterItem"});function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e){if(Array.isArray(e))return e}function k(e,t,n,r,a,l,u){try{var o=e[l](u),i=o.value}catch(e){n(e);return}o.done?t(i):Promise.resolve(i).then(r,a)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function u(e){k(l,r,a,u,o,"next",e)}function o(e){k(l,r,a,u,o,"throw",e)}u(void 0)})}}function S(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function O(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function F(e,t){return w(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],u=!0,o=!1;try{for(a=a.call(e);!(u=(n=a.next()).done)&&(l.push(n.value),!t||l.length!==t);u=!0);}catch(e){o=!0,r=e}finally{try{u||null==a.return||a.return()}finally{if(o)throw r}}return l}}(e,t)||x(e,t)||O()}function A(e){return function(e){if(Array.isArray(e))return g(e)}(e)||S(e)||x(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.")}()}function x(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function I(e,t){var n,r,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),o=Object.defineProperty;return o(u,"next",{value:i(0)}),o(u,"throw",{value:i(1)}),o(u,"return",{value:i(2)}),"function"==typeof Symbol&&o(u,Symbol.iterator,{value:function(){return this}}),u;function i(o){return function(i){var c=[o,i];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function j(){var e,t,n=(e=["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n margin-left: -8px;\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return j=function(){return n},n}var V=(0,a.css)(j());function B(e,t){return e.trim().split("\n").map(function(e){var n,r=w(n=e.split("="))||S(n)||x(n)||O(),a=r[0],l=r.slice(1);return(null==a?void 0:a.trim())?{name:a.trim(),value:l.join("=").trim(),type:t}:null}).filter(function(e){return null!=e})}function P(e){var t=e.value,n=e.onSubmit,a=e.onReset,u=v(),o=F((0,f.useState)(!1),2),i=o[0],s=o[1],m=(0,f.useMemo)(function(){return{model:{translate:function(e){return u(e)},dispatchEvent:function(e){"submit"===e?(n(),s(!1)):"reset"===e&&a()}}}},[u,n,a]),p=Array.isArray(t.items)&&t.items.length>0;return d().createElement(c.Popover,{open:i,onOpenChange:s,trigger:"click",placement:"bottomLeft",content:d().createElement("div",{style:{minWidth:480}},d().createElement(l.FilterContent,{value:t,ctx:m,FilterItem:E}))},d().createElement(c.Button,{icon:d().createElement(r.FilterOutlined,null),type:p?"primary":"default"},u("Filter")))}function T(e){var t=e.mode,n=e.initialValues,a=e.onSubmitted,l=e.title,o=v(),i=(0,u.useFlowContext)(),s=(0,u.useFlowView)(),m=F(c.Form.useForm(),1)[0],b=F((0,f.useState)(!1),2),y=b[0],h=b[1],E=(0,f.useCallback)(function(){return C(function(){var e;return I(this,function(r){switch(r.label){case 0:return[4,m.validateFields()];case 1:e=r.sent(),h(!0),r.label=2;case 2:if(r.trys.push([2,,8,9]),"create"!==t)return[3,4];return[4,i.api.request({url:"environmentVariables:create",method:"post",data:e})];case 3:return r.sent(),[3,6];case 4:return[4,i.api.request({url:"environmentVariables:update",method:"post",params:{filterByTk:null==n?void 0:n.name},data:e})];case 5:r.sent(),r.label=6;case 6:return a(),[4,s.close()];case 7:return r.sent(),[3,9];case 8:return h(!1),[7];case 9:return[2]}})})()},[i.api,m,null==n?void 0:n.name,t,a,s]);return d().createElement("div",null,s.Header?d().createElement(s.Header,{title:d().createElement("span",{className:V},d().createElement(c.Button,{type:"text",size:"small",icon:d().createElement(r.CloseOutlined,null),onClick:function(){return C(function(){return I(this,function(e){switch(e.label){case 0:return[4,s.close()];case 1:return e.sent(),[2]}})})()}}),d().createElement("span",null,l))}):null,d().createElement("div",null,d().createElement(c.Form,{form:m,layout:"vertical",initialValues: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}({type:"default"},n)},d().createElement(c.Form.Item,{name:"name",label:"".concat(o("Name")," :"),rules:[{required:!0,message:o("The field value is required")},{pattern:p,message:o("Only letters, numbers and underscores are allowed, and it must start with a letter.")}]},d().createElement(c.Input,{disabled:"edit"===t})),d().createElement(c.Form.Item,{name:"type",label:"".concat(o("Type")," :"),rules:[{required:!0,message:o("The field value is required")}]},d().createElement(c.Radio.Group,{options:[{value:"default",label:o("Plain text")},{value:"secret",label:o("Encrypted")}]})),d().createElement(c.Form.Item,{name:"value",label:"".concat(o("Value")," :"),rules:[{required:!0,message:o("The field value is required")}]},d().createElement(c.Input.TextArea,{autoSize:{minRows:3}})))),s.Footer?d().createElement(s.Footer,null,d().createElement(c.Space,null,d().createElement(c.Button,{onClick:function(){return C(function(){return I(this,function(e){return[2,s.close()]})})()}},o("Cancel")),d().createElement(c.Button,{type:"primary",loading:y,onClick:E},o("Submit")))):null)}function R(e){var t=e.onSubmitted,n=v(),a=(0,u.useFlowContext)(),l=(0,u.useFlowView)(),o=F(c.Form.useForm(),1)[0],i=F((0,f.useState)(!1),2),s=i[0],m=i[1],p=(0,f.useCallback)(function(){return C(function(){var e,n;return I(this,function(r){switch(r.label){case 0:return[4,o.validateFields()];case 1:if((n=A(B((e=r.sent()).variables||"","default")).concat(A(B(e.secret||"","secret")))).length)return[3,3];return[4,l.close()];case 2:return r.sent(),[2];case 3:m(!0),r.label=4;case 4:return r.trys.push([4,,7,8]),[4,a.api.request({url:"environmentVariables:create",method:"post",data:n})];case 5:return r.sent(),t(),[4,l.close()];case 6:return r.sent(),[3,8];case 7:return m(!1),[7];case 8:return[2]}})})()},[a.api,o,t,l]);return d().createElement("div",null,l.Header?d().createElement(l.Header,{title:d().createElement("span",{className:V},d().createElement(c.Button,{type:"text",size:"small",icon:d().createElement(r.CloseOutlined,null),onClick:function(){return C(function(){return I(this,function(e){switch(e.label){case 0:return[4,l.close()];case 1:return e.sent(),[2]}})})()}}),d().createElement("span",null,n("Bulk import")))}):null,d().createElement("div",null,d().createElement(c.Form,{form:o,layout:"vertical"},d().createElement(c.Form.Item,{name:"variables",label:"".concat(n("Plain text")," :")},d().createElement(c.Input.TextArea,{autoSize:{minRows:8,maxRows:16},placeholder:"FOO=aaa\nBAR=bbb"})),d().createElement(c.Form.Item,{name:"secret",label:"".concat(n("Encrypted")," :")},d().createElement(c.Input.TextArea,{autoSize:{minRows:8,maxRows:16},placeholder:"FOO=aaa\nBAR=bbb"})))),l.Footer?d().createElement(l.Footer,null,d().createElement(c.Space,null,d().createElement(c.Button,{onClick:function(){return C(function(){return I(this,function(e){return[2,l.close()]})})()}},n("Cancel")),d().createElement(c.Button,{type:"primary",loading:s,onClick:p},n("Submit")))):null)}var q=(0,m.observer)(function(){var e,t=v(),n=(0,u.useFlowContext)();(0,u.useFlowView)();var a=c.theme.useToken().token,m=c.App.useApp().modal,p=(0,f.useMemo)(function(){return n.api.resource("environmentVariables")},[n.api]),b=(0,f.useRef)((0,s.observable)({logic:"$and",items:[]})),y=F((0,f.useState)(void 0),2),h=y[0],E=y[1],g=F((0,f.useState)([]),2),w=g[0],k=g[1],S=(0,i.useRequest)(function(){return C(function(){var e;return I(this,function(t){switch(t.label){case 0:return[4,n.api.request({url:"environmentVariables",method:"get",params:{paginate:!1,filter:h},skipNotify:!0})];case 1:return[2,null==(e=t.sent())?void 0:e.data]}})})()},{refreshDeps:[h]}),O=S.data,A=S.loading,x=(0,f.useMemo)(function(){var e=null==O?void 0:O.data;return Array.isArray(e)?e:[]},[O]),j=(0,f.useCallback)(function(){E((0,o.transformFilter)(b.current))},[]),V=(0,f.useCallback)(function(){b.current.logic="$and",b.current.items.splice(0,b.current.items.length),E(void 0)},[]),B=(0,f.useCallback)(function(){S.refresh()},[S]),q=(0,f.useCallback)(function(e){m.confirm({title:t("Delete variable"),content:t("Are you sure you want to delete it?"),onOk:function(){return C(function(){return I(this,function(t){switch(t.label){case 0:return[4,p.destroy({filterByTk:e})];case 1:return t.sent(),k([]),S.refresh(),[2]}})})()}})},[m,p,t,S]),$=(0,f.useCallback)(function(e,r){var a="".concat("create"===e?t("Add variable"):t("Edit"));n.viewer.drawer({width:"50%",content:function(){return d().createElement(T,{mode:e,initialValues:r,onSubmitted:function(){return S.refresh()},title:a})}})},[n.viewer,t,S]),_=(0,f.useCallback)(function(){n.viewer.drawer({width:"50%",content:function(){return d().createElement(R,{onSubmitted:function(){return S.refresh()}})}})},[n.viewer,S]),D=(0,f.useMemo)(function(){return[{title:t("Name"),dataIndex:"name",ellipsis:!0},{title:t("Type"),dataIndex:"type",render:function(e){return"secret"===e?d().createElement(c.Tag,{color:"red"},t("Encrypted")):d().createElement(c.Tag,{color:"green"},t("Plain text"))}},{title:t("Value"),ellipsis:!0,render:function(e){return"default"===e.type?e.value:"******"}},{title:t("Actions"),width:200,render:function(e){return d().createElement(c.Space,null,d().createElement("a",{onClick:function(){return $("edit",e)}},t("Edit")),d().createElement("a",{onClick:function(){return q(e.name)}},t("Delete")))}}]},[q,$,t]),M=null==O||null==(e=O.meta)?void 0:e.updated;return d().createElement("div",null,M?d().createElement(c.Alert,{type:"warning",style:{marginBottom:a.marginMD,alignItems:"center"},description:d().createElement("div",null,t("Variables and secrets have been updated. A restart is required for the changes to take effect.")),action:d().createElement(c.Button,{size:"middle",type:"primary",onClick:function(){return C(function(){return I(this,function(e){switch(e.label){case 0:return[4,n.api.resource("app").refresh()];case 1:return e.sent(),[2]}})})()}},t("Restart now"))}):null,d().createElement(c.Card,null,d().createElement(c.Flex,{justify:"space-between",style:{marginBottom:a.marginMD}},d().createElement(P,{value:b.current,onSubmit:j,onReset:V}),d().createElement(c.Space,null,d().createElement(c.Button,{icon:d().createElement(r.ReloadOutlined,null),onClick:B},t("Refresh")),d().createElement(c.Button,{icon:d().createElement(r.DeleteOutlined,null),disabled:!w.length,onClick:function(){return q(w)}},t("Delete")),d().createElement(c.Dropdown,{menu:{onClick:function(e){"variable"===e.key?$("create"):"bulk"===e.key&&_()},items:[{key:"variable",label:t("Add variable")},{type:"divider"},{key:"bulk",label:t("Bulk import")}]}},d().createElement(c.Button,{type:"primary",icon:d().createElement(r.PlusOutlined,null)},t("Add new")," ",d().createElement(r.DownOutlined,null))))),d().createElement(l.Table,{rowKey:"name",loading:A,dataSource:x,columns:D,pagination:!1,rowSelection:{selectedRowKeys:w,onChange:function(e){return k(e)}}})))})}}]);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type FC } from 'react';
|
|
10
|
+
interface EnvVariableFilterItemProps {
|
|
11
|
+
value: {
|
|
12
|
+
path: string;
|
|
13
|
+
operator: string;
|
|
14
|
+
value: any;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Static-fields FilterItem for the environment-variables settings page.
|
|
19
|
+
*
|
|
20
|
+
* Mirrors v1 `Filter.Action`'s 3 columns (field / operator / value) without
|
|
21
|
+
* depending on a CollectionBlockModel — the fields are hardcoded to the
|
|
22
|
+
* environmentVariables collection schema (name / type / value).
|
|
23
|
+
*/
|
|
24
|
+
export declare const EnvVariableFilterItem: FC<EnvVariableFilterItemProps>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export { default } from './plugin';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@emotion/css"),require("@nocobase/client-v2"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-environment-variables/client-v2",["ahooks","@emotion/css","@nocobase/client-v2","@formily/reactive","react","antd","@formily/react","@ant-design/icons","@nocobase/flow-engine","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-environment-variables/client-v2"]=t(require("ahooks"),require("@emotion/css"),require("@nocobase/client-v2"),require("@formily/reactive"),require("react"),require("antd"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@nocobase/utils/client")):e["@nocobase/plugin-environment-variables/client-v2"]=t(e.ahooks,e["@emotion/css"],e["@nocobase/client-v2"],e["@formily/reactive"],e.react,e.antd,e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,c,l){return function(){"use strict";var s,f,p,b={375:function(e){e.exports=u},477:function(e){e.exports=t},230:function(e){e.exports=a},992:function(e){e.exports=r},485:function(e){e.exports=n},694:function(e){e.exports=c},768:function(e){e.exports=l},625:function(t){t.exports=e},59:function(e){e.exports=i},155:function(e){e.exports=o}},v={};function d(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return b[e](n,n.exports,d),n.exports}d.m=b,d.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return d.d(t,{a:t}),t},d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},d.f={},d.e=function(e){return Promise.all(Object.keys(d.f).reduce(function(t,n){return d.f[n](e,t),t},[]))},d.u=function(e){return""+e+".b1becd4d3744e64d.js"},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},y={},d.l=function(e,t,n,r){if(y[e])return void y[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-environment-variables/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,d.nc&&o.setAttribute("nonce",d.nc),o.setAttribute("data-rspack","@nocobase/plugin-environment-variables/client-v2:"+n),o.src=e),y[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=y[e];if(delete y[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=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)},d.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.g.importScripts&&(h=d.g.location+"");var y,h,m=d.g.document;if(!h&&m&&(m.currentScript&&"SCRIPT"===m.currentScript.tagName.toUpperCase()&&(h=m.currentScript.src),!h)){var g=m.getElementsByTagName("script");if(g.length)for(var w=g.length-1;w>-1&&(!h||!/^http(s?):/.test(h));)h=g[w--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");d.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s={889:0},d.f.j=function(e,t){var n=d.o(s,e)?s[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=s[e]=[t,r]});t.push(n[2]=r);var o=d.p+d.u(e),i=Error();d.l(o,function(t){if(d.o(s,e)&&(0!==(n=s[e])&&(s[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)}},f=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==s[e]})){for(n in i)d.o(i,n)&&(d.m[n]=i[n]);a&&a(d)}for(e&&e(t);u<o.length;u++)r=o[u],d.o(s,r)&&s[r]&&s[r][0](),s[r]=0},(p=self.webpackChunk_nocobase_plugin_environment_variables_client_v2=self.webpackChunk_nocobase_plugin_environment_variables_client_v2||[]).forEach(f.bind(null,0)),p.push=f.bind(null,p.push.bind(p));var _={};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 n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-environment-variables/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).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("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-environment-variables/dist/client-v2/"}d.p=e}(),!function(){d.r(_),d.d(_,{default:function(){return f}});var e=d(485);function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)})}}function r(e,t){var n,r,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),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=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++,r=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],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function o(e){return n(function(){var t,n,o;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,e.request({url:"environmentVariables?paginate=false",skipNotify:!0})];case 1:return[2,Array.isArray(o=null==(n=r.sent())||null==(t=n.data)?void 0:t.data)?o:[]];case 2:return r.sent(),[2,[]];case 3:return[2]}})})()}function i(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function a(e,t,n){return(a=s()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&c(o,n.prototype),o}).apply(null,arguments)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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 a(e,arguments,u(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)})(e)}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(s=function(){return!!e})()}var f=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function a(){var e,t;if(!(this instanceof a))throw TypeError("Cannot call a class as a function");return e=a,t=arguments,e=u(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">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,s()?Reflect.construct(e,t||[],u(this).constructor):e.apply(this,t))}return a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),e&&c(a,e),t=[{key:"load",value:function(){var e;return(e=function(){var e,t;return function(e,t){var n,r,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),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=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++,r=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],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(i){var a,u,c;return e=this,t=this.t("Variables and secrets"),this.pluginSettingsManager.addMenuItem({key:"environment",title:t,icon:"TableOutlined",aclSnippet:"pm.environment-variables"}),this.pluginSettingsManager.addPageTabItem({menuKey:"environment",key:"index",title:t,componentLoader:function(){return d.e("500").then(d.bind(d,527))}}),a=this.flowEngine.context,u=this.app.apiClient,c=function(t){return e.t(t)},a.defineProperty("$env",{get:function(){return n(function(){return r(this,function(e){switch(e.label){case 0:return[4,o(u)];case 1:return[2,Object.fromEntries(e.sent().map(function(e){return[e.name,e.value]}))]}})})()},meta:{type:"object",title:String(c("Variables and secrets")),properties:function(){return n(function(){var e,t,n,i,a,c,l,s;return r(this,function(r){switch(r.label){case 0:return[4,o(u)];case 1:e=r.sent(),t={},n=!0,i=!1,a=void 0;try{for(c=e[Symbol.iterator]();!(n=(l=c.next()).done);n=!0)t[(s=l.value).name]={type:"secret"===s.type?"string":s.type||"string",title:s.name}}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return[2,t]}})})()}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function u(e){i(a,r,o,u,c,"next",e)}function c(e){i(a,r,o,u,c,"throw",e)}u(void 0)})}).call(this)}}],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)}}(a.prototype,t),a}(l(e.Plugin))}(),_}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useT(): (key: string, options?: Record<string, any>) => string;
|
|
10
|
+
export declare function tExpr(key: string): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
declare const EnvironmentPage: React.FC;
|
|
11
|
+
export default EnvironmentPage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import type { Application } from '@nocobase/client-v2';
|
|
10
|
+
import { Plugin } from '@nocobase/client-v2';
|
|
11
|
+
export declare class PluginEnvironmentVariablesClientV2 extends Plugin<Record<string, never>, Application> {
|
|
12
|
+
load(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export default PluginEnvironmentVariablesClientV2;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Shared registration of the `$env` property on a flow-engine context — the
|
|
11
|
+
* single source of truth used by BOTH client runtimes:
|
|
12
|
+
* - v2 (`client-v2/plugin.tsx`) registers it on its own flow-engine context;
|
|
13
|
+
* - v1 (`client/index.tsx`) imports this same helper via the allowed v1 → v2
|
|
14
|
+
* direction and registers it on v1's flow-engine context, so workflow's v2
|
|
15
|
+
* config drawer (which renders detached from the React tree and therefore
|
|
16
|
+
* can't reach v1's React-context-based `addGlobalVar('$env')`) can still read
|
|
17
|
+
* `$env` from `flowEngine.context.getPropertyMetaTree()`.
|
|
18
|
+
*
|
|
19
|
+
* Framework-agnostic: dependencies (`apiClient`, `t`) are injected as parameters,
|
|
20
|
+
* so it carries no React hooks and no `@nocobase/client` import — usable from
|
|
21
|
+
* either runtime. The list is fetched lazily (first read only) and cached by the
|
|
22
|
+
* flow-engine context, so the picker never re-requests on every expand.
|
|
23
|
+
*/
|
|
24
|
+
import type { FlowContext } from '@nocobase/flow-engine';
|
|
25
|
+
type EnvironmentVariable = {
|
|
26
|
+
name: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
type?: 'default' | 'secret';
|
|
29
|
+
};
|
|
30
|
+
/** Minimal structural slice of the API client — only the one call this needs.
|
|
31
|
+
* Avoids importing the concrete `APIClient` type across the package boundary. */
|
|
32
|
+
type EnvApiClient = {
|
|
33
|
+
request(options: {
|
|
34
|
+
url: string;
|
|
35
|
+
skipNotify?: boolean;
|
|
36
|
+
}): Promise<unknown>;
|
|
37
|
+
};
|
|
38
|
+
export declare function fetchEnvironmentVariables(apiClient: EnvApiClient): Promise<EnvironmentVariable[]>;
|
|
39
|
+
/** A translator for the scope label. Accepts the i18next `t` from either runtime
|
|
40
|
+
* (its return type isn't a bare `string` — it's a `TFunctionDetailedResult` /
|
|
41
|
+
* union), so the result is coerced to a string by the helper. */
|
|
42
|
+
type Translate = (key: string) => unknown;
|
|
43
|
+
/**
|
|
44
|
+
* Define `$env` on the given flow-engine context. `t` translates the scope label
|
|
45
|
+
* ("Variables and secrets"); `apiClient` fetches the variable list lazily.
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerEnvProperty(context: FlowContext, apiClient: EnvApiClient, t: Translate): void;
|
|
48
|
+
export {};
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/flow-engine": "2.
|
|
12
|
-
"@nocobase/client": "2.
|
|
11
|
+
"@nocobase/flow-engine": "2.2.0-alpha.1",
|
|
12
|
+
"@nocobase/client": "2.2.0-alpha.1",
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"@nocobase/
|
|
14
|
+
"@nocobase/client-v2": "2.2.0-alpha.1",
|
|
15
|
+
"@nocobase/server": "2.2.0-alpha.1",
|
|
15
16
|
"@ant-design/icons": "5.6.1",
|
|
16
17
|
"@formily/antd-v5": "1.2.3",
|
|
17
18
|
"@formily/core": "2.3.7",
|
|
@@ -19,5 +20,9 @@ module.exports = {
|
|
|
19
20
|
"react-router-dom": "6.30.1",
|
|
20
21
|
"antd": "5.24.2",
|
|
21
22
|
"react-i18next": "11.18.6",
|
|
22
|
-
"@
|
|
23
|
+
"@emotion/css": "11.13.0",
|
|
24
|
+
"@nocobase/utils": "2.2.0-alpha.1",
|
|
25
|
+
"ahooks": "3.7.8",
|
|
26
|
+
"@formily/reactive": "2.3.7",
|
|
27
|
+
"@nocobase/database": "2.2.0-alpha.1"
|
|
23
28
|
};
|
|
@@ -33,6 +33,7 @@ var import_database = require("@nocobase/database");
|
|
|
33
33
|
var import_re = require("../../re");
|
|
34
34
|
var environmentVariables_default = (0, import_database.defineCollection)({
|
|
35
35
|
name: "environmentVariables",
|
|
36
|
+
dataCategory: "system",
|
|
36
37
|
autoGenId: false,
|
|
37
38
|
migrationRules: ["schema-only"],
|
|
38
39
|
fields: [
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-environment-variables",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.1",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@nocobase/client": "2.x",
|
|
7
|
+
"@nocobase/client-v2": "2.x",
|
|
7
8
|
"@nocobase/server": "2.x",
|
|
8
9
|
"@nocobase/test": "2.x"
|
|
9
10
|
},
|
|
@@ -20,5 +21,5 @@
|
|
|
20
21
|
"System management"
|
|
21
22
|
],
|
|
22
23
|
"license": "Apache-2.0",
|
|
23
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "303663aba6c6eefa27e6a6435b4c0352074ec40f"
|
|
24
25
|
}
|