@nocobase/server 2.1.0-alpha.16 → 2.1.0-alpha.18
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.
- package/lib/app-supervisor/app-options-factory.d.ts +1 -0
- package/lib/commands/pm.js +2 -25
- package/lib/plugin-manager/options/resource.d.ts +1 -1
- package/lib/plugin-manager/options/resource.js +6 -0
- package/lib/plugin-manager/utils.d.ts +7 -0
- package/lib/plugin-manager/utils.js +31 -0
- package/package.json +17 -17
|
@@ -16,6 +16,7 @@ export declare const appOptionsFactory: (appName: string, mainApp: Application,
|
|
|
16
16
|
migrator?: any;
|
|
17
17
|
usingBigIntForId?: boolean;
|
|
18
18
|
underscored?: boolean;
|
|
19
|
+
rawTimezone?: string;
|
|
19
20
|
logger?: import("@nocobase/logger/lib/logger").Logger | import("@nocobase/logger/lib/logger").LoggerOptions;
|
|
20
21
|
customHooks?: any;
|
|
21
22
|
instanceId?: string;
|
package/lib/commands/pm.js
CHANGED
|
@@ -32,35 +32,12 @@ __export(pm_exports, {
|
|
|
32
32
|
module.exports = __toCommonJS(pm_exports);
|
|
33
33
|
var import_app_supervisor = require("../app-supervisor");
|
|
34
34
|
var import_plugin_command_error = require("../errors/plugin-command-error");
|
|
35
|
-
var
|
|
36
|
-
var import_findPackageNames = require("../plugin-manager/findPackageNames");
|
|
35
|
+
var import_utils = require("../plugin-manager/utils");
|
|
37
36
|
/* istanbul ignore file -- @preserve */
|
|
38
37
|
var pm_default = /* @__PURE__ */ __name((app) => {
|
|
39
38
|
const pm = app.command("pm");
|
|
40
39
|
pm.command("list").action(async () => {
|
|
41
|
-
const
|
|
42
|
-
const plugins2 = await (0, import_findPackageNames.findLocalPlugins)();
|
|
43
|
-
let enabledPlugins = [];
|
|
44
|
-
try {
|
|
45
|
-
enabledPlugins = (await app.pm.repository.find({
|
|
46
|
-
filter: {
|
|
47
|
-
enabled: true
|
|
48
|
-
}
|
|
49
|
-
})).map((item) => item.packageName);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
}
|
|
52
|
-
const items = await Promise.all(
|
|
53
|
-
[...plugins1, ...plugins2].map(async (name) => {
|
|
54
|
-
const item = await import_plugin_manager.PluginManager.parseName(name);
|
|
55
|
-
const json = await import_plugin_manager.PluginManager.getPackageJson(item.packageName);
|
|
56
|
-
return {
|
|
57
|
-
displayName: json.displayName || name,
|
|
58
|
-
packageName: item.packageName,
|
|
59
|
-
enabled: enabledPlugins.includes(item.packageName),
|
|
60
|
-
description: json.description
|
|
61
|
-
};
|
|
62
|
-
})
|
|
63
|
-
);
|
|
40
|
+
const items = await (0, import_utils.pmListSummary)(app);
|
|
64
41
|
console.log("--- BEGIN_PLUGIN_LIST_JSON ---");
|
|
65
42
|
console.log(JSON.stringify(items));
|
|
66
43
|
console.log("--- END_PLUGIN_LIST_JSON ---");
|
|
@@ -24,7 +24,7 @@ declare const _default: {
|
|
|
24
24
|
enable(ctx: any, next: any): Promise<void>;
|
|
25
25
|
disable(ctx: any, next: any): Promise<void>;
|
|
26
26
|
remove(ctx: any, next: any): Promise<void>;
|
|
27
|
-
list(ctx: any, next: any): Promise<
|
|
27
|
+
list(ctx: any, next: any): Promise<any>;
|
|
28
28
|
listEnabled(ctx: any, next: any): Promise<void>;
|
|
29
29
|
listEnabledV2(ctx: any, next: any): Promise<void>;
|
|
30
30
|
get(ctx: any, next: any): Promise<void>;
|
|
@@ -48,6 +48,7 @@ var import_fs = __toESM(require("fs"));
|
|
|
48
48
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
49
49
|
var import_path = __toESM(require("path"));
|
|
50
50
|
var import_crypto = __toESM(require("crypto"));
|
|
51
|
+
var import_utils2 = require("../utils");
|
|
51
52
|
var import_package = __toESM(require("../../../package.json"));
|
|
52
53
|
const PLUGIN_CLIENT_ENTRY_FILES = {
|
|
53
54
|
client: "dist/client/index.js",
|
|
@@ -240,6 +241,11 @@ var resource_default = {
|
|
|
240
241
|
await next();
|
|
241
242
|
},
|
|
242
243
|
async list(ctx, next) {
|
|
244
|
+
const { mode } = ctx.action.params;
|
|
245
|
+
if (mode === "summary") {
|
|
246
|
+
ctx.body = await (0, import_utils2.pmListSummary)(ctx.app);
|
|
247
|
+
return next();
|
|
248
|
+
}
|
|
243
249
|
const locale = ctx.getCurrentLocale();
|
|
244
250
|
const pm = ctx.app.pm;
|
|
245
251
|
const plugin = pm.get("nocobase");
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { AxiosRequestConfig } from 'axios';
|
|
10
10
|
import { PluginManagerRepository } from './plugin-manager-repository';
|
|
11
11
|
import { PluginData } from './types';
|
|
12
|
+
import Application from '../application';
|
|
12
13
|
/**
|
|
13
14
|
* get temp dir
|
|
14
15
|
*
|
|
@@ -112,4 +113,10 @@ export declare function checkAndGetCompatible(packageName: string): Promise<{
|
|
|
112
113
|
depsCompatible: DepCompatible[];
|
|
113
114
|
}>;
|
|
114
115
|
export declare function getPluginBasePath(packageName: string): Promise<string>;
|
|
116
|
+
export declare function pmListSummary(app: Application): Promise<{
|
|
117
|
+
displayName: any;
|
|
118
|
+
packageName: any;
|
|
119
|
+
enabled: boolean;
|
|
120
|
+
description: any;
|
|
121
|
+
}[]>;
|
|
115
122
|
export {};
|
|
@@ -65,6 +65,7 @@ __export(utils_exports, {
|
|
|
65
65
|
getTempDir: () => getTempDir,
|
|
66
66
|
isNotBuiltinModule: () => isNotBuiltinModule,
|
|
67
67
|
isValidPackageName: () => isValidPackageName,
|
|
68
|
+
pmListSummary: () => pmListSummary,
|
|
68
69
|
readJSONFileContent: () => readJSONFileContent,
|
|
69
70
|
removePluginPackage: () => removePluginPackage,
|
|
70
71
|
removeRequireCache: () => removeRequireCache,
|
|
@@ -88,6 +89,8 @@ var import_semver = __toESM(require("semver"));
|
|
|
88
89
|
var import_clientStaticUtils = require("./clientStaticUtils");
|
|
89
90
|
var import_constants = require("./constants");
|
|
90
91
|
var import_deps = __toESM(require("./deps"));
|
|
92
|
+
var import_findPackageNames = require("./findPackageNames");
|
|
93
|
+
var import_plugin_manager = __toESM(require("./plugin-manager"));
|
|
91
94
|
/* istanbul ignore next -- @preserve */
|
|
92
95
|
async function getTempDir() {
|
|
93
96
|
const temporaryDirectory = await import_fs_extra.default.realpath(import_os.default.tmpdir());
|
|
@@ -525,6 +528,33 @@ async function getPluginBasePath(packageName) {
|
|
|
525
528
|
return import_path.default.dirname(import_path.default.dirname(file));
|
|
526
529
|
}
|
|
527
530
|
__name(getPluginBasePath, "getPluginBasePath");
|
|
531
|
+
async function pmListSummary(app) {
|
|
532
|
+
const plugins1 = await (0, import_findPackageNames.findBuiltInPlugins)();
|
|
533
|
+
const plugins2 = await (0, import_findPackageNames.findLocalPlugins)();
|
|
534
|
+
let enabledPlugins = [];
|
|
535
|
+
try {
|
|
536
|
+
enabledPlugins = (await app.pm.repository.find({
|
|
537
|
+
filter: {
|
|
538
|
+
enabled: true
|
|
539
|
+
}
|
|
540
|
+
})).map((item) => item.packageName);
|
|
541
|
+
} catch (error) {
|
|
542
|
+
}
|
|
543
|
+
const items = await Promise.all(
|
|
544
|
+
[...plugins1, ...plugins2].map(async (name) => {
|
|
545
|
+
const item = await import_plugin_manager.default.parseName(name);
|
|
546
|
+
const json = await import_plugin_manager.default.getPackageJson(item.packageName);
|
|
547
|
+
return {
|
|
548
|
+
displayName: json.displayName || name,
|
|
549
|
+
packageName: item.packageName,
|
|
550
|
+
enabled: enabledPlugins.includes(item.packageName),
|
|
551
|
+
description: json.description
|
|
552
|
+
};
|
|
553
|
+
})
|
|
554
|
+
);
|
|
555
|
+
return items;
|
|
556
|
+
}
|
|
557
|
+
__name(pmListSummary, "pmListSummary");
|
|
528
558
|
// Annotate the CommonJS export names for ESM import in node:
|
|
529
559
|
0 && (module.exports = {
|
|
530
560
|
checkAndGetCompatible,
|
|
@@ -555,6 +585,7 @@ __name(getPluginBasePath, "getPluginBasePath");
|
|
|
555
585
|
getTempDir,
|
|
556
586
|
isNotBuiltinModule,
|
|
557
587
|
isValidPackageName,
|
|
588
|
+
pmListSummary,
|
|
558
589
|
readJSONFileContent,
|
|
559
590
|
removePluginPackage,
|
|
560
591
|
removeRequireCache,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/server",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.18",
|
|
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.
|
|
14
|
-
"@nocobase/actions": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/ai": "2.1.0-alpha.
|
|
16
|
-
"@nocobase/auth": "2.1.0-alpha.
|
|
17
|
-
"@nocobase/cache": "2.1.0-alpha.
|
|
18
|
-
"@nocobase/data-source-manager": "2.1.0-alpha.
|
|
19
|
-
"@nocobase/database": "2.1.0-alpha.
|
|
20
|
-
"@nocobase/evaluators": "2.1.0-alpha.
|
|
21
|
-
"@nocobase/lock-manager": "2.1.0-alpha.
|
|
22
|
-
"@nocobase/logger": "2.1.0-alpha.
|
|
23
|
-
"@nocobase/resourcer": "2.1.0-alpha.
|
|
24
|
-
"@nocobase/sdk": "2.1.0-alpha.
|
|
25
|
-
"@nocobase/snowflake-id": "2.1.0-alpha.
|
|
26
|
-
"@nocobase/telemetry": "2.1.0-alpha.
|
|
27
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
13
|
+
"@nocobase/acl": "2.1.0-alpha.18",
|
|
14
|
+
"@nocobase/actions": "2.1.0-alpha.18",
|
|
15
|
+
"@nocobase/ai": "2.1.0-alpha.18",
|
|
16
|
+
"@nocobase/auth": "2.1.0-alpha.18",
|
|
17
|
+
"@nocobase/cache": "2.1.0-alpha.18",
|
|
18
|
+
"@nocobase/data-source-manager": "2.1.0-alpha.18",
|
|
19
|
+
"@nocobase/database": "2.1.0-alpha.18",
|
|
20
|
+
"@nocobase/evaluators": "2.1.0-alpha.18",
|
|
21
|
+
"@nocobase/lock-manager": "2.1.0-alpha.18",
|
|
22
|
+
"@nocobase/logger": "2.1.0-alpha.18",
|
|
23
|
+
"@nocobase/resourcer": "2.1.0-alpha.18",
|
|
24
|
+
"@nocobase/sdk": "2.1.0-alpha.18",
|
|
25
|
+
"@nocobase/snowflake-id": "2.1.0-alpha.18",
|
|
26
|
+
"@nocobase/telemetry": "2.1.0-alpha.18",
|
|
27
|
+
"@nocobase/utils": "2.1.0-alpha.18",
|
|
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": "
|
|
64
|
+
"gitHead": "e75843d4c557117bbcced047b88ed11d601ff86d"
|
|
65
65
|
}
|