@nocobase/server 1.2.12-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,23 +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 interface PluginData {
10
- name?: string;
11
- packageName?: string;
12
- version?: string;
13
- preVersion?: string;
14
- registry?: string;
15
- clientUrl?: string;
16
- compressedFileUrl?: string;
17
- enabled?: boolean;
18
- type?: 'url' | 'npm' | 'upload';
19
- authToken?: string;
20
- installed?: boolean;
21
- builtIn?: boolean;
22
- options?: any;
23
- }
@@ -1,24 +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 __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
- var types_exports = {};
24
- module.exports = __toCommonJS(types_exports);
@@ -1,115 +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 { AxiosRequestConfig } from 'axios';
10
- import { PluginManagerRepository } from './plugin-manager-repository';
11
- import { PluginData } from './types';
12
- /**
13
- * get temp dir
14
- *
15
- * @example
16
- * getTempDir() => '/tmp/nocobase'
17
- */
18
- export declare function getTempDir(): Promise<string>;
19
- export declare function getPluginStoragePath(): string;
20
- export declare function getLocalPluginPackagesPathArr(): string[];
21
- export declare function getStoragePluginDir(packageName: string): string;
22
- export declare function getLocalPluginDir(packageDirBasename: string): string;
23
- export declare function getNodeModulesPluginDir(packageName: string): string;
24
- export declare function getAuthorizationHeaders(registry?: string, authToken?: string): {};
25
- /**
26
- * get latest version from npm
27
- *
28
- * @example
29
- * getLatestVersion('dayjs', 'https://registry.npmjs.org') => '1.10.6'
30
- */
31
- export declare function getLatestVersion(packageName: string, registry: string, token?: string): Promise<any>;
32
- export declare function getNpmInfo(packageName: string, registry: string, token?: string): Promise<any>;
33
- export declare function download(url: string, destination: string, options?: AxiosRequestConfig): Promise<unknown>;
34
- export declare function removeTmpDir(tempFile: string, tempPackageContentDir: string): Promise<void>;
35
- /**
36
- * download and unzip to node_modules
37
- */
38
- export declare function downloadAndUnzipToTempDir(fileUrl: string, authToken?: string): Promise<{
39
- packageName: any;
40
- version: any;
41
- tempPackageContentDir: string;
42
- tempFile: string;
43
- }>;
44
- export declare function copyTempPackageToStorageAndLinkToNodeModules(tempFile: string, tempPackageContentDir: string, packageName: string): Promise<{
45
- packageDir: string;
46
- }>;
47
- /**
48
- * get package info from npm
49
- *
50
- * @example
51
- * getPluginInfoByNpm('dayjs', 'https://registry.npmjs.org')
52
- * => { fileUrl: 'https://registry.npmjs.org/dayjs/-/dayjs-1.10.6.tgz', latestVersion: '1.10.6' }
53
- *
54
- * getPluginInfoByNpm('dayjs', 'https://registry.npmjs.org', '1.1.0')
55
- * => { fileUrl: 'https://registry.npmjs.org/dayjs/-/dayjs-1.1.0.tgz', latestVersion: '1.1.0' }
56
- */
57
- interface GetPluginInfoOptions {
58
- packageName: string;
59
- registry: string;
60
- version?: string;
61
- authToken?: string;
62
- }
63
- export declare function getPluginInfoByNpm(options: GetPluginInfoOptions): Promise<{
64
- compressedFileUrl: string;
65
- version: string;
66
- }>;
67
- /**
68
- * scan `src/server` directory to get server packages
69
- *
70
- * @example
71
- * getServerPackages('src/server') => ['dayjs', '@nocobase/plugin-bbb']
72
- */
73
- export declare function getServerPackages(packageDir: string): string[];
74
- export declare function removePluginPackage(packageName: string): Promise<[void, void]>;
75
- /**
76
- * get package.json
77
- *
78
- * @example
79
- * getPackageJson('dayjs') => { name: 'dayjs', version: '1.0.0', ... }
80
- */
81
- export declare function getPackageJson(pluginName: string): Promise<any>;
82
- export declare function getPackageJsonByLocalPath(localPath: string): Promise<any>;
83
- export declare function updatePluginByCompressedFileUrl(options: Partial<Pick<PluginData, 'compressedFileUrl' | 'packageName' | 'authToken'>> & {
84
- repository: PluginManagerRepository;
85
- }): Promise<{
86
- packageName: any;
87
- packageDir: string;
88
- version: any;
89
- }>;
90
- export declare function getNewVersion(plugin: PluginData): Promise<string | false>;
91
- export declare function removeRequireCache(fileOrPackageName: string): void;
92
- export declare function requireNoCache(fileOrPackageName: string): Promise<any>;
93
- export declare function readJSONFileContent(filePath: string): Promise<any>;
94
- export declare function requireModule(m: any): any;
95
- export declare function isNotBuiltinModule(packageName: string): boolean;
96
- export declare const isValidPackageName: (str: string) => boolean;
97
- export declare function getPackageNameFromString(str: string): string;
98
- export declare function getPackagesFromFiles(files: string[]): string[];
99
- export declare function getIncludePackages(sourcePackages: string[], external: string[], pluginPrefix: string[]): string[];
100
- export declare function getExcludePackages(sourcePackages: string[], external: string[], pluginPrefix: string[]): string[];
101
- export declare function getExternalVersionFromSource(packageName: string): Promise<Record<string, string>>;
102
- export interface DepCompatible {
103
- name: string;
104
- result: boolean;
105
- versionRange: string;
106
- packageVersion: string;
107
- }
108
- export declare function getCompatible(packageName: string): Promise<false | DepCompatible[]>;
109
- export declare function checkCompatible(packageName: string): Promise<boolean>;
110
- export declare function checkAndGetCompatible(packageName: string): Promise<{
111
- isCompatible: boolean;
112
- depsCompatible: DepCompatible[];
113
- }>;
114
- export declare function getPluginBasePath(packageName: string): Promise<string>;
115
- export {};