@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.
Files changed (124) hide show
  1. package/package.json +14 -14
  2. package/lib/acl/available-action.d.ts +0 -13
  3. package/lib/acl/available-action.js +0 -71
  4. package/lib/acl/index.d.ts +0 -10
  5. package/lib/acl/index.js +0 -46
  6. package/lib/app-command.d.ts +0 -20
  7. package/lib/app-command.js +0 -82
  8. package/lib/app-supervisor.d.ts +0 -69
  9. package/lib/app-supervisor.js +0 -302
  10. package/lib/application.d.ts +0 -345
  11. package/lib/application.js +0 -876
  12. package/lib/cache/index.d.ts +0 -11
  13. package/lib/cache/index.js +0 -44
  14. package/lib/commands/console.d.ts +0 -11
  15. package/lib/commands/console.js +0 -48
  16. package/lib/commands/create-migration.d.ts +0 -11
  17. package/lib/commands/create-migration.js +0 -79
  18. package/lib/commands/db-auth.d.ts +0 -11
  19. package/lib/commands/db-auth.js +0 -38
  20. package/lib/commands/db-clean.d.ts +0 -11
  21. package/lib/commands/db-clean.js +0 -41
  22. package/lib/commands/db-sync.d.ts +0 -11
  23. package/lib/commands/db-sync.js +0 -50
  24. package/lib/commands/destroy.d.ts +0 -11
  25. package/lib/commands/destroy.js +0 -40
  26. package/lib/commands/index.d.ts +0 -10
  27. package/lib/commands/index.js +0 -82
  28. package/lib/commands/install.d.ts +0 -11
  29. package/lib/commands/install.js +0 -43
  30. package/lib/commands/migrator.d.ts +0 -11
  31. package/lib/commands/migrator.js +0 -41
  32. package/lib/commands/pm.d.ts +0 -11
  33. package/lib/commands/pm.js +0 -98
  34. package/lib/commands/refresh.d.ts +0 -11
  35. package/lib/commands/refresh.js +0 -41
  36. package/lib/commands/restart.d.ts +0 -11
  37. package/lib/commands/restart.js +0 -45
  38. package/lib/commands/start.d.ts +0 -11
  39. package/lib/commands/start.js +0 -85
  40. package/lib/commands/stop.d.ts +0 -11
  41. package/lib/commands/stop.js +0 -44
  42. package/lib/commands/upgrade.d.ts +0 -14
  43. package/lib/commands/upgrade.js +0 -39
  44. package/lib/cron/cron-job-manager.d.ts +0 -22
  45. package/lib/cron/cron-job-manager.js +0 -82
  46. package/lib/errors/application-not-install.d.ts +0 -12
  47. package/lib/errors/application-not-install.js +0 -45
  48. package/lib/errors/handler.d.ts +0 -11
  49. package/lib/errors/handler.js +0 -50
  50. package/lib/errors/plugin-command-error.d.ts +0 -10
  51. package/lib/errors/plugin-command-error.js +0 -40
  52. package/lib/errors/plugin-not-exist.d.ts +0 -10
  53. package/lib/errors/plugin-not-exist.js +0 -40
  54. package/lib/gateway/errors.d.ts +0 -30
  55. package/lib/gateway/errors.js +0 -154
  56. package/lib/gateway/index.d.ts +0 -79
  57. package/lib/gateway/index.js +0 -393
  58. package/lib/gateway/ipc-socket-client.d.ts +0 -27
  59. package/lib/gateway/ipc-socket-client.js +0 -110
  60. package/lib/gateway/ipc-socket-server.d.ts +0 -21
  61. package/lib/gateway/ipc-socket-server.js +0 -150
  62. package/lib/gateway/ws-server.d.ts +0 -36
  63. package/lib/gateway/ws-server.js +0 -196
  64. package/lib/helper.d.ts +0 -18
  65. package/lib/helper.js +0 -193
  66. package/lib/helpers/application-version.d.ts +0 -18
  67. package/lib/helpers/application-version.js +0 -88
  68. package/lib/index.d.ts +0 -17
  69. package/lib/index.js +0 -64
  70. package/lib/locale/index.d.ts +0 -9
  71. package/lib/locale/index.js +0 -30
  72. package/lib/locale/locale.d.ts +0 -38
  73. package/lib/locale/locale.js +0 -174
  74. package/lib/locale/resource.d.ts +0 -9
  75. package/lib/locale/resource.js +0 -87
  76. package/lib/main-data-source.d.ts +0 -12
  77. package/lib/main-data-source.js +0 -57
  78. package/lib/middlewares/data-template.d.ts +0 -10
  79. package/lib/middlewares/data-template.js +0 -146
  80. package/lib/middlewares/data-wrapping.d.ts +0 -11
  81. package/lib/middlewares/data-wrapping.js +0 -100
  82. package/lib/middlewares/i18n.d.ts +0 -9
  83. package/lib/middlewares/i18n.js +0 -53
  84. package/lib/middlewares/index.d.ts +0 -10
  85. package/lib/middlewares/index.js +0 -39
  86. package/lib/middlewares/parse-variables.d.ts +0 -9
  87. package/lib/middlewares/parse-variables.js +0 -95
  88. package/lib/middlewares/validate-filter-params.d.ts +0 -9
  89. package/lib/middlewares/validate-filter-params.js +0 -42
  90. package/lib/migration.d.ts +0 -20
  91. package/lib/migration.js +0 -54
  92. package/lib/migrations/20230912193824-package-name-unique.d.ts +0 -14
  93. package/lib/migrations/20230912193824-package-name-unique.js +0 -59
  94. package/lib/migrations/20230912294620-update-pkg.d.ts +0 -14
  95. package/lib/migrations/20230912294620-update-pkg.js +0 -65
  96. package/lib/migrations/20240106082756-update-plugins.d.ts +0 -14
  97. package/lib/migrations/20240106082756-update-plugins.js +0 -51
  98. package/lib/migrations/20240428235620-rename-plugins.d.ts +0 -14
  99. package/lib/migrations/20240428235620-rename-plugins.js +0 -49
  100. package/lib/plugin-manager/clientStaticUtils.d.ts +0 -31
  101. package/lib/plugin-manager/clientStaticUtils.js +0 -129
  102. package/lib/plugin-manager/constants.d.ts +0 -15
  103. package/lib/plugin-manager/constants.js +0 -135
  104. package/lib/plugin-manager/deps.d.ts +0 -10
  105. package/lib/plugin-manager/deps.js +0 -83
  106. package/lib/plugin-manager/index.d.ts +0 -10
  107. package/lib/plugin-manager/index.js +0 -32
  108. package/lib/plugin-manager/middleware.d.ts +0 -10
  109. package/lib/plugin-manager/middleware.js +0 -45
  110. package/lib/plugin-manager/options/collection.d.ts +0 -10
  111. package/lib/plugin-manager/options/collection.js +0 -47
  112. package/lib/plugin-manager/options/resource.d.ts +0 -23
  113. package/lib/plugin-manager/options/resource.js +0 -186
  114. package/lib/plugin-manager/plugin-manager-repository.d.ts +0 -36
  115. package/lib/plugin-manager/plugin-manager-repository.js +0 -158
  116. package/lib/plugin-manager/plugin-manager.d.ts +0 -206
  117. package/lib/plugin-manager/plugin-manager.js +0 -1100
  118. package/lib/plugin-manager/types.d.ts +0 -23
  119. package/lib/plugin-manager/types.js +0 -24
  120. package/lib/plugin-manager/utils.d.ts +0 -115
  121. package/lib/plugin-manager/utils.js +0 -568
  122. package/lib/plugin.d.ts +0 -99
  123. package/lib/plugin.js +0 -228
  124. package/lib/swagger/index.json +0 -1569
