@nocobase/server 2.1.0-alpha.22 → 2.1.0-alpha.24

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.
@@ -67,10 +67,17 @@ const _PackageUrls = class _PackageUrls {
67
67
  }
68
68
  static async get(packageName, lane = "client") {
69
69
  const cacheKey = this.getCacheKey(packageName, lane);
70
- if (!this.items[cacheKey]) {
71
- this.items[cacheKey] = await this.fetch(packageName, lane);
70
+ const cached = this.items[cacheKey];
71
+ if (cached) {
72
+ return cached;
72
73
  }
73
- return this.items[cacheKey];
74
+ const nextUrl = await this.fetch(packageName, lane);
75
+ if (nextUrl == null ? void 0 : nextUrl.includes("?hash=")) {
76
+ this.items[cacheKey] = nextUrl;
77
+ } else {
78
+ delete this.items[cacheKey];
79
+ }
80
+ return nextUrl;
74
81
  }
75
82
  static async hasClientEntry(packageName, lane) {
76
83
  const pkgPath = import_path.default.resolve(process.env.NODE_MODULES_PATH, packageName);
@@ -140,7 +147,15 @@ async function listEnabledPlugins(ctx, lane = "client") {
140
147
  }
141
148
  __name(listEnabledPlugins, "listEnabledPlugins");
142
149
  function normalizePmPluginKeys(filterByTk) {
143
- return filterByTk.split(",").map((k) => k.trim()).filter(Boolean);
150
+ if (typeof filterByTk === "string") {
151
+ return filterByTk.split(",").map((k) => k.trim()).filter(Boolean);
152
+ }
153
+ if (!Array.isArray(filterByTk) || filterByTk.some((item) => typeof item !== "string")) {
154
+ return [];
155
+ }
156
+ return filterByTk.flatMap(
157
+ (item) => item.split(",").map((k) => k.trim()).filter(Boolean)
158
+ );
144
159
  }
145
160
  __name(normalizePmPluginKeys, "normalizePmPluginKeys");
146
161
  function coerceAwaitResponse(value) {
@@ -233,9 +248,6 @@ var resource_default = {
233
248
  async enable(ctx, next) {
234
249
  const { filterByTk, awaitResponse: awaitResponseRaw } = ctx.action.params;
235
250
  const app = ctx.app;
236
- if (filterByTk == null || filterByTk === "" || typeof filterByTk !== "string") {
237
- ctx.throw(400, "plugin name invalid");
238
- }
239
251
  const keys = normalizePmPluginKeys(filterByTk);
240
252
  if (!keys.length) {
241
253
  ctx.throw(400, "plugin name invalid");
@@ -255,9 +267,6 @@ var resource_default = {
255
267
  async disable(ctx, next) {
256
268
  const { filterByTk, awaitResponse: awaitResponseRaw } = ctx.action.params;
257
269
  const app = ctx.app;
258
- if (filterByTk == null || filterByTk === "" || typeof filterByTk !== "string") {
259
- ctx.throw(400, "plugin name invalid");
260
- }
261
270
  const keys = normalizePmPluginKeys(filterByTk);
262
271
  if (!keys.length) {
263
272
  ctx.throw(400, "plugin name invalid");
@@ -302,7 +302,7 @@ const _PluginManager = class _PluginManager {
302
302
  if (options == null ? void 0 : options.forceRecreate) {
303
303
  await import_fs_extra.default.rm(pluginDir, { recursive: true, force: true });
304
304
  }
305
- const { PluginGenerator } = require("@nocobase/cli/src/plugin-generator");
305
+ const { PluginGenerator } = require("@nocobase/cli-v1/src/plugin-generator");
306
306
  const generator = new PluginGenerator({
307
307
  cwd: process.cwd(),
308
308
  args: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.1.0-alpha.22",
3
+ "version": "2.1.0-alpha.24",
4
4
  "main": "lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,21 +10,21 @@
10
10
  "@koa/cors": "^5.0.0",
11
11
  "@koa/multer": "^3.1.0",
12
12
  "@koa/router": "^13.1.0",
13
- "@nocobase/acl": "2.1.0-alpha.22",
14
- "@nocobase/actions": "2.1.0-alpha.22",
15
- "@nocobase/ai": "2.1.0-alpha.22",
16
- "@nocobase/auth": "2.1.0-alpha.22",
17
- "@nocobase/cache": "2.1.0-alpha.22",
18
- "@nocobase/data-source-manager": "2.1.0-alpha.22",
19
- "@nocobase/database": "2.1.0-alpha.22",
20
- "@nocobase/evaluators": "2.1.0-alpha.22",
21
- "@nocobase/lock-manager": "2.1.0-alpha.22",
22
- "@nocobase/logger": "2.1.0-alpha.22",
23
- "@nocobase/resourcer": "2.1.0-alpha.22",
24
- "@nocobase/sdk": "2.1.0-alpha.22",
25
- "@nocobase/snowflake-id": "2.1.0-alpha.22",
26
- "@nocobase/telemetry": "2.1.0-alpha.22",
27
- "@nocobase/utils": "2.1.0-alpha.22",
13
+ "@nocobase/acl": "2.1.0-alpha.24",
14
+ "@nocobase/actions": "2.1.0-alpha.24",
15
+ "@nocobase/ai": "2.1.0-alpha.24",
16
+ "@nocobase/auth": "2.1.0-alpha.24",
17
+ "@nocobase/cache": "2.1.0-alpha.24",
18
+ "@nocobase/data-source-manager": "2.1.0-alpha.24",
19
+ "@nocobase/database": "2.1.0-alpha.24",
20
+ "@nocobase/evaluators": "2.1.0-alpha.24",
21
+ "@nocobase/lock-manager": "2.1.0-alpha.24",
22
+ "@nocobase/logger": "2.1.0-alpha.24",
23
+ "@nocobase/resourcer": "2.1.0-alpha.24",
24
+ "@nocobase/sdk": "2.1.0-alpha.24",
25
+ "@nocobase/snowflake-id": "2.1.0-alpha.24",
26
+ "@nocobase/telemetry": "2.1.0-alpha.24",
27
+ "@nocobase/utils": "2.1.0-alpha.24",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "a1ac28a12fd06c1233f2f7b062c90c0c9bb64222"
64
+ "gitHead": "effaf56a9b9ea2d40200c4c10854a84d9622f071"
65
65
  }