@nocobase/plugin-environment-variables 2.0.0-alpha.9 → 2.1.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.
@@ -8,5 +8,5 @@
8
8
  */
9
9
  import React from 'react';
10
10
  declare const EnvAndSecretsContext: React.Context<any>;
11
- declare const EnvironmentVariablesAndSecretsProvider: React.MemoExoticComponent<import("@formily/react").ReactFC<unknown>>;
11
+ declare const EnvironmentVariablesAndSecretsProvider: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<unknown>>;
12
12
  export { EnvAndSecretsContext, EnvironmentVariablesAndSecretsProvider };
@@ -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("@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","@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("@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["@formily/react"],e["@ant-design/icons"],e.antd,e["react-i18next"])}(self,function(e,t,n,r,o,a,l,i,u){return function(){"use strict";var c={482:function(e){e.exports=l},632:function(e){e.exports=r},563:function(t){t.exports=e},505:function(e){e.exports=a},772:function(e){e.exports=t},721:function(e){e.exports=i},156:function(e){e.exports=o},238:function(e){e.exports=u},128:function(e){e.exports=n}},s={};function f(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return c[e](n,n.exports,f),n.exports}f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,{a:t}),t},f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return!function(){f.r(p),f.d(p,{default:function(){return L},PluginEnvironmentVariablesClient:function(){return z}});var e=f(772),t=f(505),n=f(156),r=f.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=f(482),u=f(632),c=f(563),s=f(128),m=f(721),d=f(238),b=/^[A-Za-z][A-Za-z0-9_]*$/,y=JSON.parse('{"u2":"@nocobase/plugin-environment-variables"}');function v(){var t=(0,e.useApp)();return function(e){return t.i18n.t(e,{ns:[y.u2,"client"]})}}function h(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 g(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 w(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 E(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function S(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 O(e,t){return g(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)||k(e,t)||E()}function k(e,t){if(e){if("string"==typeof e)return h(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 h(e,t)}}function A(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?b.test(e)?"":"Only letters, numbers and underscores are allowed, and it must start with a letter.":""}});var j=(0,t.createSchemaField)({components:{FormItem:u.FormItem,Input:u.Input,Checkbox:u.Checkbox,Radio:u.Radio}}),q={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 "}}}},I={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 C(t){var n,o=t.request,a=t.setSelectRowKeys,l=m.App.useApp().modal,i=v(),c=(0,e.useAPIClient)(),s=o||{},f=s.data,p=s.loading,d=s.refresh,b=(0,e.useGlobalTheme)().theme,y={default:{label:i("Plain text"),color:"green"},secret:{label:i("Encrypted"),color:"red"}},h=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 w(function(){return A(this,function(t){switch(t.label){case 0:return[4,h.destroy({filterByTk:e.name})];case 1:return t.sent(),d(),[2]}})})()}})},x=(n=w(function(t){var n;return A(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:I})),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=w(function(e){return A(this,function(n){switch(n.label){case 0:return[4,c.request({url:"environmentVariables:update?filterByTk=".concat(t.name),method:"post",data:S({},e)})];case 1:return n.sent(),o.refresh(),[2]}})}),function(e){return a.apply(this,arguments)})},i("Submit")))))},b)).open({initialValues:S({},t)}),[2]})}),function(e){return n.apply(this,arguments)});return r().createElement("div",null,r().createElement(m.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(m.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(m.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 F(){var a,l,c,f=(0,e.useAPIClient)(),p=v(),b=m.App.useApp().modal,y=(0,n.useContext)(o).variablesRequest,h=O((0,n.useState)([]),2),x=h[0],F=h[1],P=f.resource("environmentVariables"),R=(0,e.useGlobalTheme)().theme,T=(0,s.useLocation)();(0,n.useEffect)(function(){var e=y.run,t=y.params;(null==t?void 0:t.length)&&e()},[T.key]);var V=(a=w(function(e){var t;return A(this,function(n){switch(n.label){case 0:return t=Object.entries(e).map(function(e){var t,n=O(e,2),r=n[0];return(t=n[1],t.trim().split("\n").map(function(e){var t,n=g(t=e.split("="))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||k(t)||E(),o=n[0],a=n.slice(1);return o&&{name:o.trim(),value:a.join("=").trim(),type:"secret"===r?"secret":"default"}})).filter(Boolean)}),[4,f.request({url:"environmentVariables:create",method:"post",data:t.flat()})];case 1:return n.sent(),[2]}})}),function(e){return a.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==(c=y.data)||null==(l=c.meta)?void 0:l.updated)&&r().createElement(m.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(m.Button,{size:"middle",type:"primary",onClick:w(function(){return A(this,function(e){switch(e.label){case 0:return[4,f.resource("app").refresh()];case 1:return e.sent(),[2]}})})},p("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:$,"x-use-component-props":function(){var n,r=(0,t.useField)(),o=y.run,a=(0,d.useTranslation)().t;return{options:$,onSubmit:(n=w(function(t){var n,l;return A(this,function(i){return o(t),r.setValue(t),(null==(l=(null==(n=(0,e.removeNullCondition)(null==t?void 0:t.filter))?void 0:n.$and)||(null==n?void 0:n.$or))?void 0:l.length)?r.title=a("{{count}} filter items",{count:(null==l?void 0:l.length)||0}):r.title=a("Filter"),[2]})}),function(e){return n.apply(this,arguments)}),onReset:function(e){r.setValue(e)}}}},scope:{t:p}})),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==y||null==(e=y.refresh)||e.call(y)}},p("Refresh")),r().createElement(m.Button,{icon:r().createElement(i.DeleteOutlined,null),onClick:function(){x.length>0&&b.confirm({title:p("Delete variable"),content:p("Are you sure you want to delete it?"),onOk:function(){return w(function(){var e;return A(this,function(t){switch(t.label){case 0:return[4,P.destroy({filterByTk:x})];case 1:return t.sent(),null==y||null==(e=y.refresh)||e.call(y),[2]}})})()}})}},p("Delete")),r().createElement(m.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?q:I})),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=w(function(e){return A(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,f.request({url:"environmentVariables:create",method:"post",data:S({},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(m.Button,{type:"primary",icon:r().createElement(i.PlusOutlined,null)},p("Add new")," ",r().createElement(i.DownOutlined,null))))),r().createElement(C,{request:y,setSelectRowKeys:F})))}function P(){return r().createElement(F,null)}function R(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 T=function(){var e,t=v(),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},V=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 R(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 R(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 R(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.")}()))}},$=function(){var e,t=(0,n.useContext)(o).variablesRequest,r=t.data,a=t.loading,l=V(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 _(e,t,n){return(_=N()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&M(o,n.prototype),o}).apply(null,arguments)}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 G(e){var t="function"==typeof Map?new Map:void 0;return(G=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 _(e,arguments,D(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),M(n,e)})(e)}function N(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(N=function(){return!!e})()}var z=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=D(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,N()?Reflect.construct(e,t||[],D(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&M(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:P}),t.app.addGlobalVar("$env",T,$),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){B(a,r,o,l,i,"next",e)}function i(e){B(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}(G(e.Plugin)),L=z}(),p}()});
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}()});
@@ -8,15 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@formily/react": "2.3.7",
12
- "@nocobase/client": "2.0.0-alpha.9",
11
+ "@nocobase/flow-engine": "2.1.0-alpha.1",
12
+ "@nocobase/client": "2.1.0-alpha.1",
13
13
  "react": "18.2.0",
14
- "@nocobase/server": "2.0.0-alpha.9",
14
+ "@nocobase/server": "2.1.0-alpha.1",
15
15
  "@ant-design/icons": "5.6.1",
16
16
  "@formily/antd-v5": "1.2.3",
17
17
  "@formily/core": "2.3.7",
18
+ "@formily/react": "2.3.7",
18
19
  "react-router-dom": "6.30.1",
19
20
  "antd": "5.24.2",
20
21
  "react-i18next": "11.18.6",
21
- "@nocobase/database": "2.0.0-alpha.9"
22
+ "@nocobase/database": "2.1.0-alpha.1"
22
23
  };
