@nocobase/server 2.2.0-alpha.1 → 2.2.0-alpha.3
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.
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|
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://
|
|
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.
|
|
3
|
+
"version": "2.2.0-alpha.3",
|
|
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.
|
|
14
|
-
"@nocobase/actions": "2.2.0-alpha.
|
|
15
|
-
"@nocobase/ai": "2.2.0-alpha.
|
|
16
|
-
"@nocobase/auth": "2.2.0-alpha.
|
|
17
|
-
"@nocobase/cache": "2.2.0-alpha.
|
|
18
|
-
"@nocobase/data-source-manager": "2.2.0-alpha.
|
|
19
|
-
"@nocobase/database": "2.2.0-alpha.
|
|
20
|
-
"@nocobase/evaluators": "2.2.0-alpha.
|
|
21
|
-
"@nocobase/lock-manager": "2.2.0-alpha.
|
|
22
|
-
"@nocobase/logger": "2.2.0-alpha.
|
|
23
|
-
"@nocobase/resourcer": "2.2.0-alpha.
|
|
24
|
-
"@nocobase/sdk": "2.2.0-alpha.
|
|
25
|
-
"@nocobase/snowflake-id": "2.2.0-alpha.
|
|
26
|
-
"@nocobase/telemetry": "2.2.0-alpha.
|
|
27
|
-
"@nocobase/utils": "2.2.0-alpha.
|
|
13
|
+
"@nocobase/acl": "2.2.0-alpha.3",
|
|
14
|
+
"@nocobase/actions": "2.2.0-alpha.3",
|
|
15
|
+
"@nocobase/ai": "2.2.0-alpha.3",
|
|
16
|
+
"@nocobase/auth": "2.2.0-alpha.3",
|
|
17
|
+
"@nocobase/cache": "2.2.0-alpha.3",
|
|
18
|
+
"@nocobase/data-source-manager": "2.2.0-alpha.3",
|
|
19
|
+
"@nocobase/database": "2.2.0-alpha.3",
|
|
20
|
+
"@nocobase/evaluators": "2.2.0-alpha.3",
|
|
21
|
+
"@nocobase/lock-manager": "2.2.0-alpha.3",
|
|
22
|
+
"@nocobase/logger": "2.2.0-alpha.3",
|
|
23
|
+
"@nocobase/resourcer": "2.2.0-alpha.3",
|
|
24
|
+
"@nocobase/sdk": "2.2.0-alpha.3",
|
|
25
|
+
"@nocobase/snowflake-id": "2.2.0-alpha.3",
|
|
26
|
+
"@nocobase/telemetry": "2.2.0-alpha.3",
|
|
27
|
+
"@nocobase/utils": "2.2.0-alpha.3",
|
|
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.
|
|
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": "
|
|
64
|
+
"gitHead": "e3ec19361fd7981af9fe2a7f24ad335025cbefcd"
|
|
65
65
|
}
|