@@ -1,59 +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 package_name_unique_exports = {};
29
- __export(package_name_unique_exports, {
30
- default: () => package_name_unique_default
31
- });
32
- module.exports = __toCommonJS(package_name_unique_exports);
33
- var import_database = require("@nocobase/database");
34
- var import_migration = require("../migration");
35
- /* istanbul ignore file -- @preserve */
36
- const _package_name_unique_default = class _package_name_unique_default extends import_migration.Migration {
37
- on = "beforeLoad";
38
- appVersion = "<0.14.0-alpha.2";
39
- async up() {
40
- const tableNameWithSchema = this.pm.collection.getTableNameWithSchema();
41
- const field = this.pm.collection.getField("packageName");
42
- const exists = await field.existsInDb();
43
- if (exists) {
44
- return;
45
- }
46
- try {
47
- await this.db.sequelize.getQueryInterface().addColumn(tableNameWithSchema, field.columnName(), {
48
- type: import_database.DataTypes.STRING
49
- });
50
- await this.db.sequelize.getQueryInterface().addConstraint(tableNameWithSchema, {
51
- type: "unique",
52
- fields: [field.columnName()]
53
- });
54
- } catch (error) {
55
- }
56
- }
57
- };
58
- __name(_package_name_unique_default, "default");
59
- let package_name_unique_default = _package_name_unique_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 { Migration } from '../migration';
10
- export default class extends Migration {
11
- on: string;
12
- appVersion: string;
13
- up(): Promise<void>;
14
- }
@@ -1,65 +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 update_pkg_exports = {};
29
- __export(update_pkg_exports, {
30
- default: () => update_pkg_default
31
- });
32
- module.exports = __toCommonJS(update_pkg_exports);
33
- var import_migration = require("../migration");
34
- var import_plugin_manager = require("../plugin-manager");
35
- /* istanbul ignore file -- @preserve */
36
- const _update_pkg_default = class _update_pkg_default extends import_migration.Migration {
37
- on = "afterSync";
38
- // 'beforeLoad' or 'afterLoad'
39
- appVersion = "<0.14.0-alpha.2";
40
- async up() {
41
- const plugins = await this.pm.repository.find();
42
- for (const plugin of plugins) {
43
- const { name } = plugin;
44
- if (plugin.packageName) {
45
- continue;
46
- }
47
- try {
48
- const packageName = await import_plugin_manager.PluginManager.getPackageName(name);
49
- await this.pm.repository.update({
50
- filter: {
51
- name
52
- },
53
- values: {
54
- packageName
55
- }
56
- });
57
- this.app.log.info(`update ${packageName}`);
58
- } catch (error) {
59
- this.app.log.warn(error.message);
60
- }
61
- }
62
- }
63
- };
64
- __name(_update_pkg_default, "default");
65
- let update_pkg_default = _update_pkg_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 { Migration } from '../migration';
10
- export default class extends Migration {
11
- on: string;
12
- appVersion: string;
13
- up(): Promise<void>;
14
- }
@@ -1,51 +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 update_plugins_exports = {};
29
- __export(update_plugins_exports, {
30
- default: () => update_plugins_default
31
- });
32
- module.exports = __toCommonJS(update_plugins_exports);
33
- var import_migration = require("../migration");
34
- /* istanbul ignore file -- @preserve */
35
- const _update_plugins_default = class _update_plugins_default extends import_migration.Migration {
36
- on = "afterSync";
37
- // 'beforeLoad' or 'afterLoad'
38
- appVersion = "<0.18.0-alpha.10";
39
- async up() {
40
- await this.pm.repository.update({
41
- values: {
42
- installed: true
43
- },
44
- filter: {
45
- enabled: true
46
- }
47
- });
48
- }
49
- };
50
- __name(_update_plugins_default, "default");
51
- let update_plugins_default = _update_plugins_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 { Migration } from '../migration';
10
- export default class extends Migration {
11
- on: string;
12
- appVersion: string;
13
- up(): Promise<void>;
14
- }
@@ -1,49 +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 rename_plugins_exports = {};
29
- __export(rename_plugins_exports, {
30
- default: () => rename_plugins_default
31
- });
32
- module.exports = __toCommonJS(rename_plugins_exports);
33
- var import_migration = require("../migration");
34
- const _rename_plugins_default = class _rename_plugins_default extends import_migration.Migration {
35
- on = "afterSync";
36
- // 'beforeLoad' or 'afterLoad'
37
- appVersion = "<1.0.0-alpha.3";
38
- async up() {
39
- const items = await this.pm.repository.find();
40
- for (const item of items) {
41
- if (item.name.startsWith("@nocobase/plugin-")) {
42
- item.set("name", item.name.substring("@nocobase/plugin-".length));
43
- await item.save();
44
- }
45
- }
46
- }
47
- };
48
- __name(_rename_plugins_default, "default");
49
- let rename_plugins_default = _rename_plugins_default;
@@ -1,31 +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 const PLUGIN_STATICS_PATH = "/static/plugins/";
10
- /**
11
- * get package.json path for specific NPM package
12
- */
13
- export declare function getDepPkgPath(packageName: string, cwd?: string): string;
14
- export declare function getPackageDir(packageName: string): string;
15
- export declare function getPackageFilePath(packageName: string, filePath: string): string;
16
- export declare function getPackageFilePathWithExistCheck(packageName: string, filePath: string): {
17
- filePath: string;
18
- exists: boolean;
19
- };
20
- export declare function getExposeUrl(packageName: string, filePath: string): string;
21
- export declare function getExposeReadmeUrl(packageName: string, lang: string): string;
22
- export declare function getExposeChangelogUrl(packageName: string): string;
23
- /**
24
- * get package name by client static url
25
- *
26
- * @example
27
- * getPluginNameByClientStaticUrl('/static/plugins/dayjs/index.js') => 'dayjs'
28
- * getPluginNameByClientStaticUrl('/static/plugins/@nocobase/foo/README.md') => '@nocobase/foo'
29
- */
30
- export declare function getPackageNameByExposeUrl(pathname: string): string;
31
- export declare function getPackageDirByExposeUrl(pathname: string): string;
@@ -1,129 +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 clientStaticUtils_exports = {};
39
- __export(clientStaticUtils_exports, {
40
- PLUGIN_STATICS_PATH: () => PLUGIN_STATICS_PATH,
41
- getDepPkgPath: () => getDepPkgPath,
42
- getExposeChangelogUrl: () => getExposeChangelogUrl,
43
- getExposeReadmeUrl: () => getExposeReadmeUrl,
44
- getExposeUrl: () => getExposeUrl,
45
- getPackageDir: () => getPackageDir,
46
- getPackageDirByExposeUrl: () => getPackageDirByExposeUrl,
47
- getPackageFilePath: () => getPackageFilePath,
48
- getPackageFilePathWithExistCheck: () => getPackageFilePathWithExistCheck,
49
- getPackageNameByExposeUrl: () => getPackageNameByExposeUrl
50
- });
51
- module.exports = __toCommonJS(clientStaticUtils_exports);
52
- var import_fs = __toESM(require("fs"));
53
- var import_path = __toESM(require("path"));
54
- /* istanbul ignore file -- @preserve */
55
- const PLUGIN_STATICS_PATH = "/static/plugins/";
56
- function getDepPkgPath(packageName, cwd) {
57
- try {
58
- return require.resolve(`${packageName}/package.json`, { paths: cwd ? [cwd] : void 0 });
59
- } catch {
60
- const mainFile = require.resolve(`${packageName}`, { paths: cwd ? [cwd] : void 0 });
61
- const packageDir = mainFile.slice(0, mainFile.indexOf(packageName.replace("/", import_path.default.sep)) + packageName.length);
62
- return import_path.default.join(packageDir, "package.json");
63
- }
64
- }
65
- __name(getDepPkgPath, "getDepPkgPath");
66
- function getPackageDir(packageName) {
67
- const packageJsonPath = getDepPkgPath(packageName);
68
- return import_path.default.dirname(packageJsonPath);
69
- }
70
- __name(getPackageDir, "getPackageDir");
71
- function getPackageFilePath(packageName, filePath) {
72
- const packageDir = getPackageDir(packageName);
73
- return import_path.default.join(packageDir, filePath);
74
- }
75
- __name(getPackageFilePath, "getPackageFilePath");
76
- function getPackageFilePathWithExistCheck(packageName, filePath) {
77
- const absolutePath = getPackageFilePath(packageName, filePath);
78
- const exists = import_fs.default.existsSync(absolutePath);
79
- return {
80
- filePath: absolutePath,
81
- exists
82
- };
83
- }
84
- __name(getPackageFilePathWithExistCheck, "getPackageFilePathWithExistCheck");
85
- function getExposeUrl(packageName, filePath) {
86
- return `${process.env.PLUGIN_STATICS_PATH}${packageName}/${filePath}`;
87
- }
88
- __name(getExposeUrl, "getExposeUrl");
89
- function getExposeReadmeUrl(packageName, lang) {
90
- let READMEPath = null;
91
- if (getPackageFilePathWithExistCheck(packageName, `README.${lang}.md`).exists) {
92
- READMEPath = `README.${lang}.md`;
93
- } else if (getPackageFilePathWithExistCheck(packageName, "README.md").exists) {
94
- READMEPath = "README.md";
95
- }
96
- return READMEPath ? getExposeUrl(packageName, READMEPath) : null;
97
- }
98
- __name(getExposeReadmeUrl, "getExposeReadmeUrl");
99
- function getExposeChangelogUrl(packageName) {
100
- const { exists } = getPackageFilePathWithExistCheck(packageName, "CHANGELOG.md");
101
- return exists ? getExposeUrl(packageName, "CHANGELOG.md") : null;
102
- }
103
- __name(getExposeChangelogUrl, "getExposeChangelogUrl");
104
- function getPackageNameByExposeUrl(pathname) {
105
- pathname = pathname.replace(process.env.PLUGIN_STATICS_PATH, "");
106
- const pathArr = pathname.split("/");
107
- if (pathname.startsWith("@")) {
108
- return pathArr.slice(0, 2).join("/");
109
- }
110
- return pathArr[0];
111
- }
112
- __name(getPackageNameByExposeUrl, "getPackageNameByExposeUrl");
113
- function getPackageDirByExposeUrl(pathname) {
114
- return getPackageDir(getPackageNameByExposeUrl(pathname));
115
- }
116
- __name(getPackageDirByExposeUrl, "getPackageDirByExposeUrl");
117
- // Annotate the CommonJS export names for ESM import in node:
118
- 0 && (module.exports = {
119
- PLUGIN_STATICS_PATH,
120
- getDepPkgPath,
121
- getExposeChangelogUrl,
122
- getExposeReadmeUrl,
123
- getExposeUrl,
124
- getPackageDir,
125
- getPackageDirByExposeUrl,
126
- getPackageFilePath,
127
- getPackageFilePathWithExistCheck,
128
- getPackageNameByExposeUrl
129
- });
@@ -1,15 +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 const APP_NAME = "nocobase";
10
- export declare const DEFAULT_PLUGIN_STORAGE_PATH = "storage/plugins";
11
- export declare const DEFAULT_PLUGIN_PATH = "packages/plugins/";
12
- export declare const pluginPrefix: string[];
13
- export declare const requireRegex: RegExp;
14
- export declare const importRegex: RegExp;
15
- export declare const EXTERNAL: string[];
@@ -1,135 +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 __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var constants_exports = {};
28
- __export(constants_exports, {
29
- APP_NAME: () => APP_NAME,
30
- DEFAULT_PLUGIN_PATH: () => DEFAULT_PLUGIN_PATH,
31
- DEFAULT_PLUGIN_STORAGE_PATH: () => DEFAULT_PLUGIN_STORAGE_PATH,
32
- EXTERNAL: () => EXTERNAL,
33
- importRegex: () => importRegex,
34
- pluginPrefix: () => pluginPrefix,
35
- requireRegex: () => requireRegex
36
- });
37
- module.exports = __toCommonJS(constants_exports);
38
- const APP_NAME = "nocobase";
39
- const DEFAULT_PLUGIN_STORAGE_PATH = "storage/plugins";
40
- const DEFAULT_PLUGIN_PATH = "packages/plugins/";
41
- const pluginPrefix = (process.env.PLUGIN_PACKAGE_PREFIX || "@nocobase/plugin-,@nocobase/preset-,@nocobase/plugin-pro-").split(",");
42
- const requireRegex = /require\s*\(['"`](.*?)['"`]\)/g;
43
- const importRegex = /^import(?:['"\s]*([\w*${}\s,]+)from\s*)?['"\s]['"\s](.*[@\w_-]+)['"\s].*/gm;
44
- const EXTERNAL = [
45
- // nocobase
46
- "@nocobase/acl",
47
- "@nocobase/actions",
48
- "@nocobase/auth",
49
- "@nocobase/cache",
50
- "@nocobase/client",
51
- "@nocobase/database",
52
- "@nocobase/evaluators",
53
- "@nocobase/logger",
54
- "@nocobase/resourcer",
55
- "@nocobase/sdk",
56
- "@nocobase/server",
57
- "@nocobase/test",
58
- "@nocobase/utils",
59
- // @nocobase/auth
60
- "jsonwebtoken",
61
- // @nocobase/cache
62
- "cache-manager",
63
- // @nocobase/database
64
- "sequelize",
65
- "umzug",
66
- "async-mutex",
67
- // @nocobase/evaluators
68
- "@formulajs/formulajs",
69
- "mathjs",
70
- // @nocobase/logger
71
- "winston",
72
- "winston-daily-rotate-file",
73
- // koa
74
- "koa",
75
- "@koa/cors",
76
- "@koa/router",
77
- "multer",
78
- "@koa/multer",
79
- "koa-bodyparser",
80
- "koa-static",
81
- "koa-send",
82
- // react
83
- "react",
84
- "react-dom",
85
- "react/jsx-runtime",
86
- // react-router
87
- "react-router",
88
- "react-router-dom",
89
- // antd
90
- "antd",
91
- "antd-style",
92
- "@ant-design/icons",
93
- "@ant-design/cssinjs",
94
- // i18next
95
- "i18next",
96
- "react-i18next",
97
- // dnd-kit 相关
98
- "@dnd-kit/accessibility",
99
- "@dnd-kit/core",
100
- "@dnd-kit/modifiers",
101
- "@dnd-kit/sortable",
102
- "@dnd-kit/utilities",
103
- // formily 相关
104
- "@formily/antd-v5",
105
- "@formily/core",
106
- "@formily/react",
107
- "@formily/json-schema",
108
- "@formily/path",
109
- "@formily/validator",
110
- "@formily/shared",
111
- "@formily/reactive",
112
- "@formily/reactive-react",
113
- // utils
114
- "dayjs",
115
- "mysql2",
116
- "pg",
117
- "pg-hstore",
118
- "sqlite3",
119
- "supertest",
120
- "axios",
121
- "@emotion/css",
122
- "ahooks",
123
- "lodash",
124
- "china-division"
125
- ];
126
- // Annotate the CommonJS export names for ESM import in node:
127
- 0 && (module.exports = {
128
- APP_NAME,
129
- DEFAULT_PLUGIN_PATH,
130
- DEFAULT_PLUGIN_STORAGE_PATH,
131
- EXTERNAL,
132
- importRegex,
133
- pluginPrefix,
134
- requireRegex
135
- });
@@ -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
- declare const deps: Record<string, string>;
10
- export default deps;
@@ -1,83 +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 __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var deps_exports = {};
28
- __export(deps_exports, {
29
- default: () => deps_default
30
- });
31
- module.exports = __toCommonJS(deps_exports);
32
- var import_package = require("../../package.json");
33
- const deps = {
34
- "@nocobase": `${import_package.version.split(".").slice(0, 2).join(".")}.x`,
35
- // 0.12.x
36
- "@formily": "2.x",
37
- "@formily/antd-v5": "1.x",
38
- jsonwebtoken: "8.x",
39
- "cache-manager": "5.x",
40
- sequelize: "6.x",
41
- umzug: "3.x",
42
- "async-mutex": "0.3.x",
43
- "@formulajs/formulajs": "4.x",
44
- mathjs: "10.x",
45
- winston: "3.x",
46
- "winston-daily-rotate-file": "4.x",
47
- koa: "2.x",
48
- "@koa/cors": "3.x",
49
- "@koa/router": "9.x",
50
- multer: "1.x",
51
- "@koa/multer": "3.x",
52
- "koa-bodyparser": "4.x",
53
- "koa-static": "5.x",
54
- "koa-send": "5.x",
55
- react: "18.x",
56
- "react-dom": "18.x",
57
- "react-router": "6.x",
58
- "react-router-dom": "6.x",
59
- antd: "5.x",
60
- "antd-style": "3.x",
61
- "@ant-design/icons": "5.x",
62
- "@ant-design/cssinjs": "1.x",
63
- i18next: "22.x",
64
- "react-i18next": "11.x",
65
- "@dnd-kit/accessibility": "3.x",
66
- "@dnd-kit/core": "5.x",
67
- "@dnd-kit/modifiers": "6.x",
68
- "@dnd-kit/sortable": "6.x",
69
- "@dnd-kit/utilities": "3.x",
70
- dayjs: "1.x",
71
- mysql2: "2.x",
72
- pg: "8.x",
73
- "pg-hstore": "2.x",
74
- sqlite3: "5.x",
75
- supertest: "6.x",
76
- axios: "0.26.x",
77
- "@emotion/css": "11.x",
78
- ahooks: "3.x",
79
- lodash: "4.x",
80
- "china-division": "2.x",
81
- cronstrue: "2.x"
82
- };
83
- var deps_default = deps;