@nocobase/plugin-license 2.1.0-alpha.17 → 2.1.0-alpha.19
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/externalVersion.js
CHANGED
|
@@ -9,16 +9,17 @@
|
|
|
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.19",
|
|
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.
|
|
20
|
-
"lodash": "4.
|
|
19
|
+
"@nocobase/server": "2.1.0-alpha.19",
|
|
20
|
+
"lodash": "4.18.1",
|
|
21
|
+
"@nocobase/utils": "2.1.0-alpha.19",
|
|
21
22
|
"koa": "3.2.0",
|
|
22
23
|
"axios": "1.7.7",
|
|
23
|
-
"@nocobase/logger": "2.1.0-alpha.
|
|
24
|
+
"@nocobase/logger": "2.1.0-alpha.19"
|
|
24
25
|
};
|
|
@@ -43,9 +43,10 @@ __export(instance_exports, {
|
|
|
43
43
|
module.exports = __toCommonJS(instance_exports);
|
|
44
44
|
var import_fs = __toESM(require("fs"));
|
|
45
45
|
var import_path = __toESM(require("path"));
|
|
46
|
+
var import_utils = require("@nocobase/utils");
|
|
46
47
|
var import_child_process = require("child_process");
|
|
47
48
|
async function getInstanceId() {
|
|
48
|
-
const dir =
|
|
49
|
+
const dir = (0, import_utils.storagePathJoin)(".license");
|
|
49
50
|
const filePath = import_path.default.resolve(dir, "instance-id");
|
|
50
51
|
await createInstanceId(true);
|
|
51
52
|
const id = import_fs.default.readFileSync(filePath, "utf-8");
|
|
@@ -63,7 +64,7 @@ async function createInstanceId(force = false) {
|
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
async function isLicenseKeyExists() {
|
|
66
|
-
const dir =
|
|
67
|
+
const dir = (0, import_utils.storagePathJoin)(".license");
|
|
67
68
|
const filePath = import_path.default.resolve(dir, "license-key");
|
|
68
69
|
return import_fs.default.existsSync(filePath);
|
|
69
70
|
}
|
package/dist/server/utils/key.js
CHANGED
|
@@ -48,6 +48,7 @@ __export(key_exports, {
|
|
|
48
48
|
module.exports = __toCommonJS(key_exports);
|
|
49
49
|
var import_license_kit = require("@nocobase/license-kit");
|
|
50
50
|
var import_path = __toESM(require("path"));
|
|
51
|
+
var import_utils = require("@nocobase/utils");
|
|
51
52
|
var import_fs = __toESM(require("fs"));
|
|
52
53
|
var import_interface2 = require("./interface");
|
|
53
54
|
var import_axios = __toESM(require("axios"));
|
|
@@ -88,7 +89,7 @@ async function request({
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
async function saveLicenseKey(licenseKey, ctx) {
|
|
91
|
-
const dir =
|
|
92
|
+
const dir = (0, import_utils.storagePathJoin)(".license");
|
|
92
93
|
const filePath = import_path.default.resolve(dir, "license-key");
|
|
93
94
|
await import_fs.default.promises.writeFile(filePath, licenseKey);
|
|
94
95
|
if (ctx && ctx.cache) {
|
|
@@ -97,7 +98,7 @@ async function saveLicenseKey(licenseKey, ctx) {
|
|
|
97
98
|
}
|
|
98
99
|
}
|
|
99
100
|
async function getLocalKeyData() {
|
|
100
|
-
const keyFile =
|
|
101
|
+
const keyFile = (0, import_utils.storagePathJoin)(".license", "license-key");
|
|
101
102
|
try {
|
|
102
103
|
const key = (await import_fs.default.promises.readFile(keyFile, "utf8")).trim();
|
|
103
104
|
return JSON.parse((0, import_license_kit.keyDecrypt)(key));
|
|
@@ -108,7 +109,7 @@ async function getLocalKeyData() {
|
|
|
108
109
|
async function getKey(ctx) {
|
|
109
110
|
var _a, _b;
|
|
110
111
|
let key;
|
|
111
|
-
const keyFile =
|
|
112
|
+
const keyFile = (0, import_utils.storagePathJoin)(".license", "license-key");
|
|
112
113
|
if (ctx == null ? void 0 : ctx.cache) {
|
|
113
114
|
try {
|
|
114
115
|
key = await ctx.cache.get(import_interface2.CACHE_KEY);
|
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.19",
|
|
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": "3d13700360eac1c0f9dbf6a5f167ed396a294a3c"
|
|
21
21
|
}
|