@nocobase/plugin-license 2.1.0-alpha.13 → 2.1.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +4 -4
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-license",["ahooks","react","antd","@nocobase/client","@ant-design/icons","@formily/react"],t):"object"==typeof exports?exports["@nocobase/plugin-license"]=t(require("ahooks"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react")):e["@nocobase/plugin-license"]=t(e.ahooks,e.react,e.antd,e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"])}(self,function(e,t,n,r,o,a){return function(){"use strict";var i={375:function(e){e.exports=o},230:function(e){e.exports=a},342:function(e){e.exports=r},625:function(t){t.exports=e},59:function(e){e.exports=n},155:function(e){e.exports=t}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return i[e](n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(l=c.g.location+"");var l,s=c.g.document;if(!l&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(l=s.currentScript.src),!l)){var f=s.getElementsByTagName("script");if(f.length)for(var p=f.length-1;p>-1&&(!l||!/^http(s?):/.test(l));)l=f[p--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");c.p=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var y={},d=window.__nocobase_public_path__||"";if(!d&&window.location&&window.location.pathname){var h=window.location.pathname||"/",m=h.indexOf("/v2/");d=m>=0?h.slice(0,m+1):"/"}return d&&(d=d.replace(/\/v2\/?$/,"/")),d||(d="/"),"/"!==d.charAt(d.length-1)&&(d+="/"),c.p=d+"static/plugins/@nocobase/plugin-license/dist/client/",!function(){c.r(y),c.d(y,{default:function(){return L},PluginLicenseClient:function(){return D}});var e=c(342),t=c(155),n=c.n(t),r=c(59),o=c(625),a=JSON.parse('{"UU":"@nocobase/plugin-license"}');function i(){var t=(0,e.useApp)();return function(e,n){return String(t.i18n.t(e,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:[a.UU,"client"]},n||{})))}}var u=c(375);function l(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 s=function(o){var a,u=o.refreshToken,c=(0,e.useAPIClient)(),s=function(e){if(Array.isArray(e))return e}(a=(0,t.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(a)||function(e){if(e){if("string"==typeof e)return l(e,2);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 l(e,2)}}(a)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=s[0],p=s[1],y=i();return((0,t.useEffect)(function(){p(null),c.request({url:"/license:license-validate",method:"get"}).then(function(e){var t;p(null==e||null==(t=e.data)?void 0:t.data)}).catch(function(e){console.log(e)})},[u]),(null==f?void 0:f.licenseStatus)&&(null==f?void 0:f.licenseStatus)==="active")?(null==f?void 0:f.isServiceConnection)===!1&&(null==f?void 0:f.isPkgLogin)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary."),n().createElement("br",null),y("Plugins also cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")),type:"warning",style:{marginBottom:12}}):(null==f?void 0:f.isServiceConnection)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary.")),type:"warning",style:{marginBottom:12}}):(null==f?void 0:f.isPkgLogin)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, plugins cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")),type:"warning",style:{marginBottom:12}}):null:null},f=c(230),p=n().createContext(null);function d(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 h(e,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){h(a,r,o,i,u,"next",e)}function u(e){h(a,r,o,i,u,"throw",e)}i(void 0)})}}function b(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var v=function(){var o,a=(0,e.useAPIClient)(),u=function(e){if(Array.isArray(e))return e}(o=(0,t.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(o)||function(e){if(e){if("string"==typeof e)return d(e,2);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 d(e,2)}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=u[0],l=u[1],s=(0,f.useForm)(),y=i(),h=n().useContext(p).onSaveSuccess;return{loading:c,onClick:function(){return m(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,null==s?void 0:s.validate()];case 1:var o;return t.sent(),[4,(o=null==(e=s.values)?void 0:e.licenseKey,m(function(){var e,t,i;return b(this,function(u){switch(u.label){case 0:l(!0),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,a.request({url:"/license:license-key",method:"POST",data:{licenseKey:o}})];case 2:if(t=u.sent(),l(!1),"invalid"===(i=(null==t||null==(e=t.data)?void 0:e.data)||{}).keyStatus)return r.Modal.error({title:y("Invalid license key."),content:y("The license key is invalid. Please visit the NocoBase Service to obtain a new license key.")}),[2];if("invalid"===i.licenseStatus)return r.Modal.error({title:y("Invalid license key."),content:y("The current license key has been deprecated. Please visit the NocoBase Service to obtain a new license key.")}),[2];if(!1===i.envMatch)return r.Modal.error({title:y("Environment mismatch."),content:n().createElement(n().Fragment,null,!1===i.dbMatch&&!1===i.sysMatch&&n().createElement(n().Fragment,null,y("The current system and database do not match the licensed environment. Please use the new InstanceID to request a new license key.")),!0===i.dbMatch&&!1===i.sysMatch&&n().createElement(n().Fragment,null,y("The current system does not match the licensed system. Please use the new InstanceID to request a new license key.")),!1===i.dbMatch&&!0===i.sysMatch&&n().createElement(n().Fragment,null,y("The current database does not match the licensed database. Please use the new InstanceID to request a new license key.")))}),[2];if(!1===i.domainMatch)return r.Modal.error({title:y("Domain mismatch."),content:y("The current domain ({{domain}}) does not match the licensed domain. Please use the current domain to request a new license key.",{domain:i.current.domain,interpolation:{escapeValue:!1}})}),[2];if(null==h||h(),!0===i.isExpired)return r.message.success(y("The license key was saved successfully"),5),r.Modal.warning({title:y("The license has exceeded the upgrade validity period."),content:y("Plugins bound to this license can still be used but cannot be upgraded. To upgrade, please renew or repurchase the license.")}),[2];if(!1===i.isPkgLogin)return r.message.success(y("The license key was saved successfully"),5),r.Modal.warning({title:y("Network error."),content:y("Due to network issues, plugins cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")}),[2];return r.message.success(y("License key saved successfully. Please retry the plugin installation.")),[3,4];case 3:return u.sent(),l(!1),r.message.error(y("Network error. Please try again.")),[3,4];case 4:return[2]}})})())];case 2:return t.sent(),[2]}})})()}}};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,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){w(a,r,o,i,u,"next",e)}function u(e){w(a,r,o,i,u,"throw",e)}i(void 0)})}}function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw r}}return a}}(e,t)||function(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)}}(e,t)||function(){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,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var P=function(e){var t=e.text,n=e.onSuccess,r=e.onError;if(!navigator.clipboard){var o=document.createElement("textarea");o.value=t,o.style.top="0",o.style.left="0",o.style.position="fixed",document.body.appendChild(o),o.focus(),o.select();try{document.execCommand("copy"),null==n||n()}catch(e){null==r||r()}document.body.removeChild(o);return}navigator.clipboard.writeText(t).then(function(){null==n||n()}).catch(function(e){console.error(e),null==r||r()})};function E(){var o=(0,e.useAPIClient)(),a=x((0,t.useState)(!1),2),c=a[0],l=a[1],s=x((0,t.useState)(""),2);s[0],s[1];var f=i();return n().createElement(r.Button,{onClick:function(){return S(function(){return O(this,function(e){switch(e.label){case 0:return[4,S(function(){return O(this,function(e){return l(!0),[2,o.request({url:"/license:instance-id",method:"GET"}).then(function(e){var t;return null==e||null==(t=e.data)?void 0:t.data}).finally(function(){l(!1)})]})})()];case 1:return P({text:e.sent(),onSuccess:function(){r.message.success(f("Copied"))},onError:function(){r.message.error(f("Failed to copy, please open ./storage/.license/instance-id and copy it"))}}),[2]}})})()},loading:c,icon:n().createElement(u.CopyOutlined,null),type:"link"},f("Copy"))}var j=function(e){var a=e;if(null==a)throw TypeError("Cannot destructure "+a);var u=k({},e),c=x((0,t.useState)(!1),2),l=c[0],s=c[1],y=(0,f.useForm)(),d=i(),h=n().useContext(p).keyExist;return((0,o.useAsyncEffect)(function(){return S(function(){return O(this,function(e){return!1===h&&(s(!0),null==y||y.setFieldState("footer",function(e){e.visible=!0})),[2]})})()},[h]),l)?n().createElement(r.Input.TextArea,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}({rows:4},u)):h?n().createElement(n().Fragment,null,d("License key has been set"),"\xa0",n().createElement(r.Button,{onClick:function(){s(!0),null==y||y.setFieldState("footer",function(e){e.visible=!0})}},d("Change key"))):null},T=function(){var t=n().useContext(p),r=t.keyExist,o=t.refreshToken;return r?n().createElement(e.SchemaComponent,{key:o,schema:{type:"void",properties:{card:{type:"void","x-component":"LicenseCard"}}}}):null};function I(){var a=i(),u=x((0,t.useState)(0),2),c=u[0],l=u[1],f=x((0,t.useState)(null),2),y=f[0],d=f[1],h=(0,e.useAPIClient)();(0,o.useAsyncEffect)(function(){return S(function(){var e,t;return O(this,function(n){switch(n.label){case 0:return[4,h.request({url:"/license:is-exists",method:"GET"})];case 1:return d(null==(t=n.sent())||null==(e=t.data)?void 0:e.data),[2]}})})()},[]);var m={type:"void","x-decorator":"Form",properties:{form:{type:"void",properties:{label:{type:"string",title:a("Instance ID"),"x-component":"InstanceId","x-decorator":"FormItem"},licenseKey:{type:"string",title:a("License key"),required:!0,"x-component":"TextArea","x-decorator":"FormItem","x-component-props":{placeholder:a("Enter license key")}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":"useSubmitProps","x-component-props":{type:"primary",style:{marginBottom:16}}}},"x-visible":!1},licenseInfo:{type:"void","x-component":"LicenseCardWarp"}}}}};return n().createElement(r.Card,{bordered:!1},n().createElement(p.Provider,{value:{onSaveSuccess:function(){l(function(e){return e+1}),d(!0)},keyExist:y,refreshToken:c}},n().createElement(s,{refreshToken:c}),n().createElement(e.SchemaComponent,{scope:{useSubmitProps:v},components:{InstanceId:E,TextArea:j,LicenseCardWarp:T},schema:{type:"void",properties:{form:m}}})))}function A(e,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){A(a,r,o,i,u,"next",e)}function u(e){A(a,r,o,i,u,"throw",e)}i(void 0)})}}function M(e,t,n){return(M=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&F(o,n.prototype),o}).apply(null,arguments)}function q(e){return(q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _(e){var t="function"==typeof Map?new Map:void 0;return(_=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 M(e,arguments,q(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),F(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}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:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var D=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=q(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,B()?Reflect.construct(e,t||[],q(this).constructor):e.apply(this,t))}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&F(n,e),t=[{key:"afterAdd",value:function(){return C(function(){return N(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return C(function(){return N(this,function(e){return[2]})})()}},{key:"load",value:function(){return C(function(){return N(this,function(e){return this.app.pluginSettingsManager.add("license-settings",{title:"{{t(".concat(JSON.stringify("License settings"),", { ns: ['").concat(a.UU,"', 'client'], nsMode: 'fallback' })}}"),icon:"SolutionOutlined",Component:I,aclSnippet:"pm.license-settings"}),[2]})}).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}(_(e.Plugin)),L=D}(),y}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react")):"function"==typeof define&&define.amd?define("@nocobase/plugin-license",["ahooks","react","antd","@nocobase/client","@ant-design/icons","@formily/react"],t):"object"==typeof exports?exports["@nocobase/plugin-license"]=t(require("ahooks"),require("react"),require("antd"),require("@nocobase/client"),require("@ant-design/icons"),require("@formily/react")):e["@nocobase/plugin-license"]=t(e.ahooks,e.react,e.antd,e["@nocobase/client"],e["@ant-design/icons"],e["@formily/react"])}(self,function(e,t,n,r,o,a){return function(){"use strict";var i={375:function(e){e.exports=o},230:function(e){e.exports=a},342:function(e){e.exports=r},625:function(t){t.exports=e},59:function(e){e.exports=n},155:function(e){e.exports=t}},u={};function c(e){var t=u[e];if(void 0!==t)return t.exports;var n=u[e]={exports:{}};return i[e](n,n.exports,c),n.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(l=c.g.location+"");var l,s=c.g.document;if(!l&&s&&(s.currentScript&&"SCRIPT"===s.currentScript.tagName.toUpperCase()&&(l=s.currentScript.src),!l)){var f=s.getElementsByTagName("script");if(f.length)for(var p=f.length-1;p>-1&&(!l||!/^http(s?):/.test(l));)l=f[p--].src}if(!l)throw Error("Automatic publicPath is not supported in this browser");c.p=l.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var y={};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-license/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var r=window.location.pathname||"/",o=r.indexOf("/v2/");e=o>=0?r.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-license/dist/client/"}c.p=e}(),!function(){c.r(y),c.d(y,{default:function(){return L},PluginLicenseClient:function(){return D}});var e=c(342),t=c(155),n=c.n(t),r=c(59),o=c(625),a=JSON.parse('{"UU":"@nocobase/plugin-license"}');function i(){var t=(0,e.useApp)();return function(e,n){return String(t.i18n.t(e,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:[a.UU,"client"]},n||{})))}}var u=c(375);function l(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 s=function(o){var a,u=o.refreshToken,c=(0,e.useAPIClient)(),s=function(e){if(Array.isArray(e))return e}(a=(0,t.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(a)||function(e){if(e){if("string"==typeof e)return l(e,2);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 l(e,2)}}(a)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),f=s[0],p=s[1],y=i();return((0,t.useEffect)(function(){p(null),c.request({url:"/license:license-validate",method:"get"}).then(function(e){var t;p(null==e||null==(t=e.data)?void 0:t.data)}).catch(function(e){console.log(e)})},[u]),(null==f?void 0:f.licenseStatus)&&(null==f?void 0:f.licenseStatus)==="active")?(null==f?void 0:f.isServiceConnection)===!1&&(null==f?void 0:f.isPkgLogin)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary."),n().createElement("br",null),y("Plugins also cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")),type:"warning",style:{marginBottom:12}}):(null==f?void 0:f.isServiceConnection)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary.")),type:"warning",style:{marginBottom:12}}):(null==f?void 0:f.isPkgLogin)===!1?n().createElement(r.Alert,{message:y("Network error."),description:n().createElement(n().Fragment,null,y("Due to network issues, plugins cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")),type:"warning",style:{marginBottom:12}}):null:null},f=c(230),p=n().createContext(null);function d(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 h(e,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){h(a,r,o,i,u,"next",e)}function u(e){h(a,r,o,i,u,"throw",e)}i(void 0)})}}function m(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var v=function(){var o,a=(0,e.useAPIClient)(),u=function(e){if(Array.isArray(e))return e}(o=(0,t.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],a=!0,i=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),2!==o.length);a=!0);}catch(e){i=!0,n=e}finally{try{a||null==r.return||r.return()}finally{if(i)throw n}}return o}}(o)||function(e){if(e){if("string"==typeof e)return d(e,2);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 d(e,2)}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=u[0],l=u[1],s=(0,f.useForm)(),y=i(),h=n().useContext(p).onSaveSuccess;return{loading:c,onClick:function(){return b(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,null==s?void 0:s.validate()];case 1:var o;return t.sent(),[4,(o=null==(e=s.values)?void 0:e.licenseKey,b(function(){var e,t,i;return m(this,function(u){switch(u.label){case 0:l(!0),u.label=1;case 1:return u.trys.push([1,3,,4]),[4,a.request({url:"/license:license-key",method:"POST",data:{licenseKey:o}})];case 2:if(t=u.sent(),l(!1),"invalid"===(i=(null==t||null==(e=t.data)?void 0:e.data)||{}).keyStatus)return r.Modal.error({title:y("Invalid license key."),content:y("The license key is invalid. Please visit the NocoBase Service to obtain a new license key.")}),[2];if("invalid"===i.licenseStatus)return r.Modal.error({title:y("Invalid license key."),content:y("The current license key has been deprecated. Please visit the NocoBase Service to obtain a new license key.")}),[2];if(!1===i.envMatch)return r.Modal.error({title:y("Environment mismatch."),content:n().createElement(n().Fragment,null,!1===i.dbMatch&&!1===i.sysMatch&&n().createElement(n().Fragment,null,y("The current system and database do not match the licensed environment. Please use the new InstanceID to request a new license key.")),!0===i.dbMatch&&!1===i.sysMatch&&n().createElement(n().Fragment,null,y("The current system does not match the licensed system. Please use the new InstanceID to request a new license key.")),!1===i.dbMatch&&!0===i.sysMatch&&n().createElement(n().Fragment,null,y("The current database does not match the licensed database. Please use the new InstanceID to request a new license key.")))}),[2];if(!1===i.domainMatch)return r.Modal.error({title:y("Domain mismatch."),content:y("The current domain ({{domain}}) does not match the licensed domain. Please use the current domain to request a new license key.",{domain:i.current.domain,interpolation:{escapeValue:!1}})}),[2];if(null==h||h(),!0===i.isExpired)return r.message.success(y("The license key was saved successfully"),5),r.Modal.warning({title:y("The license has exceeded the upgrade validity period."),content:y("Plugins bound to this license can still be used but cannot be upgraded. To upgrade, please renew or repurchase the license.")}),[2];if(!1===i.isPkgLogin)return r.message.success(y("The license key was saved successfully"),5),r.Modal.warning({title:y("Network error."),content:y("Due to network issues, plugins cannot be updated automatically (they are still usable). To update plugins, please check your network connection or refer to the NocoBase Service documentation to upload plugins manually.")}),[2];return r.message.success(y("License key saved successfully. Please retry the plugin installation.")),[3,4];case 3:return u.sent(),l(!1),r.message.error(y("Network error. Please try again.")),[3,4];case 4:return[2]}})})())];case 2:return t.sent(),[2]}})})()}}};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,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){w(a,r,o,i,u,"next",e)}function u(e){w(a,r,o,i,u,"throw",e)}i(void 0)})}}function k(){return(k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,r=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw r}}return a}}(e,t)||function(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)}}(e,t)||function(){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,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var P=function(e){var t=e.text,n=e.onSuccess,r=e.onError;if(!navigator.clipboard){var o=document.createElement("textarea");o.value=t,o.style.top="0",o.style.left="0",o.style.position="fixed",document.body.appendChild(o),o.focus(),o.select();try{document.execCommand("copy"),null==n||n()}catch(e){null==r||r()}document.body.removeChild(o);return}navigator.clipboard.writeText(t).then(function(){null==n||n()}).catch(function(e){console.error(e),null==r||r()})};function E(){var o=(0,e.useAPIClient)(),a=x((0,t.useState)(!1),2),c=a[0],l=a[1],s=x((0,t.useState)(""),2);s[0],s[1];var f=i();return n().createElement(r.Button,{onClick:function(){return S(function(){return O(this,function(e){switch(e.label){case 0:return[4,S(function(){return O(this,function(e){return l(!0),[2,o.request({url:"/license:instance-id",method:"GET"}).then(function(e){var t;return null==e||null==(t=e.data)?void 0:t.data}).finally(function(){l(!1)})]})})()];case 1:return P({text:e.sent(),onSuccess:function(){r.message.success(f("Copied"))},onError:function(){r.message.error(f("Failed to copy, please open ./storage/.license/instance-id and copy it"))}}),[2]}})})()},loading:c,icon:n().createElement(u.CopyOutlined,null),type:"link"},f("Copy"))}var j=function(e){var a=e;if(null==a)throw TypeError("Cannot destructure "+a);var u=k({},e),c=x((0,t.useState)(!1),2),l=c[0],s=c[1],y=(0,f.useForm)(),d=i(),h=n().useContext(p).keyExist;return((0,o.useAsyncEffect)(function(){return S(function(){return O(this,function(e){return!1===h&&(s(!0),null==y||y.setFieldState("footer",function(e){e.visible=!0})),[2]})})()},[h]),l)?n().createElement(r.Input.TextArea,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}({rows:4},u)):h?n().createElement(n().Fragment,null,d("License key has been set"),"\xa0",n().createElement(r.Button,{onClick:function(){s(!0),null==y||y.setFieldState("footer",function(e){e.visible=!0})}},d("Change key"))):null},T=function(){var t=n().useContext(p),r=t.keyExist,o=t.refreshToken;return r?n().createElement(e.SchemaComponent,{key:o,schema:{type:"void",properties:{card:{type:"void","x-component":"LicenseCard"}}}}):null};function I(){var a=i(),u=x((0,t.useState)(0),2),c=u[0],l=u[1],f=x((0,t.useState)(null),2),y=f[0],d=f[1],h=(0,e.useAPIClient)();(0,o.useAsyncEffect)(function(){return S(function(){var e,t;return O(this,function(n){switch(n.label){case 0:return[4,h.request({url:"/license:is-exists",method:"GET"})];case 1:return d(null==(t=n.sent())||null==(e=t.data)?void 0:e.data),[2]}})})()},[]);var b={type:"void","x-decorator":"Form",properties:{form:{type:"void",properties:{label:{type:"string",title:a("Instance ID"),"x-component":"InstanceId","x-decorator":"FormItem"},licenseKey:{type:"string",title:a("License key"),required:!0,"x-component":"TextArea","x-decorator":"FormItem","x-component-props":{placeholder:a("Enter license key")}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{submit:{title:'{{t("Submit")}}',"x-component":"Action","x-use-component-props":"useSubmitProps","x-component-props":{type:"primary",style:{marginBottom:16}}}},"x-visible":!1},licenseInfo:{type:"void","x-component":"LicenseCardWarp"}}}}};return n().createElement(r.Card,{bordered:!1},n().createElement(p.Provider,{value:{onSaveSuccess:function(){l(function(e){return e+1}),d(!0)},keyExist:y,refreshToken:c}},n().createElement(s,{refreshToken:c}),n().createElement(e.SchemaComponent,{scope:{useSubmitProps:v},components:{InstanceId:E,TextArea:j,LicenseCardWarp:T},schema:{type:"void",properties:{form:b}}})))}function A(e,t,n,r,o,a,i){try{var u=e[a](i),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){A(a,r,o,i,u,"next",e)}function u(e){A(a,r,o,i,u,"throw",e)}i(void 0)})}}function _(e,t,n){return(_=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&q(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 q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=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,M(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),q(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}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:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}var D=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)&&"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,B()?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&&q(n,e),t=[{key:"afterAdd",value:function(){return C(function(){return N(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return C(function(){return N(this,function(e){return[2]})})()}},{key:"load",value:function(){return C(function(){return N(this,function(e){return this.app.pluginSettingsManager.add("license-settings",{title:"{{t(".concat(JSON.stringify("License settings"),", { ns: ['").concat(a.UU,"', 'client'], nsMode: 'fallback' })}}"),icon:"SolutionOutlined",Component:I,aclSnippet:"pm.license-settings"}),[2]})}).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}(F(e.Plugin)),L=D}(),y}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
12
|
+
"@nocobase/client": "2.1.0-alpha.14",
|
|
13
13
|
"antd": "5.24.2",
|
|
14
14
|
"ahooks": "3.7.8",
|
|
15
15
|
"@ant-design/icons": "5.6.1",
|
|
16
16
|
"@formily/react": "2.3.7",
|
|
17
17
|
"@nocobase/license-kit": "0.3.8",
|
|
18
18
|
"react-i18next": "11.18.6",
|
|
19
|
-
"@nocobase/server": "2.1.0-alpha.
|
|
19
|
+
"@nocobase/server": "2.1.0-alpha.14",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
|
-
"koa": "3.
|
|
21
|
+
"koa": "3.2.0",
|
|
22
22
|
"axios": "1.7.7",
|
|
23
|
-
"@nocobase/logger": "2.1.0-alpha.
|
|
23
|
+
"@nocobase/logger": "2.1.0-alpha.14"
|
|
24
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-license",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.14",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "License settings",
|
|
6
6
|
"displayName.ru-RU": "Настройки лицензии",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"ts:env": "tsc -p tsconfig.env.json"
|
|
18
18
|
},
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "d8735b541de0ff9557bba704de49c799b4962672"
|
|
21
21
|
}
|