@nocobase/server 1.2.13-alpha → 1.3.0-alpha.20240710084543
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/package.json +14 -14
- package/lib/acl/available-action.d.ts +0 -13
- package/lib/acl/available-action.js +0 -71
- package/lib/acl/index.d.ts +0 -10
- package/lib/acl/index.js +0 -46
- package/lib/app-command.d.ts +0 -20
- package/lib/app-command.js +0 -82
- package/lib/app-supervisor.d.ts +0 -69
- package/lib/app-supervisor.js +0 -302
- package/lib/application.d.ts +0 -345
- package/lib/application.js +0 -876
- package/lib/cache/index.d.ts +0 -11
- package/lib/cache/index.js +0 -44
- package/lib/commands/console.d.ts +0 -11
- package/lib/commands/console.js +0 -48
- package/lib/commands/create-migration.d.ts +0 -11
- package/lib/commands/create-migration.js +0 -79
- package/lib/commands/db-auth.d.ts +0 -11
- package/lib/commands/db-auth.js +0 -38
- package/lib/commands/db-clean.d.ts +0 -11
- package/lib/commands/db-clean.js +0 -41
- package/lib/commands/db-sync.d.ts +0 -11
- package/lib/commands/db-sync.js +0 -50
- package/lib/commands/destroy.d.ts +0 -11
- package/lib/commands/destroy.js +0 -40
- package/lib/commands/index.d.ts +0 -10
- package/lib/commands/index.js +0 -82
- package/lib/commands/install.d.ts +0 -11
- package/lib/commands/install.js +0 -43
- package/lib/commands/migrator.d.ts +0 -11
- package/lib/commands/migrator.js +0 -41
- package/lib/commands/pm.d.ts +0 -11
- package/lib/commands/pm.js +0 -98
- package/lib/commands/refresh.d.ts +0 -11
- package/lib/commands/refresh.js +0 -41
- package/lib/commands/restart.d.ts +0 -11
- package/lib/commands/restart.js +0 -45
- package/lib/commands/start.d.ts +0 -11
- package/lib/commands/start.js +0 -85
- package/lib/commands/stop.d.ts +0 -11
- package/lib/commands/stop.js +0 -44
- package/lib/commands/upgrade.d.ts +0 -14
- package/lib/commands/upgrade.js +0 -39
- package/lib/cron/cron-job-manager.d.ts +0 -22
- package/lib/cron/cron-job-manager.js +0 -82
- package/lib/errors/application-not-install.d.ts +0 -12
- package/lib/errors/application-not-install.js +0 -45
- package/lib/errors/handler.d.ts +0 -11
- package/lib/errors/handler.js +0 -50
- package/lib/errors/plugin-command-error.d.ts +0 -10
- package/lib/errors/plugin-command-error.js +0 -40
- package/lib/errors/plugin-not-exist.d.ts +0 -10
- package/lib/errors/plugin-not-exist.js +0 -40
- package/lib/gateway/errors.d.ts +0 -30
- package/lib/gateway/errors.js +0 -154
- package/lib/gateway/index.d.ts +0 -79
- package/lib/gateway/index.js +0 -393
- package/lib/gateway/ipc-socket-client.d.ts +0 -27
- package/lib/gateway/ipc-socket-client.js +0 -110
- package/lib/gateway/ipc-socket-server.d.ts +0 -21
- package/lib/gateway/ipc-socket-server.js +0 -150
- package/lib/gateway/ws-server.d.ts +0 -36
- package/lib/gateway/ws-server.js +0 -196
- package/lib/helper.d.ts +0 -18
- package/lib/helper.js +0 -193
- package/lib/helpers/application-version.d.ts +0 -18
- package/lib/helpers/application-version.js +0 -88
- package/lib/index.d.ts +0 -17
- package/lib/index.js +0 -64
- package/lib/locale/index.d.ts +0 -9
- package/lib/locale/index.js +0 -30
- package/lib/locale/locale.d.ts +0 -38
- package/lib/locale/locale.js +0 -174
- package/lib/locale/resource.d.ts +0 -9
- package/lib/locale/resource.js +0 -87
- package/lib/main-data-source.d.ts +0 -12
- package/lib/main-data-source.js +0 -57
- package/lib/middlewares/data-template.d.ts +0 -10
- package/lib/middlewares/data-template.js +0 -146
- package/lib/middlewares/data-wrapping.d.ts +0 -11
- package/lib/middlewares/data-wrapping.js +0 -100
- package/lib/middlewares/i18n.d.ts +0 -9
- package/lib/middlewares/i18n.js +0 -53
- package/lib/middlewares/index.d.ts +0 -10
- package/lib/middlewares/index.js +0 -39
- package/lib/middlewares/parse-variables.d.ts +0 -9
- package/lib/middlewares/parse-variables.js +0 -95
- package/lib/middlewares/validate-filter-params.d.ts +0 -9
- package/lib/middlewares/validate-filter-params.js +0 -42
- package/lib/migration.d.ts +0 -20
- package/lib/migration.js +0 -54
- package/lib/migrations/20230912193824-package-name-unique.d.ts +0 -14
- package/lib/migrations/20230912193824-package-name-unique.js +0 -59
- package/lib/migrations/20230912294620-update-pkg.d.ts +0 -14
- package/lib/migrations/20230912294620-update-pkg.js +0 -65
- package/lib/migrations/20240106082756-update-plugins.d.ts +0 -14
- package/lib/migrations/20240106082756-update-plugins.js +0 -51
- package/lib/migrations/20240428235620-rename-plugins.d.ts +0 -14
- package/lib/migrations/20240428235620-rename-plugins.js +0 -49
- package/lib/plugin-manager/clientStaticUtils.d.ts +0 -31
- package/lib/plugin-manager/clientStaticUtils.js +0 -129
- package/lib/plugin-manager/constants.d.ts +0 -15
- package/lib/plugin-manager/constants.js +0 -135
- package/lib/plugin-manager/deps.d.ts +0 -10
- package/lib/plugin-manager/deps.js +0 -83
- package/lib/plugin-manager/index.d.ts +0 -10
- package/lib/plugin-manager/index.js +0 -32
- package/lib/plugin-manager/middleware.d.ts +0 -10
- package/lib/plugin-manager/middleware.js +0 -45
- package/lib/plugin-manager/options/collection.d.ts +0 -10
- package/lib/plugin-manager/options/collection.js +0 -47
- package/lib/plugin-manager/options/resource.d.ts +0 -23
- package/lib/plugin-manager/options/resource.js +0 -186
- package/lib/plugin-manager/plugin-manager-repository.d.ts +0 -36
- package/lib/plugin-manager/plugin-manager-repository.js +0 -158
- package/lib/plugin-manager/plugin-manager.d.ts +0 -206
- package/lib/plugin-manager/plugin-manager.js +0 -1100
- package/lib/plugin-manager/types.d.ts +0 -23
- package/lib/plugin-manager/types.js +0 -24
- package/lib/plugin-manager/utils.d.ts +0 -115
- package/lib/plugin-manager/utils.js +0 -568
- package/lib/plugin.d.ts +0 -99
- package/lib/plugin.js +0 -228
- package/lib/swagger/index.json +0 -1569
package/lib/commands/pm.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var pm_exports = {};
|
|
29
|
-
__export(pm_exports, {
|
|
30
|
-
default: () => pm_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(pm_exports);
|
|
33
|
-
var import_app_supervisor = require("../app-supervisor");
|
|
34
|
-
var import_plugin_command_error = require("../errors/plugin-command-error");
|
|
35
|
-
/* istanbul ignore file -- @preserve */
|
|
36
|
-
var pm_default = /* @__PURE__ */ __name((app) => {
|
|
37
|
-
const pm = app.command("pm");
|
|
38
|
-
pm.command("create").argument("plugin").option("--force-recreate").action(async (plugin, options) => {
|
|
39
|
-
await app.pm.create(plugin, options);
|
|
40
|
-
});
|
|
41
|
-
pm.command("add").ipc().preload().arguments("<packageNames...>").option("--registry [registry]").option("--auth-token [authToken]").option("--version [version]").action(async (packageNames, options, cli) => {
|
|
42
|
-
try {
|
|
43
|
-
let name = packageNames;
|
|
44
|
-
if (Array.isArray(packageNames) && packageNames.length === 1) {
|
|
45
|
-
name = packageNames[0];
|
|
46
|
-
}
|
|
47
|
-
await app.pm.addViaCLI(name, { ...options });
|
|
48
|
-
} catch (error) {
|
|
49
|
-
throw new import_plugin_command_error.PluginCommandError(`Failed to add plugin`, { cause: error });
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
pm.command("update").argument("<packageNames...>").option("--registry [registry]").option("--auth-token [authToken]").option("--version [version]").action(async (packageNames, options) => {
|
|
53
|
-
try {
|
|
54
|
-
await app.pm.update(packageNames, {
|
|
55
|
-
...options
|
|
56
|
-
});
|
|
57
|
-
} catch (error) {
|
|
58
|
-
throw new import_plugin_command_error.PluginCommandError(`Failed to update plugin`, { cause: error });
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
pm.command("enable-all").ipc().preload().action(async () => {
|
|
62
|
-
try {
|
|
63
|
-
await app.pm.enable("*");
|
|
64
|
-
} catch (error) {
|
|
65
|
-
throw new import_plugin_command_error.PluginCommandError(`Failed to enable plugin`, { cause: error });
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
pm.command("enable").ipc().preload().arguments("<plugins...>").action(async (plugins) => {
|
|
69
|
-
try {
|
|
70
|
-
await app.pm.enable(plugins);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
throw new import_plugin_command_error.PluginCommandError(`Failed to enable plugin`, { cause: error });
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
pm.command("disable").ipc().preload().arguments("<plugins...>").action(async (plugins) => {
|
|
76
|
-
try {
|
|
77
|
-
await app.pm.disable(plugins);
|
|
78
|
-
} catch (error) {
|
|
79
|
-
throw new import_plugin_command_error.PluginCommandError(`Failed to disable plugin`, { cause: error });
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
pm.command("remove").auth().arguments("<plugins...>").option("--force").option("--remove-dir").option("--app [app]").action(async (plugins, options) => {
|
|
83
|
-
if (options.app) {
|
|
84
|
-
await app.load();
|
|
85
|
-
const subApp = await import_app_supervisor.AppSupervisor.getInstance().getApp(options.app, { upgrading: true });
|
|
86
|
-
const args = [];
|
|
87
|
-
if (options.force) {
|
|
88
|
-
args.push("--force");
|
|
89
|
-
}
|
|
90
|
-
if (options.removeDir) {
|
|
91
|
-
args.push("--remove-dir");
|
|
92
|
-
}
|
|
93
|
-
await subApp.runCommand("pm", "remove", ...plugins, ...args);
|
|
94
|
-
} else {
|
|
95
|
-
await app.pm.remove(plugins, options);
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
}, "default");
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Application from '../application';
|
|
10
|
-
declare const _default: (app: Application) => void;
|
|
11
|
-
export default _default;
|
package/lib/commands/refresh.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var refresh_exports = {};
|
|
29
|
-
__export(refresh_exports, {
|
|
30
|
-
default: () => refresh_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(refresh_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var refresh_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("refresh").ipc().action(async (cliArgs) => {
|
|
36
|
-
await app.restart({
|
|
37
|
-
cliArgs
|
|
38
|
-
});
|
|
39
|
-
app.log.info("refreshing...");
|
|
40
|
-
});
|
|
41
|
-
}, "default");
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Application from '../application';
|
|
10
|
-
declare const _default: (app: Application) => void;
|
|
11
|
-
export default _default;
|
package/lib/commands/restart.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var restart_exports = {};
|
|
29
|
-
__export(restart_exports, {
|
|
30
|
-
default: () => restart_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(restart_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var restart_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("restart").ipc().action(async (...cliArgs) => {
|
|
36
|
-
if (!await app.isStarted()) {
|
|
37
|
-
app.log.info("app has not started");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
await app.restart({
|
|
41
|
-
cliArgs
|
|
42
|
-
});
|
|
43
|
-
app.log.info("app has been restarted");
|
|
44
|
-
});
|
|
45
|
-
}, "default");
|
package/lib/commands/start.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Application from '../application';
|
|
10
|
-
declare const _default: (app: Application) => void;
|
|
11
|
-
export default _default;
|
package/lib/commands/start.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
17
|
-
var __export = (target, all) => {
|
|
18
|
-
for (var name in all)
|
|
19
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
20
|
-
};
|
|
21
|
-
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
for (let key of __getOwnPropNames(from))
|
|
24
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
25
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var start_exports = {};
|
|
39
|
-
__export(start_exports, {
|
|
40
|
-
default: () => start_default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(start_exports);
|
|
43
|
-
var import_utils = require("@nocobase/utils");
|
|
44
|
-
var import_fs = __toESM(require("fs"));
|
|
45
|
-
var import_path = require("path");
|
|
46
|
-
var import_application_not_install = require("../errors/application-not-install");
|
|
47
|
-
/* istanbul ignore file -- @preserve */
|
|
48
|
-
var start_default = /* @__PURE__ */ __name((app) => {
|
|
49
|
-
app.command("start").auth().option("--db-sync").option("--quickstart").action(async (...cliArgs) => {
|
|
50
|
-
const [options] = cliArgs;
|
|
51
|
-
const file = (0, import_path.resolve)(process.cwd(), "storage/app-upgrading");
|
|
52
|
-
const upgrading = await (0, import_utils.fsExists)(file);
|
|
53
|
-
if (upgrading) {
|
|
54
|
-
await app.upgrade();
|
|
55
|
-
try {
|
|
56
|
-
await import_fs.default.promises.rm(file);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
}
|
|
59
|
-
} else if (options.quickstart) {
|
|
60
|
-
if (await app.isInstalled()) {
|
|
61
|
-
await app.upgrade();
|
|
62
|
-
} else {
|
|
63
|
-
await app.install();
|
|
64
|
-
}
|
|
65
|
-
app["_started"] = true;
|
|
66
|
-
await app.restart();
|
|
67
|
-
app.log.info("app has been started");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (!await app.isInstalled()) {
|
|
71
|
-
app["_started"] = true;
|
|
72
|
-
throw new import_application_not_install.ApplicationNotInstall(
|
|
73
|
-
`Application ${app.name} is not installed, Please run 'yarn nocobase install' command first`
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
await app.load();
|
|
77
|
-
await app.start({
|
|
78
|
-
dbSync: options == null ? void 0 : options.dbSync,
|
|
79
|
-
quickstart: options.quickstart,
|
|
80
|
-
cliArgs,
|
|
81
|
-
checkInstall: true
|
|
82
|
-
});
|
|
83
|
-
app.log.info("app has been started");
|
|
84
|
-
});
|
|
85
|
-
}, "default");
|
package/lib/commands/stop.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Application from '../application';
|
|
10
|
-
declare const _default: (app: Application) => void;
|
|
11
|
-
export default _default;
|
package/lib/commands/stop.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var stop_exports = {};
|
|
29
|
-
__export(stop_exports, {
|
|
30
|
-
default: () => stop_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(stop_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var stop_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("stop").ipc().action(async (...cliArgs) => {
|
|
36
|
-
if (!await app.isStarted()) {
|
|
37
|
-
app.log.info("app has not started");
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
await app.stop({
|
|
41
|
-
cliArgs
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
}, "default");
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import Application from '../application';
|
|
10
|
-
/**
|
|
11
|
-
* TODO
|
|
12
|
-
*/
|
|
13
|
-
declare const _default: (app: Application) => void;
|
|
14
|
-
export default _default;
|
package/lib/commands/upgrade.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var upgrade_exports = {};
|
|
29
|
-
__export(upgrade_exports, {
|
|
30
|
-
default: () => upgrade_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(upgrade_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var upgrade_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("upgrade").ipc().auth().action(async (options) => {
|
|
36
|
-
await app.upgrade(options);
|
|
37
|
-
app.log.info(`\u2728 NocoBase has been upgraded to v${app.getVersion()}`);
|
|
38
|
-
});
|
|
39
|
-
}, "default");
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { CronJob, CronJobParameters } from 'cron';
|
|
10
|
-
import Application from '../application';
|
|
11
|
-
export declare class CronJobManager {
|
|
12
|
-
private app;
|
|
13
|
-
private _jobs;
|
|
14
|
-
private _started;
|
|
15
|
-
constructor(app: Application);
|
|
16
|
-
get started(): boolean;
|
|
17
|
-
get jobs(): Set<CronJob>;
|
|
18
|
-
addJob(options: CronJobParameters): CronJob;
|
|
19
|
-
removeJob(job: CronJob): void;
|
|
20
|
-
start(): void;
|
|
21
|
-
stop(): void;
|
|
22
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var cron_job_manager_exports = {};
|
|
29
|
-
__export(cron_job_manager_exports, {
|
|
30
|
-
CronJobManager: () => CronJobManager
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(cron_job_manager_exports);
|
|
33
|
-
var import_cron = require("cron");
|
|
34
|
-
const _CronJobManager = class _CronJobManager {
|
|
35
|
-
constructor(app) {
|
|
36
|
-
this.app = app;
|
|
37
|
-
app.on("beforeStop", async () => {
|
|
38
|
-
this.stop();
|
|
39
|
-
});
|
|
40
|
-
app.on("afterStart", async () => {
|
|
41
|
-
this.start();
|
|
42
|
-
});
|
|
43
|
-
app.on("beforeReload", async () => {
|
|
44
|
-
this.stop();
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
_jobs = /* @__PURE__ */ new Set();
|
|
48
|
-
_started = false;
|
|
49
|
-
get started() {
|
|
50
|
-
return this._started;
|
|
51
|
-
}
|
|
52
|
-
get jobs() {
|
|
53
|
-
return this._jobs;
|
|
54
|
-
}
|
|
55
|
-
addJob(options) {
|
|
56
|
-
const cronJob = new import_cron.CronJob(options);
|
|
57
|
-
this._jobs.add(cronJob);
|
|
58
|
-
return cronJob;
|
|
59
|
-
}
|
|
60
|
-
removeJob(job) {
|
|
61
|
-
job.stop();
|
|
62
|
-
this._jobs.delete(job);
|
|
63
|
-
}
|
|
64
|
-
start() {
|
|
65
|
-
this._jobs.forEach((job) => {
|
|
66
|
-
job.start();
|
|
67
|
-
});
|
|
68
|
-
this._started = true;
|
|
69
|
-
}
|
|
70
|
-
stop() {
|
|
71
|
-
this._jobs.forEach((job) => {
|
|
72
|
-
job.stop();
|
|
73
|
-
});
|
|
74
|
-
this._started = false;
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
__name(_CronJobManager, "CronJobManager");
|
|
78
|
-
let CronJobManager = _CronJobManager;
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
CronJobManager
|
|
82
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare class ApplicationNotInstall extends Error {
|
|
10
|
-
code: string;
|
|
11
|
-
constructor(message: any);
|
|
12
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var application_not_install_exports = {};
|
|
29
|
-
__export(application_not_install_exports, {
|
|
30
|
-
ApplicationNotInstall: () => ApplicationNotInstall
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(application_not_install_exports);
|
|
33
|
-
const _ApplicationNotInstall = class _ApplicationNotInstall extends Error {
|
|
34
|
-
code;
|
|
35
|
-
constructor(message) {
|
|
36
|
-
super(message);
|
|
37
|
-
this.code = "APP_NOT_INSTALLED_ERROR";
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
__name(_ApplicationNotInstall, "ApplicationNotInstall");
|
|
41
|
-
let ApplicationNotInstall = _ApplicationNotInstall;
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
ApplicationNotInstall
|
|
45
|
-
});
|
package/lib/errors/handler.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
type ErrorLevel = 'fatal' | 'silly' | 'warn';
|
|
10
|
-
export declare function getErrorLevel(e: Error): ErrorLevel;
|
|
11
|
-
export {};
|
package/lib/errors/handler.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
15
|
-
var __export = (target, all) => {
|
|
16
|
-
for (var name in all)
|
|
17
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
-
for (let key of __getOwnPropNames(from))
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
-
}
|
|
25
|
-
return to;
|
|
26
|
-
};
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var handler_exports = {};
|
|
29
|
-
__export(handler_exports, {
|
|
30
|
-
getErrorLevel: () => getErrorLevel
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(handler_exports);
|
|
33
|
-
var import_plugin_command_error = require("./plugin-command-error");
|
|
34
|
-
function getErrorLevel(e) {
|
|
35
|
-
if (e.code === "commander.unknownCommand") {
|
|
36
|
-
return "silly";
|
|
37
|
-
}
|
|
38
|
-
if (e instanceof import_plugin_command_error.PluginCommandError) {
|
|
39
|
-
return "warn";
|
|
40
|
-
}
|
|
41
|
-
if (e.name === "RestoreCheckError") {
|
|
42
|
-
return "warn";
|
|
43
|
-
}
|
|
44
|
-
return "fatal";
|
|
45
|
-
}
|
|
46
|
-
__name(getErrorLevel, "getErrorLevel");
|
|
47
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
getErrorLevel
|
|
50
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
export declare class PluginCommandError extends Error {
|
|
10
|
-
}
|