@nocobase/plugin-license 2.1.0-alpha.40 → 2.1.0-alpha.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client-v2.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
package/client-v2.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ "use strict";(self.webpackChunk_nocobase_plugin_license_client_v2=self.webpackChunk_nocobase_plugin_license_client_v2||[]).push([["710"],{141:function(e,t,n){n.r(t),n.d(t,{default:function(){return p}});var r=n(375),a=n(694),l=n(59),o=n(155),s=n.n(o);function i(){var e=(0,a.useFlowEngine)();return function(t,n){return e.context.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({ns:["@nocobase/plugin-license","client"]},n))}}function c(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 u(e,t,n,r,a,l,o){try{var s=e[l](o),i=s.value}catch(e){n(e);return}s.done?t(i):Promise.resolve(i).then(r,a)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var l=e.apply(t,n);function o(e){u(l,r,a,o,s,"next",e)}function s(e){u(l,r,a,o,s,"throw",e)}o(void 0)})}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,s=!1;try{for(a=a.call(e);!(o=(n=a.next()).done)&&(l.push(n.value),!t||l.length!==t);o=!0);}catch(e){s=!0,r=e}finally{try{o||null==a.return||a.return()}finally{if(s)throw r}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(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 c(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 f(e,t){var n,r,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),s=Object.defineProperty;return s(o,"next",{value:i(0)}),s(o,"throw",{value:i(1)}),s(o,"return",{value:i(2)}),"function"==typeof Symbol&&s(o,Symbol.iterator,{value:function(){return this}}),o;function i(s){return function(i){var c=[s,i];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(n=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,r=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],r=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function m(e){var t=e.refreshToken,n=i(),r=(0,a.useFlowContext)().api,c=y((0,o.useState)(null),2),u=c[0],d=c[1];return(0,o.useEffect)(function(){var e=!0;return d(null),r.request({url:"/license:license-validate",method:"get"}).then(function(t){if(e){var n;d((null==t||null==(n=t.data)?void 0:n.data)||null)}}).catch(function(e){console.log(e)}),function(){e=!1}},[r,t]),(0,o.useMemo)(function(){return(null==u?void 0:u.licenseStatus)&&"active"===u.licenseStatus?!1===u.isServiceConnection&&!1===u.isPkgLogin?s().createElement(l.Alert,{message:n("Network error."),description:s().createElement(s().Fragment,null,n("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary."),s().createElement("br",null),n("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}}):!1===u.isServiceConnection?s().createElement(l.Alert,{message:n("Network error."),description:n("Due to network issues, the license key cannot be updated automatically. Please update it manually if necessary."),type:"warning",style:{marginBottom:12}}):!1===u.isPkgLogin?s().createElement(l.Alert,{message:n("Network error."),description:n("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},[u,n])}function p(){var e=i(),t=(0,a.useFlowContext)(),n=t.api,c=t.app,u=l.App.useApp(),p=u.message,h=u.modal,b=y(l.Form.useForm(),1)[0],v=y((0,o.useState)(!0),2),g=v[0],k=v[1],w=y((0,o.useState)(!1),2),E=w[0],S=w[1],T=y((0,o.useState)(null),2),C=T[0],P=T[1],F=y((0,o.useState)(!1),2),I=F[0],x=F[1],O=y((0,o.useState)(0),2),A=O[0],j=O[1],q=y((0,o.useState)(""),2),B=q[0],D=q[1],M=y((0,o.useState)(!1),2),N=M[0],_=M[1];(0,o.useEffect)(function(){var e=!0;return k(!0),d(function(){var t,r,a;return f(this,function(l){switch(l.label){case 0:return l.trys.push([0,2,3,4]),[4,n.request({url:"/license:is-exists",method:"GET"})];case 1:if(r=l.sent(),!e)return[2];return P(a=!!(null==r||null==(t=r.data)?void 0:t.data)),x(!a),[3,4];case 2:return console.log(l.sent()),[3,4];case 3:return e&&k(!1),[7];case 4:return[2]}})})(),function(){e=!1}},[n]),(0,o.useEffect)(function(){var e=!0;return n.request({url:"/license:instance-id",method:"GET"}).then(function(t){if(e){var n;D(String((null==t||null==(n=t.data)?void 0:n.data)||""))}}).catch(function(e){console.log(e)}),function(){e=!1}},[n]);var L=(0,o.useCallback)(function(){return d(function(){var t,r,a;return f(this,function(l){switch(l.label){case 0:_(!0),l.label=1;case 1:if(l.trys.push([1,5,6,7]),t=B)return[3,3];return[4,n.request({url:"/license:instance-id",method:"GET"})];case 2:D(t=String((null==(a=l.sent())||null==(r=a.data)?void 0:r.data)||"")),l.label=3;case 3:var o;return[4,(o=t,d(function(){var e,t;return f(this,function(n){switch(n.label){case 0:if(!o)return[2,!1];n.label=1;case 1:if(n.trys.push([1,4,,5]),!(null==(e=navigator.clipboard)?void 0:e.writeText))return[3,3];return[4,navigator.clipboard.writeText(o)];case 2:return n.sent(),[2,!0];case 3:return[3,5];case 4:return n.sent(),[3,5];case 5:(t=document.createElement("textarea")).value=o,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return[2,document.execCommand("copy")]}catch(e){return[2,!1]}finally{document.body.removeChild(t)}}})})())];case 4:if(l.sent())return p.success(e("Copied")),[2];return p.error(e("Failed to copy, please open ./storage/.license/instance-id and copy it")),[3,7];case 5:return l.sent(),p.error(e("Failed to copy, please open ./storage/.license/instance-id and copy it")),[3,7];case 6:return _(!1),[7];case 7:return[2]}})})()},[n,B,p,e]),G=(0,o.useCallback)(function(t){return d(function(){var r,a,l,o;return f(this,function(i){switch(i.label){case 0:S(!0),i.label=1;case 1:return i.trys.push([1,3,4,5]),[4,n.request({url:"/license:license-key",method:"POST",data:{licenseKey:t}})];case 2:if("invalid"===(l=(null==(a=i.sent())||null==(r=a.data)?void 0:r.data)||{}).keyStatus)return h.error({title:e("Invalid license key."),content:e("The license key is invalid. Please visit the NocoBase Service to obtain a new license key.")}),[2];if("invalid"===l.licenseStatus)return h.error({title:e("Invalid license key."),content:e("The current license key has been deprecated. Please visit the NocoBase Service to obtain a new license key.")}),[2];if(!1===l.envMatch)return h.error({title:e("Environment mismatch."),content:s().createElement(s().Fragment,null,!1===l.dbMatch&&!1===l.sysMatch?s().createElement(s().Fragment,null,e("The current system and database do not match the licensed environment. Please use the new InstanceID to request a new license key.")):null,!0===l.dbMatch&&!1===l.sysMatch?s().createElement(s().Fragment,null,e("The current system does not match the licensed system. Please use the new InstanceID to request a new license key.")):null,!1===l.dbMatch&&!0===l.sysMatch?s().createElement(s().Fragment,null,e("The current database does not match the licensed database. Please use the new InstanceID to request a new license key.")):null)}),[2];if(!1===l.domainMatch)return h.error({title:e("Domain mismatch."),content:e("The current domain ({{domain}}) does not match the licensed domain. Please use the current domain to request a new license key.",{domain:null==(o=l.current)?void 0:o.domain,interpolation:{escapeValue:!1}})}),[2];if(P(!0),x(!1),j(function(e){return e+1}),b.resetFields(),!0===l.isExpired)return p.success(e("The license key was saved successfully"),5),h.warning({title:e("The license has exceeded the upgrade validity period."),content:e("Plugins bound to this license can still be used but cannot be upgraded. To upgrade, please renew or repurchase the license.")}),[2];if(!1===l.isPkgLogin)return p.success(e("The license key was saved successfully"),5),h.warning({title:e("Network error."),content:e("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 p.success(e("The license key has been saved successfully. Please restart the service, and the system will automatically install the plugin.")),[3,5];case 3:return i.sent(),p.error(e("Network error. Please try again.")),[3,5];case 4:return S(!1),[7];case 5:return[2]}})})()},[n,b,p,h,e]),K=(0,o.useCallback)(function(){return d(function(){return f(this,function(e){switch(e.label){case 0:return[4,b.validateFields()];case 1:return[4,G(e.sent().licenseKey)];case 2:return e.sent(),[2]}})})()},[b,G]),U=c.getComponent("LicenseCard",!1),V=!!(U&&C);return s().createElement(l.Card,{bordered:!1},s().createElement(l.Spin,{spinning:g},s().createElement(m,{refreshToken:A}),s().createElement(l.Form,{form:b,layout:"vertical"},s().createElement(l.Form.Item,{label:e("Instance ID")},s().createElement(l.Button,{onClick:L,icon:s().createElement(r.CopyOutlined,null),type:"link",loading:N},e("Copy"))),s().createElement(l.Form.Item,{label:e("License key"),required:I},I?s().createElement(l.Form.Item,{name:"licenseKey",noStyle:!0,rules:[{required:!0,message:e("Enter license key")}]},s().createElement(l.Input.TextArea,{rows:4,placeholder:e("Enter license key")})):C?s().createElement(s().Fragment,null,e("License key has been set"),"\xa0",s().createElement(l.Button,{onClick:function(){return x(!0)}},e("Change key"))):null),I?s().createElement(l.Form.Item,null,s().createElement(l.Button,{type:"primary",loading:E,onClick:K},e("Submit"))):null),V?s().createElement(U,{key:A}):null))}}}]);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export { default } from './plugin';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-license/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-license/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-license/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,c,u,a={375:function(e){e.exports=r},485:function(t){t.exports=e},694:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},l={};function s(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return a[e](n,n.exports,s),n.exports}s.m=a,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce(function(t,n){return s.f[n](e,t),t},[]))},s.u=function(e){return""+e+".9271adce3d7f2397.js"},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},s.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var a=c[u];if(a.getAttribute("src")==e||a.getAttribute("data-rspack")=="@nocobase/plugin-license/client-v2:"+n){o=a;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-rspack","@nocobase/plugin-license/client-v2:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(p);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.g.importScripts&&(p=s.g.location+"");var f,p,b=s.g.document;if(!p&&b&&(b.currentScript&&"SCRIPT"===b.currentScript.tagName.toUpperCase()&&(p=b.currentScript.src),!p)){var d=b.getElementsByTagName("script");if(d.length)for(var v=d.length-1;v>-1&&(!p||!/^http(s?):/.test(p));)p=d[v--].src}if(!p)throw Error("Automatic publicPath is not supported in this browser");s.p=p.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},s.f.j=function(e,t){var n=s.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=s.p+s.u(e),c=Error();s.l(o,function(t){if(s.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",c.name="ChunkLoadError",c.type=r,c.request=o,n[1](c)}},"chunk-"+e,e)}},c=function(e,t){var n,r,o=t[0],c=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==i[e]})){for(n in c)s.o(c,n)&&(s.m[n]=c[n]);u&&u(s)}for(e&&e(t);a<o.length;a++)r=o[a],s.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(u=self.webpackChunk_nocobase_plugin_license_client_v2=self.webpackChunk_nocobase_plugin_license_client_v2||[]).forEach(c.bind(null,0)),u.push=c.bind(null,u.push.bind(u));var h={};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-v2/")}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-v2/"}s.p=e}(),!function(){s.r(h),s.d(h,{default:function(){return u}});var e=s(485);function t(e,t,n,r,o,i,c){try{var u=e[i](c),a=u.value}catch(e){n(e);return}u.done?t(a):Promise.resolve(a).then(r,o)}function n(e,t,r){return(n=c()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function c(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(c=function(){return!!e})()}var u=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(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,c()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(n)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(t){return e=this.t("License settings"),this.pluginSettingsManager.addMenuItem({key:"license-settings",title:e,icon:"SolutionOutlined",aclSnippet:"pm.license-settings"}),this.pluginSettingsManager.addPageTabItem({menuKey:"license-settings",key:"index",title:e,aclSnippet:"pm.license-settings",componentLoader:function(){return s.e("710").then(s.bind(s,141))}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var c=e.apply(n,r);function u(e){t(c,o,i,u,a,"next",e)}function a(e){t(c,o,i,u,a,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(i(e.Plugin))}(),h}()});
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare function useT(): (key: string, options?: Record<string, any>) => string;
10
+ export declare function tExpr(key: string): string;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export default function LicenseSetting(): React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Application } from '@nocobase/client-v2';
10
+ import { Plugin } from '@nocobase/client-v2';
11
+ export declare class PluginLicenseClientV2 extends Plugin<Record<string, never>, Application> {
12
+ load(): Promise<void>;
13
+ }
14
+ export default PluginLicenseClientV2;
@@ -9,17 +9,19 @@
9
9
 
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
- "@nocobase/client": "2.1.0-alpha.40",
12
+ "@nocobase/client": "2.1.0-alpha.45",
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.40",
19
+ "@nocobase/flow-engine": "2.1.0-alpha.45",
20
+ "@nocobase/client-v2": "2.1.0-alpha.45",
21
+ "@nocobase/server": "2.1.0-alpha.45",
20
22
  "lodash": "4.18.1",
21
- "@nocobase/utils": "2.1.0-alpha.40",
23
+ "@nocobase/utils": "2.1.0-alpha.45",
22
24
  "koa": "3.2.0",
23
25
  "axios": "1.7.7",
24
- "@nocobase/logger": "2.1.0-alpha.40"
26
+ "@nocobase/logger": "2.1.0-alpha.45"
25
27
  };
@@ -33,5 +33,15 @@
33
33
  "Please go to the": "Please go to the",
34
34
  "License Settings": "License Settings",
35
35
  "page to enter the license key.": "page to enter the license key.",
36
- "License information": "License information"
37
- }
36
+ "License information": "License information",
37
+ "Status": "Status",
38
+ "Active": "Active",
39
+ "Invalid": "Invalid",
40
+ "Current domain": "Current domain",
41
+ "Service connection": "Service connection",
42
+ "Plugin service login": "Plugin service login",
43
+ "Connected": "Connected",
44
+ "Disconnected": "Disconnected",
45
+ "Submit": "Submit",
46
+ "Network error. Please try again.": "Network error. Please try again."
47
+ }
@@ -33,5 +33,15 @@
33
33
  "Please go to the": "请前往",
34
34
  "License Settings": "授权设置",
35
35
  "page to enter the license key.": "页面填写授权密钥。",
36
- "License information": "授权信息"
37
- }
36
+ "License information": "授权信息",
37
+ "Status": "状态",
38
+ "Active": "有效",
39
+ "Invalid": "无效",
40
+ "Current domain": "当前域名",
41
+ "Service connection": "服务连接",
42
+ "Plugin service login": "插件服务登录",
43
+ "Connected": "已连接",
44
+ "Disconnected": "未连接",
45
+ "Submit": "提交",
46
+ "Network error. Please try again.": "网络错误,请重试。"
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-license",
3
- "version": "2.1.0-alpha.40",
3
+ "version": "2.1.0-alpha.45",
4
4
  "main": "dist/server/index.js",
5
5
  "displayName": "License settings",
6
6
  "displayName.ru-RU": "Настройки лицензии",
@@ -10,6 +10,7 @@
10
10
  "description.zh-CN": "实例 ID 和授权密钥设置",
11
11
  "peerDependencies": {
12
12
  "@nocobase/client": "2.x",
13
+ "@nocobase/client-v2": "2.x",
13
14
  "@nocobase/server": "2.x",
14
15
  "@nocobase/test": "2.x"
15
16
  },
@@ -17,5 +18,5 @@
17
18
  "ts:env": "tsc -p tsconfig.env.json"
18
19
  },
19
20
  "license": "Apache-2.0",
20
- "gitHead": "e73f99dd0abefe847f2e50ff0fea1f41a82fd048"
21
+ "gitHead": "e9e24987e12d0ad10a5db8815b1e1b7b447f1938"
21
22
  }