@nocobase/server 2.2.0-alpha.1 → 2.2.0-alpha.2

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.
@@ -47,7 +47,7 @@ const deps = {
47
47
  koa: "3.x",
48
48
  "@koa/cors": "5.x",
49
49
  "@koa/router": "13.x",
50
- multer: "1.x",
50
+ multer: "2.x",
51
51
  "@koa/multer": "3.x",
52
52
  "koa-bodyparser": "4.x",
53
53
  "koa-static": "5.x",
@@ -302,12 +302,19 @@ var resource_default = {
302
302
  if (!keys.length) {
303
303
  ctx.throw(400, "plugin name invalid");
304
304
  }
305
+ for (const key of keys) {
306
+ try {
307
+ (0, import_utils2.assertSafePluginPackageName)(key);
308
+ } catch (error) {
309
+ ctx.throw(400, "plugin name invalid");
310
+ }
311
+ }
305
312
  const awaitResponse = coerceAwaitResponse(awaitResponseRaw);
306
313
  const argv = ["pm", "enable", ...keys];
307
314
  if (awaitResponse) {
308
315
  await app.runAsCLI(argv, { from: "user", throwError: true });
309
316
  } else {
310
- void app.runAsCLI(argv, { from: "user" }).catch((err) => {
317
+ app.runAsCLI(argv, { from: "user" }).catch((err) => {
311
318
  app.log.error(err);
312
319
  });
313
320
  }
@@ -326,7 +333,7 @@ var resource_default = {
326
333
  if (awaitResponse) {
327
334
  await app.runAsCLI(argv, { from: "user", throwError: true });
328
335
  } else {
329
- void app.runAsCLI(argv, { from: "user" }).catch((err) => {
336
+ app.runAsCLI(argv, { from: "user" }).catch((err) => {
330
337
  app.log.error(err);
331
338
  });
332
339
  }
@@ -344,7 +351,7 @@ var resource_default = {
344
351
  await next();
345
352
  },
346
353
  async list(ctx, next) {
347
- const { mode } = ctx.action.params;
354
+ const { mode, v2 } = ctx.action.params;
348
355
  if (mode === "summary") {
349
356
  ctx.body = await (0, import_utils2.pmListSummary)(ctx.app);
350
357
  return next();
@@ -352,7 +359,18 @@ var resource_default = {
352
359
  const locale = ctx.getCurrentLocale();
353
360
  const pm = ctx.app.pm;
354
361
  const plugin = pm.get("nocobase");
355
- ctx.body = await plugin.getAllPlugins(locale);
362
+ const plugins = await plugin.getAllPlugins(locale);
363
+ ctx.body = plugins.filter((item) => {
364
+ var _a;
365
+ if (process.env.NOCOBASE_SHOW_DEPRECATED_PLUGINS === "true") {
366
+ return true;
367
+ }
368
+ if (!v2) {
369
+ return true;
370
+ }
371
+ const nocobaseConfig = ((_a = item == null ? void 0 : item.packageJson) == null ? void 0 : _a.nocobase) || {};
372
+ return nocobaseConfig.internal !== true && nocobaseConfig.deprecated !== true;
373
+ });
356
374
  await next();
357
375
  },
358
376
  async listEnabled(ctx, next) {
@@ -233,6 +233,7 @@ const _PluginManager = class _PluginManager {
233
233
  }
234
234
  }
235
235
  static async parseName(nameOrPkg) {
236
+ (0, import_utils2.assertSafePluginPackageName)(nameOrPkg);
236
237
  if (this.parsedNames[nameOrPkg]) {
237
238
  return this.parsedNames[nameOrPkg];
238
239
  }
package/lib/plugin.js CHANGED
@@ -276,7 +276,7 @@ const _Plugin = class _Plugin {
276
276
  "fr-FR": "fr/"
277
277
  };
278
278
  if (packageName.startsWith("@nocobase/plugin-")) {
279
- packageJson.homepage = `https://v2.docs.nocobase.com/${langMap[locale] || ""}plugins/${packageName}`;
279
+ packageJson.homepage = `https://docs.nocobase.com/${langMap[locale] || ""}plugins/${packageName}`;
280
280
  }
281
281
  const results = {
282
282
  ...this.options,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/server",
3
- "version": "2.2.0-alpha.1",
3
+ "version": "2.2.0-alpha.2",
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.2.0-alpha.1",
14
- "@nocobase/actions": "2.2.0-alpha.1",
15
- "@nocobase/ai": "2.2.0-alpha.1",
16
- "@nocobase/auth": "2.2.0-alpha.1",
17
- "@nocobase/cache": "2.2.0-alpha.1",
18
- "@nocobase/data-source-manager": "2.2.0-alpha.1",
19
- "@nocobase/database": "2.2.0-alpha.1",
20
- "@nocobase/evaluators": "2.2.0-alpha.1",
21
- "@nocobase/lock-manager": "2.2.0-alpha.1",
22
- "@nocobase/logger": "2.2.0-alpha.1",
23
- "@nocobase/resourcer": "2.2.0-alpha.1",
24
- "@nocobase/sdk": "2.2.0-alpha.1",
25
- "@nocobase/snowflake-id": "2.2.0-alpha.1",
26
- "@nocobase/telemetry": "2.2.0-alpha.1",
27
- "@nocobase/utils": "2.2.0-alpha.1",
13
+ "@nocobase/acl": "2.2.0-alpha.2",
14
+ "@nocobase/actions": "2.2.0-alpha.2",
15
+ "@nocobase/ai": "2.2.0-alpha.2",
16
+ "@nocobase/auth": "2.2.0-alpha.2",
17
+ "@nocobase/cache": "2.2.0-alpha.2",
18
+ "@nocobase/data-source-manager": "2.2.0-alpha.2",
19
+ "@nocobase/database": "2.2.0-alpha.2",
20
+ "@nocobase/evaluators": "2.2.0-alpha.2",
21
+ "@nocobase/lock-manager": "2.2.0-alpha.2",
22
+ "@nocobase/logger": "2.2.0-alpha.2",
23
+ "@nocobase/resourcer": "2.2.0-alpha.2",
24
+ "@nocobase/sdk": "2.2.0-alpha.2",
25
+ "@nocobase/snowflake-id": "2.2.0-alpha.2",
26
+ "@nocobase/telemetry": "2.2.0-alpha.2",
27
+ "@nocobase/utils": "2.2.0-alpha.2",
28
28
  "@types/decompress": "4.2.7",
29
29
  "@types/ini": "^1.3.31",
30
30
  "@types/koa-send": "^4.1.3",
@@ -47,7 +47,7 @@
47
47
  "koa-send": "^5.0.1",
48
48
  "koa-static": "^5.0.0",
49
49
  "lodash": "^4.17.21",
50
- "multer": "^1.4.5-lts.2",
50
+ "multer": "^2.1.1",
51
51
  "nanoid": "^3.3.11",
52
52
  "p-queue": "^6.6.2",
53
53
  "redis": "^5.10.0",
@@ -61,5 +61,5 @@
61
61
  "@types/serve-handler": "^6.1.1",
62
62
  "@types/ws": "^8.5.5"
63
63
  },
64
- "gitHead": "303663aba6c6eefa27e6a6435b4c0352074ec40f"
64
+ "gitHead": "9dd5224bb8f6c1ac12d766b9f175bdc29bddd845"
65
65
  }