@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/cache/index.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 { CacheManagerOptions, CacheManager } from '@nocobase/cache';
|
|
10
|
-
import Application from '../application';
|
|
11
|
-
export declare const createCacheManager: (app: Application, options: CacheManagerOptions) => Promise<CacheManager>;
|
package/lib/cache/index.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 cache_exports = {};
|
|
29
|
-
__export(cache_exports, {
|
|
30
|
-
createCacheManager: () => createCacheManager
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(cache_exports);
|
|
33
|
-
var import_cache = require("@nocobase/cache");
|
|
34
|
-
const createCacheManager = /* @__PURE__ */ __name(async (app, options) => {
|
|
35
|
-
const cacheManager = new import_cache.CacheManager(options);
|
|
36
|
-
const defaultCache = await cacheManager.createCache({ name: app.name });
|
|
37
|
-
app.cache = defaultCache;
|
|
38
|
-
app.context.cache = defaultCache;
|
|
39
|
-
return cacheManager;
|
|
40
|
-
}, "createCacheManager");
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
createCacheManager
|
|
44
|
-
});
|
|
@@ -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/console.js
DELETED
|
@@ -1,48 +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 console_exports = {};
|
|
29
|
-
__export(console_exports, {
|
|
30
|
-
default: () => console_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(console_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
const REPL = require("repl");
|
|
35
|
-
var console_default = /* @__PURE__ */ __name((app) => {
|
|
36
|
-
app.command("console").preload().action(async () => {
|
|
37
|
-
await app.start();
|
|
38
|
-
const repl = REPL.start("nocobase > ").context.app = app;
|
|
39
|
-
repl.on("exit", async function(err) {
|
|
40
|
-
if (err) {
|
|
41
|
-
console.log(err);
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
await app.stop();
|
|
45
|
-
process.exit(0);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}, "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;
|
|
@@ -1,79 +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 create_migration_exports = {};
|
|
39
|
-
__export(create_migration_exports, {
|
|
40
|
-
default: () => create_migration_default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(create_migration_exports);
|
|
43
|
-
var import_dayjs = __toESM(require("dayjs"));
|
|
44
|
-
var import_fs = __toESM(require("fs"));
|
|
45
|
-
var import_path = require("path");
|
|
46
|
-
/* istanbul ignore file -- @preserve */
|
|
47
|
-
var create_migration_default = /* @__PURE__ */ __name((app) => {
|
|
48
|
-
app.command("create-migration").argument("<name>").option("--pkg <pkg>").option("--on [on]").action(async (name, options) => {
|
|
49
|
-
const pkg = options.pkg;
|
|
50
|
-
const dir = await import_fs.default.promises.realpath((0, import_path.resolve)(process.env.NODE_MODULES_PATH, pkg));
|
|
51
|
-
const filename = (0, import_path.resolve)(
|
|
52
|
-
dir,
|
|
53
|
-
pkg === "@nocobase/server" ? "src" : "src/server",
|
|
54
|
-
"migrations",
|
|
55
|
-
`${(0, import_dayjs.default)().format("YYYYMMDDHHmmss")}-${name}.ts`
|
|
56
|
-
);
|
|
57
|
-
const version = app.getVersion();
|
|
58
|
-
const regex = /(\d+)\.(\d+)\.(\d+)(-[\w.]+)?/;
|
|
59
|
-
const nextVersion = version.replace(regex, (match, major, minor, patch, suffix) => {
|
|
60
|
-
const newPatch = parseInt(patch) + 1;
|
|
61
|
-
return `${major}.${minor}.${newPatch}${suffix || ""}`;
|
|
62
|
-
});
|
|
63
|
-
const from = pkg === "@nocobase/server" ? `../migration` : "@nocobase/server";
|
|
64
|
-
const data = `import { Migration } from '${from}';
|
|
65
|
-
|
|
66
|
-
export default class extends Migration {
|
|
67
|
-
on = '${options.on || "afterLoad"}'; // 'beforeLoad' or 'afterLoad'
|
|
68
|
-
appVersion = '<${nextVersion}';
|
|
69
|
-
|
|
70
|
-
async up() {
|
|
71
|
-
// coding
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
`;
|
|
75
|
-
await import_fs.default.promises.mkdir((0, import_path.dirname)(filename), { recursive: true });
|
|
76
|
-
await import_fs.default.promises.writeFile(filename, data, "utf8");
|
|
77
|
-
app.log.info(`migration file in ${filename}`);
|
|
78
|
-
});
|
|
79
|
-
}, "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/db-auth.js
DELETED
|
@@ -1,38 +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 db_auth_exports = {};
|
|
29
|
-
__export(db_auth_exports, {
|
|
30
|
-
default: () => db_auth_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(db_auth_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var db_auth_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("db:auth").option("-r, --retry [retry]").action(async (opts) => {
|
|
36
|
-
await app.db.auth({ retry: opts.retry || 10 });
|
|
37
|
-
});
|
|
38
|
-
}, "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/db-clean.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 db_clean_exports = {};
|
|
29
|
-
__export(db_clean_exports, {
|
|
30
|
-
default: () => db_clean_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(db_clean_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var db_clean_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("db:clean").auth().option("-y, --yes").action(async (opts) => {
|
|
36
|
-
console.log("Clearing database");
|
|
37
|
-
await app.db.clean({
|
|
38
|
-
drop: opts.yes
|
|
39
|
-
});
|
|
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/db-sync.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 db_sync_exports = {};
|
|
29
|
-
__export(db_sync_exports, {
|
|
30
|
-
default: () => db_sync_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(db_sync_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var db_sync_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("db:sync").auth().preload().action(async (...cliArgs) => {
|
|
36
|
-
const [opts] = cliArgs;
|
|
37
|
-
console.log("db sync...");
|
|
38
|
-
const Collection = app.db.getCollection("collections");
|
|
39
|
-
if (Collection) {
|
|
40
|
-
await Collection.repository.load();
|
|
41
|
-
}
|
|
42
|
-
const force = false;
|
|
43
|
-
await app.db.sync({
|
|
44
|
-
force,
|
|
45
|
-
alter: {
|
|
46
|
-
drop: force
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}, "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/destroy.js
DELETED
|
@@ -1,40 +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 destroy_exports = {};
|
|
29
|
-
__export(destroy_exports, {
|
|
30
|
-
default: () => destroy_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(destroy_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var destroy_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("destroy").preload().action(async (...cliArgs) => {
|
|
36
|
-
await app.destroy({
|
|
37
|
-
cliArgs
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}, "default");
|
package/lib/commands/index.d.ts
DELETED
|
@@ -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
|
-
import Application from '../application';
|
|
10
|
-
export declare function registerCli(app: Application): void;
|
package/lib/commands/index.js
DELETED
|
@@ -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 __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 commands_exports = {};
|
|
39
|
-
__export(commands_exports, {
|
|
40
|
-
registerCli: () => registerCli
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(commands_exports);
|
|
43
|
-
var import_create_migration = __toESM(require("./create-migration"));
|
|
44
|
-
var import_db_auth = __toESM(require("./db-auth"));
|
|
45
|
-
var import_db_clean = __toESM(require("./db-clean"));
|
|
46
|
-
var import_db_sync = __toESM(require("./db-sync"));
|
|
47
|
-
var import_destroy = __toESM(require("./destroy"));
|
|
48
|
-
var import_install = __toESM(require("./install"));
|
|
49
|
-
var import_pm = __toESM(require("./pm"));
|
|
50
|
-
var import_refresh = __toESM(require("./refresh"));
|
|
51
|
-
var import_restart = __toESM(require("./restart"));
|
|
52
|
-
var import_start = __toESM(require("./start"));
|
|
53
|
-
var import_stop = __toESM(require("./stop"));
|
|
54
|
-
var import_upgrade = __toESM(require("./upgrade"));
|
|
55
|
-
var import_console = __toESM(require("./console"));
|
|
56
|
-
/* istanbul ignore file -- @preserve */
|
|
57
|
-
function registerCli(app) {
|
|
58
|
-
(0, import_console.default)(app);
|
|
59
|
-
(0, import_db_auth.default)(app);
|
|
60
|
-
(0, import_create_migration.default)(app);
|
|
61
|
-
(0, import_db_clean.default)(app);
|
|
62
|
-
(0, import_db_sync.default)(app);
|
|
63
|
-
(0, import_install.default)(app);
|
|
64
|
-
(0, import_upgrade.default)(app);
|
|
65
|
-
(0, import_pm.default)(app);
|
|
66
|
-
(0, import_restart.default)(app);
|
|
67
|
-
(0, import_stop.default)(app);
|
|
68
|
-
(0, import_destroy.default)(app);
|
|
69
|
-
(0, import_start.default)(app);
|
|
70
|
-
(0, import_refresh.default)(app);
|
|
71
|
-
app.command("build").argument("[packages...]");
|
|
72
|
-
app.command("clean");
|
|
73
|
-
app.command("dev").usage("[options]").option("-p, --port [port]").option("--client").option("--server");
|
|
74
|
-
app.command("doc").argument("[cmd]", "", "dev");
|
|
75
|
-
app.command("test").option("-c, --db-clean");
|
|
76
|
-
app.command("umi");
|
|
77
|
-
}
|
|
78
|
-
__name(registerCli, "registerCli");
|
|
79
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
80
|
-
0 && (module.exports = {
|
|
81
|
-
registerCli
|
|
82
|
-
});
|
|
@@ -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/install.js
DELETED
|
@@ -1,43 +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 install_exports = {};
|
|
29
|
-
__export(install_exports, {
|
|
30
|
-
default: () => install_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(install_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var install_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("install").ipc().auth().option("-f, --force").option("-c, --clean").option("--lang <lang>").action(async (options) => {
|
|
36
|
-
if (options.lang) {
|
|
37
|
-
process.env.INIT_APP_LANG = options.lang;
|
|
38
|
-
}
|
|
39
|
-
await app.install(options);
|
|
40
|
-
const reinstall = options.clean || options.force;
|
|
41
|
-
app.log.info(`app ${reinstall ? "reinstalled" : "installed"} successfully [v${app.getVersion()}]`);
|
|
42
|
-
});
|
|
43
|
-
}, "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/migrator.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 migrator_exports = {};
|
|
29
|
-
__export(migrator_exports, {
|
|
30
|
-
default: () => migrator_default
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(migrator_exports);
|
|
33
|
-
/* istanbul ignore file -- @preserve */
|
|
34
|
-
var migrator_default = /* @__PURE__ */ __name((app) => {
|
|
35
|
-
app.command("migrator").preload().action(async (opts) => {
|
|
36
|
-
console.log("migrating...");
|
|
37
|
-
await app.emitAsync("cli.beforeMigrator", opts);
|
|
38
|
-
await app.db.migrator.runAsCLI(process.argv.slice(3));
|
|
39
|
-
await app.stop();
|
|
40
|
-
});
|
|
41
|
-
}, "default");
|
package/lib/commands/pm.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;
|