@nocobase/plugin-license 2.1.0-alpha.6 → 2.1.0-alpha.7

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.
@@ -9,16 +9,16 @@
9
9
 
10
10
  module.exports = {
11
11
  "react": "18.2.0",
12
- "@nocobase/client": "2.1.0-alpha.6",
12
+ "@nocobase/client": "2.1.0-alpha.7",
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.7",
18
18
  "react-i18next": "11.18.6",
19
- "@nocobase/server": "2.1.0-alpha.6",
19
+ "@nocobase/server": "2.1.0-alpha.7",
20
20
  "lodash": "4.17.21",
21
21
  "koa": "2.16.0",
22
22
  "axios": "1.7.7",
23
- "@nocobase/logger": "2.1.0-alpha.6"
23
+ "@nocobase/logger": "2.1.0-alpha.7"
24
24
  };
@@ -20,6 +20,7 @@ export interface KeyData {
20
20
  displayName: string;
21
21
  packageName: string;
22
22
  updateExpirationDate?: string;
23
+ openSource?: boolean;
23
24
  }>;
24
25
  instanceData: {
25
26
  timestamp: string;
@@ -43,7 +43,7 @@ module.exports = __toCommonJS(plugin_exports);
43
43
  var import_sortBy = __toESM(require("lodash/sortBy"));
44
44
  var import_key = require("./key");
45
45
  async function getPlugins({ keyData, ctx }) {
46
- var _a;
46
+ var _a, _b, _c;
47
47
  const locale = ctx.getCurrentLocale();
48
48
  const plugin = ctx.app.pm.get("nocobase");
49
49
  const localPlugins = await plugin.getAllPlugins(locale);
@@ -56,7 +56,13 @@ async function getPlugins({ keyData, ctx }) {
56
56
  enabled: p.options.enabled
57
57
  });
58
58
  }
59
- const licensedPlugins = (keyData == null ? void 0 : keyData.plugins) || [];
59
+ let licensedPlugins = (keyData == null ? void 0 : keyData.plugins) || [];
60
+ const isVer2 = await ((_b = (_a = ctx == null ? void 0 : ctx.app) == null ? void 0 : _a.version) == null ? void 0 : _b.satisfies(">=2.0.0"));
61
+ if (isVer2) {
62
+ licensedPlugins = licensedPlugins.filter((plugin2) => {
63
+ return !(plugin2 == null ? void 0 : plugin2.openSource);
64
+ });
65
+ }
60
66
  const allCommericalPluginNames = [...licensedPlugins.map((p) => p.packageName)];
61
67
  localPlugins.forEach((p) => {
62
68
  const instance = currentPluginInstances == null ? void 0 : currentPluginInstances.find((plugin2) => plugin2.packageName === p.packageName);
@@ -73,7 +79,7 @@ async function getPlugins({ keyData, ctx }) {
73
79
  const plugins = [];
74
80
  for (const name of installedCommericalPlugins) {
75
81
  let status = "unlicensed";
76
- const expirationDate = (_a = licensedPlugins == null ? void 0 : licensedPlugins.find((p) => p.packageName === name)) == null ? void 0 : _a.updateExpirationDate;
82
+ const expirationDate = (_c = licensedPlugins == null ? void 0 : licensedPlugins.find((p) => p.packageName === name)) == null ? void 0 : _c.updateExpirationDate;
77
83
  if (expirationDate) {
78
84
  const isExpired = (0, import_key.isDateExpired)(expirationDate);
79
85
  if (isExpired) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-license",
3
- "version": "2.1.0-alpha.6",
3
+ "version": "2.1.0-alpha.7",
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": "189dc0eb7683a8330db1e4c5fd46ee871b8b4e1f"
20
+ "gitHead": "fe825ef778c0d9a941e8517d6443ffc012238391"
21
21
  }