@nocobase/server 2.1.0-alpha.23 → 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.
@@ -147,7 +147,15 @@ async function listEnabledPlugins(ctx, lane = "client") {
147
147
  }
148
148
  __name(listEnabledPlugins, "listEnabledPlugins");
149
149
  function normalizePmPluginKeys(filterByTk) {
150
- 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
+ );
151
159
  }
152
160
  __name(normalizePmPluginKeys, "normalizePmPluginKeys");
153
161
  function coerceAwaitResponse(value) {
@@ -240,9 +248,6 @@ var resource_default = {
240
248
  async enable(ctx, next) {
241
249
  const { filterByTk, awaitResponse: awaitResponseRaw } = ctx.action.params;
242
250
  const app = ctx.app;
243
- if (filterByTk == null || filterByTk === "" || typeof filterByTk !== "string") {
244
- ctx.throw(400, "plugin name invalid");
245
- }
246
251
  const keys = normalizePmPluginKeys(filterByTk);
247
252
  if (!keys.length) {
248
253
  ctx.throw(400, "plugin name invalid");
@@ -262,9 +267,6 @@ var resource_default = {
262
267
  async disable(ctx, next) {
263
268
  const { filterByTk, awaitResponse: awaitResponseRaw } = ctx.action.params;
264
269
  const app = ctx.app;
265
- if (filterByTk == null || filterByTk === "" || typeof filterByTk !== "string") {
266
- ctx.throw(400, "plugin name invalid");
267
- }
268
270
  const keys = normalizePmPluginKeys(filterByTk);
269
271
  if (!keys.length) {
270
272
  ctx.throw(400, "plugin name invalid");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.1.0-alpha.23",
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.23",
14
- "@nocobase/actions": "2.1.0-alpha.23",
15
- "@nocobase/ai": "2.1.0-alpha.23",
16
- "@nocobase/auth": "2.1.0-alpha.23",
17
- "@nocobase/cache": "2.1.0-alpha.23",
18
- "@nocobase/data-source-manager": "2.1.0-alpha.23",
19
- "@nocobase/database": "2.1.0-alpha.23",
20
- "@nocobase/evaluators": "2.1.0-alpha.23",
21
- "@nocobase/lock-manager": "2.1.0-alpha.23",
22
- "@nocobase/logger": "2.1.0-alpha.23",
23
- "@nocobase/resourcer": "2.1.0-alpha.23",
24
- "@nocobase/sdk": "2.1.0-alpha.23",
25
- "@nocobase/snowflake-id": "2.1.0-alpha.23",
26
- "@nocobase/telemetry": "2.1.0-alpha.23",
27
- "@nocobase/utils": "2.1.0-alpha.23",
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": "baa19dafe25e85b680b2fea7451f202831930c1c"
64
+ "gitHead": "effaf56a9b9ea2d40200c4c10854a84d9622f071"
65
65
  }