@@ -1,16 +1,16 @@
1
1
  {
2
- "Environment": "Umgebung",
3
- "Variables and secrets": "Variablen und Geheimnisse",
4
- "Variables": "Variablen",
5
- "Secrets": "Geheimnisse",
6
2
  "Add variable": "Variable hinzufügen",
7
3
  "Bulk import": "Massenimport",
4
+ "Delete variable": "Variable löschen",
5
+ "Encrypted": "Verschlüsselt",
6
+ "Environment": "Umgebung",
8
7
  "Name": "Name",
9
- "Value": "Wert",
10
- "Type": "Typ",
11
8
  "Plain text": "Klartext",
12
- "Encrypted": "Verschlüsselt",
13
- "Delete variable": "Variable löschen",
14
9
  "Restart now": "Jetzt neu starten",
10
+ "Secrets": "Geheimnisse",
11
+ "Type": "Typ",
12
+ "Value": "Wert",
13
+ "Variables": "Variablen",
14
+ "Variables and secrets": "Variablen und Geheimnisse",
15
15
  "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variablen und Geheimnisse wurden aktualisiert. Ein Neustart ist erforderlich, damit die Änderungen wirksam werden."
16
- }
16
+ }
@@ -1 +1,16 @@
1
- {}
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Változó hozzáadása",
3
+ "Bulk import": "Tömeges importálás",
4
+ "Delete variable": "Változó törlése",
5
+ "Encrypted": "Titkosított",
6
+ "Environment": "Környezet",
7
+ "Name": "Név",
8
+ "Plain text": "Egyszerű szöveg",
9
+ "Restart now": "Újraindítás most",
10
+ "Secrets": "Titkok",
11
+ "Type": "Típus",
12
+ "Value": "Érték",
13
+ "Variables": "Változók",
14
+ "Variables and secrets": "Változók és titkok",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "A változók és titkok frissítve lettek. A változások életbe lépéséhez újraindítás szükséges."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Tambah variabel",
3
+ "Bulk import": "Impor massal",
4
+ "Delete variable": "Hapus variabel",
5
+ "Encrypted": "Terenkripsi",
6
+ "Environment": "Lingkungan",
7
+ "Name": "Nama",
8
+ "Plain text": "Teks biasa",
9
+ "Restart now": "Mulai ulang sekarang",
10
+ "Secrets": "Rahasia",
11
+ "Type": "Tipe",
12
+ "Value": "Nilai",
13
+ "Variables": "Variabel",
14
+ "Variables and secrets": "Variabel dan rahasia",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variabel dan rahasia telah diperbarui. Perlu dimulai ulang agar perubahan berlaku."
16
+ }
@@ -1,16 +1,16 @@
1
1
  {
2
- "Environment": "Ambiente",
3
- "Variables and secrets": "Variabili e segreti",
4
- "Variables": "Variabili",
5
- "Secrets": "Segreti",
6
2
  "Add variable": "Aggiungi variabile",
7
3
  "Bulk import": "Importazione in blocco",
4
+ "Delete variable": "Elimina variabile",
5
+ "Encrypted": "Crittografato",
6
+ "Environment": "Ambiente",
8
7
  "Name": "Nome",
9
- "Value": "Valore",
10
- "Type": "Tipo",
11
8
  "Plain text": "Testo semplice",
12
- "Encrypted": "Crittografato",
13
- "Delete variable": "Elimina variabile",
14
9
  "Restart now": "Riavvia ora",
10
+ "Secrets": "Segreti",
11
+ "Type": "Tipo",
12
+ "Value": "Valore",
13
+ "Variables": "Variabili",
14
+ "Variables and secrets": "Variabili e segreti",
15
15
  "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Rilevati aggiornamenti a variabili e segreti. È necessario un riavvio per applicare le modifiche."
16
- }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "変数の追加",
3
+ "Bulk import": "一括インポート",
4
+ "Delete variable": "変数の削除",
5
+ "Encrypted": "暗号化済み",
6
+ "Environment": "環境",
7
+ "Name": "名称",
8
+ "Plain text": "プレーンテキスト",
9
+ "Restart now": "今すぐ再起動",
10
+ "Secrets": "シークレット",
11
+ "Type": "タイプ",
12
+ "Value": "値",
13
+ "Variables": "変数",
14
+ "Variables and secrets": "変数とシークレット",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "変数とシークレットが更新されました。変更を反映するには再起動が必要です。"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "변수 추가",
3
+ "Bulk import": "일괄 가져오기",
4
+ "Delete variable": "변수 삭제",
5
+ "Encrypted": "암호화됨",
6
+ "Environment": "환경",
7
+ "Name": "이름",
8
+ "Plain text": "일반 텍스트",
9
+ "Restart now": "지금 다시 시작",
10
+ "Secrets": "비밀",
11
+ "Type": "유형",
12
+ "Value": "값",
13
+ "Variables": "변수",
14
+ "Variables and secrets": "변수 및 비밀",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "변수와 시크릿이 업데이트되었습니다. 변경 사항을 적용하려면 재시작이 필요합니다."
16
+ }
@@ -1,17 +1,16 @@
1
1
  {
2
- "Environment": "Omgeving",
3
- "Variables and secrets": "Variabelen en geheimen",
4
- "Variables": "Variabelen",
5
- "Secrets": "Geheimen",
6
- "Add variable": "Variabele toevoegen",
7
- "Bulk import": "Bulk importeren",
8
- "Name": "Naam",
9
- "Value": "Waarde",
10
- "Type": "Type",
11
- "Plain text": "Tekst",
12
- "Encrypted": "Versleuteld",
13
- "Delete variable": "Variabele verwijderen",
14
- "Restart now": "Nu herstarten",
15
- "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variabelen en geheimen zijn bijgewerkt. Een herstart is vereist voor de wijzigingen om van kracht te worden."
16
- }
17
-
2
+ "Add variable": "Variabele toevoegen",
3
+ "Bulk import": "Bulk importeren",
4
+ "Delete variable": "Variabele verwijderen",
5
+ "Encrypted": "Versleuteld",
6
+ "Environment": "Omgeving",
7
+ "Name": "Naam",
8
+ "Plain text": "Tekst",
9
+ "Restart now": "Nu herstarten",
10
+ "Secrets": "Geheimen",
11
+ "Type": "Type",
12
+ "Value": "Waarde",
13
+ "Variables": "Variabelen",
14
+ "Variables and secrets": "Variabelen en geheimen",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variabelen en geheimen zijn bijgewerkt. Een herstart is vereist voor de wijzigingen om van kracht te worden."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Добавить переменную",
3
+ "Bulk import": "Массовый импорт",
4
+ "Delete variable": "Удалить переменную",
5
+ "Encrypted": "Зашифровано",
6
+ "Environment": "Окружение",
7
+ "Name": "Имя",
8
+ "Plain text": "Текст",
9
+ "Restart now": "Перезапустить сейчас",
10
+ "Secrets": "Секреты",
11
+ "Type": "Тип",
12
+ "Value": "Значение",
13
+ "Variables": "Переменные",
14
+ "Variables and secrets": "Переменные и секреты",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Переменные и секреты были обновлены. Для вступления изменений в силу необходим перезапуск."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Tên",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Loại",
12
+ "Value": "Giá trị",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
@@ -1,16 +1,16 @@
1
1
  {
2
- "Environment": "环境",
3
- "Variables and secrets": "变量和密钥",
4
- "Variables": "变量",
5
- "Secrets": "密钥",
6
2
  "Add variable": "添加变量",
7
3
  "Bulk import": "批量导入",
4
+ "Delete variable": "删除变量",
5
+ "Encrypted": "加密",
6
+ "Environment": "环境",
8
7
  "Name": "名称",
9
- "Value": "值",
10
- "Type": "类型",
11
8
  "Plain text": "明文",
12
- "Encrypted": "加密",
13
- "Delete variable": "删除变量",
14
9
  "Restart now": "立即重启",
10
+ "Secrets": "密钥",
11
+ "Type": "类型",
12
+ "Value": "值",
13
+ "Variables": "变量",
14
+ "Variables and secrets": "变量和密钥",
15
15
  "Variables and secrets have been updated. A restart is required for the changes to take effect.": "检测到变量和密钥有更新,需重启应用才能生效。"
16
- }
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "Add variable": "Add variable",
3
+ "Bulk import": "Bulk import",
4
+ "Delete variable": "Delete variable",
5
+ "Encrypted": "Encrypted",
6
+ "Environment": "Environment",
7
+ "Name": "Name",
8
+ "Plain text": "Plain text",
9
+ "Restart now": "Restart now",
10
+ "Secrets": "Secrets",
11
+ "Type": "Type",
12
+ "Value": "Value",
13
+ "Variables": "Variables",
14
+ "Variables and secrets": "Variables and secrets",
15
+ "Variables and secrets have been updated. A restart is required for the changes to take effect.": "Variables and secrets have been updated. A restart is required for the changes to take effect."
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-environment-variables",
3
- "version": "2.0.0-alpha.9",
3
+ "version": "2.1.0-alpha.1",
4
4
  "main": "dist/server/index.js",
5
5
  "peerDependencies": {
6
6
  "@nocobase/client": "2.x",
@@ -9,12 +9,15 @@
9
9
  },
10
10
  "displayName": "Variables and secrets",
11
11
  "displayName.zh-CN": "变量和密钥",
12
+ "displayName.ru-RU": "Переменные и секреты",
13
+ "description.ru-RU": "Централизованное управление переменными окружения и секретами для хранения конфиденциальных данных, повторного использования конфигураций, изоляции окружений и прочих задач.",
12
14
  "description": "Centralized management of environment variables and secrets, used for sensitive data storage, configuration data reuse, multi-environment isolation, and more.",
13
15
  "description.zh-CN": "集中管理环境变量和密钥,用于敏感数据存储、配置数据重用、多环境隔离等。",
16
+ "homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/environment-variables",
14
17
  "homepage": "https://docs.nocobase.com/handbook/environment-variables",
15
18
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/environment-variables",
16
19
  "keywords": [
17
20
  "System management"
18
21
  ],
19
- "gitHead": "4a9acf96f21a3aa35bccbd188b942595b09da0a9"
22
+ "gitHead": "d27baf21569643d6fa83f882233f4e90eb5b89f1"
20
23
  }