@nocobase/server 2.1.0-alpha.2 → 2.1.0-alpha.21

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 (51) hide show
  1. package/LICENSE +201 -661
  2. package/README.md +79 -10
  3. package/lib/acl/available-action.js +1 -1
  4. package/lib/aes-encryptor.js +3 -2
  5. package/lib/ai/create-docs-index.js +2 -1
  6. package/lib/app-supervisor/app-options-factory.d.ts +1 -0
  7. package/lib/app-supervisor/index.js +15 -1
  8. package/lib/app-supervisor/main-only-adapter.d.ts +1 -1
  9. package/lib/app-supervisor/main-only-adapter.js +17 -12
  10. package/lib/application.d.ts +1 -2
  11. package/lib/application.js +3 -24
  12. package/lib/commands/create-migration.js +1 -1
  13. package/lib/commands/install.js +3 -1
  14. package/lib/commands/pm.js +7 -0
  15. package/lib/commands/start.js +2 -2
  16. package/lib/commands/upgrade.js +3 -1
  17. package/lib/event-queue.js +1 -1
  18. package/lib/gateway/index.d.ts +13 -3
  19. package/lib/gateway/index.js +137 -15
  20. package/lib/gateway/utils.d.ts +17 -0
  21. package/lib/gateway/utils.js +115 -0
  22. package/lib/helper.js +33 -1
  23. package/lib/index.d.ts +1 -0
  24. package/lib/index.js +2 -0
  25. package/lib/main-data-source.js +1 -1
  26. package/lib/plugin-manager/deps.js +2 -1
  27. package/lib/plugin-manager/options/resource.d.ts +11 -1
  28. package/lib/plugin-manager/options/resource.js +153 -53
  29. package/lib/plugin-manager/plugin-manager.d.ts +7 -2
  30. package/lib/plugin-manager/plugin-manager.js +56 -43
  31. package/lib/plugin-manager/utils.d.ts +7 -1
  32. package/lib/plugin-manager/utils.js +33 -9
  33. package/lib/plugin.js +47 -2
  34. package/lib/pub-sub-manager/handler-manager.d.ts +1 -0
  35. package/lib/pub-sub-manager/handler-manager.js +11 -0
  36. package/lib/pub-sub-manager/pub-sub-manager.js +2 -1
  37. package/lib/swagger/app.d.ts +102 -0
  38. package/lib/swagger/app.js +124 -0
  39. package/lib/swagger/base.d.ts +244 -0
  40. package/lib/swagger/base.js +292 -0
  41. package/lib/swagger/collections.d.ts +996 -0
  42. package/lib/swagger/collections.js +1264 -0
  43. package/lib/swagger/index.d.ts +1774 -0
  44. package/lib/swagger/index.js +70 -0
  45. package/lib/swagger/pm.d.ts +462 -0
  46. package/lib/swagger/pm.js +422 -0
  47. package/lib/sync-message-manager.js +8 -1
  48. package/lib/worker-mode.d.ts +19 -0
  49. package/lib/worker-mode.js +67 -0
  50. package/package.json +18 -18
  51. package/lib/swagger/index.json +0 -1569
package/README.md CHANGED
@@ -1,17 +1,24 @@
1
1
  # NocoBase
2
2
 
3
3
  <video width="100%" controls>
4
- <source src="https://static-docs.nocobase.com/NocoBase0510.mp4" type="video/mp4">
4
+ <source src="https://github.com/user-attachments/assets/4d11a87b-00e2-48f3-9bf7-389d21072d13" type="video/mp4">
5
5
  </video>
6
6
 
7
+ <p align="center">
8
+ <a href="https://trendshift.io/repositories/4112" target="_blank"><img src="https://trendshift.io/api/badge/repositories/4112" alt="nocobase%2Fnocobase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
9
+ <a href="https://www.producthunt.com/posts/nocobase?embed=true&utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-nocobase" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=456520&theme=light&period=weekly&topic_id=267" alt="NocoBase - Scalability&#0045;first&#0044;&#0032;open&#0045;source&#0032;no&#0045;code&#0032;platform | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
10
+ </p>
7
11
 
8
12
  ## What is NocoBase
9
13
 
10
- NocoBase is a scalability-first, open-source no-code development platform.
11
- Instead of investing years of time and millions of dollars in research and development, deploy NocoBase in a few minutes and you'll have a private, controllable, and extremely scalable no-code development platform!
14
+ NocoBase is the most extensible AI-powered no-code platform.
15
+ Total control. Infinite extensibility. AI collaboration.
16
+ Enable your team to adapt quickly and cut costs dramatically.
17
+ No years of development. No millions wasted.
18
+ Deploy NocoBase in minutes — and take control of everything.
12
19
 
13
20
  Homepage:
14
- https://www.nocobase.com/
21
+ https://www.nocobase.com/
15
22
 
16
23
  Online Demo:
17
24
  https://demo.nocobase.com/new
@@ -19,12 +26,74 @@ https://demo.nocobase.com/new
19
26
  Documents:
20
27
  https://docs.nocobase.com/
21
28
 
22
- Commericial license & plugins:
23
- https://www.nocobase.com/en/commercial
29
+ Forum:
30
+ https://forum.nocobase.com/
24
31
 
25
- License agreement:
26
- https://www.nocobase.com/en/agreement
32
+ Use Cases:
33
+ https://www.nocobase.com/en/blog/tags/customer-stories
27
34
 
35
+ ## Release Notes
28
36
 
29
- ## Contact Us:
30
- hello@nocobase.com
37
+ Our [blog](https://www.nocobase.com/en/blog/timeline) is regularly updated with release notes and provides a weekly summary.
38
+
39
+ ## Distinctive features
40
+
41
+ ### 1. Data model-driven, not form/table–driven
42
+
43
+ Instead of being constrained by forms or tables, NocoBase adopts a data model–driven approach, separating data structure from user interface to unlock unlimited possibilities.
44
+
45
+ - UI and data structure are fully decoupled
46
+ - Multiple blocks and actions can be created for the same table or record in any quantity or form
47
+ - Supports the main database, external databases, and third-party APIs as data sources
48
+
49
+ ![model](https://static-docs.nocobase.com/model.png)
50
+
51
+ ### 2. AI employees, integrated into your business systems
52
+ Unlike standalone AI demos, NocoBase allows you to embed AI capabilities seamlessly into your interfaces, workflows, and data context, making AI truly useful in real business scenarios.
53
+
54
+ - Define AI employees for roles such as translator, analyst, researcher, or assistant
55
+ - Seamless AI–human collaboration in interfaces and workflows
56
+ - Ensure AI usage is secure, transparent, and customizable for your business needs
57
+
58
+ ![AI-employee](https://static-docs.nocobase.com/ai-employee-home.png)
59
+
60
+ ### 3. What you see is what you get, incredibly easy to use
61
+
62
+ While enabling the development of complex business systems, NocoBase keeps the experience simple and intuitive.
63
+
64
+ - One-click switch between usage mode and configuration mode
65
+ - Pages serve as a canvas to arrange blocks and actions, similar to Notion
66
+ - Configuration mode is designed for ordinary users, not just programmers
67
+
68
+ ![wysiwyg](https://static-docs.nocobase.com/wysiwyg.gif)
69
+
70
+ ### 4. Everything is a plugin, designed for extension
71
+ Adding more no-code features will never cover every business case. NocoBase is built for extension through its plugin-based microkernel architecture.
72
+
73
+ - All functionalities are plugins, similar to WordPress
74
+ - Plugins are ready to use upon installation
75
+ - Pages, blocks, actions, APIs, and data sources can all be extended through custom plugins
76
+
77
+ ![plugins](https://static-docs.nocobase.com/plugins.png)
78
+
79
+ ## Installation
80
+
81
+ NocoBase supports three installation methods:
82
+
83
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/docker-compose">Installing With Docker (👍Recommended)</a>
84
+
85
+ Suitable for no-code scenarios, no code to write. When upgrading, just download the latest image and reboot.
86
+
87
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/create-nocobase-app">Installing from create-nocobase-app CLI</a>
88
+
89
+ The business code of the project is completely independent and supports low-code development.
90
+
91
+ - <a target="_blank" href="https://docs.nocobase.com/welcome/getting-started/installation/git-clone">Installing from Git source code</a>
92
+
93
+ If you want to experience the latest unreleased version, or want to participate in the contribution, you need to make changes and debug on the source code, it is recommended to choose this installation method, which requires a high level of development skills, and if the code has been updated, you can git pull the latest code.
94
+
95
+ ## How NocoBase works
96
+
97
+ <video width="100%" controls>
98
+ <source src="https://github.com/user-attachments/assets/8d183b44-9bb5-4792-b08f-bc08fe8dfaaf" type="video/mp4">
99
+ </video>
@@ -50,7 +50,7 @@ const availableActions = {
50
50
  view: {
51
51
  displayName: '{{t("View")}}',
52
52
  type: "old-data",
53
- aliases: ["get", "list"],
53
+ aliases: ["get", "list", "query"],
54
54
  allowConfigureFields: true
55
55
  },
56
56
  update: {
@@ -44,6 +44,7 @@ module.exports = __toCommonJS(aes_encryptor_exports);
44
44
  var import_crypto = __toESM(require("crypto"));
45
45
  var import_fs_extra = __toESM(require("fs-extra"));
46
46
  var import_path = __toESM(require("path"));
47
+ var import_utils = require("@nocobase/utils");
47
48
  const _AesEncryptor = class _AesEncryptor {
48
49
  key;
49
50
  constructor(key) {
@@ -99,12 +100,12 @@ const _AesEncryptor = class _AesEncryptor {
99
100
  }
100
101
  }
101
102
  static async getKeyPath(appName) {
102
- const appKeyPath = import_path.default.resolve(process.cwd(), "storage", "apps", appName, "aes_key.dat");
103
+ const appKeyPath = (0, import_utils.storagePathJoin)("apps", appName, "aes_key.dat");
103
104
  const appKeyExists = await import_fs_extra.default.exists(appKeyPath);
104
105
  if (appKeyExists) {
105
106
  return appKeyPath;
106
107
  }
107
- const envKeyPath = import_path.default.resolve(process.cwd(), "storage", "environment-variables", appName, "aes_key.dat");
108
+ const envKeyPath = (0, import_utils.storagePathJoin)("environment-variables", appName, "aes_key.dat");
108
109
  const envKeyExists = await import_fs_extra.default.exists(envKeyPath);
109
110
  if (envKeyExists) {
110
111
  return envKeyPath;
@@ -43,10 +43,11 @@ module.exports = __toCommonJS(create_docs_index_exports);
43
43
  var import_fast_glob = __toESM(require("fast-glob"));
44
44
  var import_fs_extra = __toESM(require("fs-extra"));
45
45
  var import_path = __toESM(require("path"));
46
+ var import_utils = require("@nocobase/utils");
46
47
  var import_ai = require("@nocobase/ai");
47
48
  var import_findPackageNames = require("../plugin-manager/findPackageNames");
48
49
  var import_plugin_manager = require("../plugin-manager");
49
- const DOCS_STORAGE_DIR = import_path.default.resolve(process.cwd(), "storage/ai/docs");
50
+ const DOCS_STORAGE_DIR = (0, import_utils.storagePathJoin)("ai", "docs");
50
51
  const REFERENCE_START = "<!-- docs:references:start -->";
51
52
  const REFERENCE_END = "<!-- docs:references:end -->";
52
53
  const SPLIT_REFERENCE_START = "<!-- docs:splits:start -->";
@@ -16,6 +16,7 @@ export declare const appOptionsFactory: (appName: string, mainApp: Application,
16
16
  migrator?: any;
17
17
  usingBigIntForId?: boolean;
18
18
  underscored?: boolean;
19
+ rawTimezone?: string;
19
20
  logger?: import("@nocobase/logger/lib/logger").Logger | import("@nocobase/logger/lib/logger").LoggerOptions;
20
21
  customHooks?: any;
21
22
  instanceId?: string;
@@ -47,6 +47,7 @@ var import_lodash = __toESM(require("lodash"));
47
47
  var import_utils = require("@nocobase/utils");
48
48
  var import_events = require("events");
49
49
  var import_application = __toESM(require("../application"));
50
+ var import_worker_mode = require("../worker-mode");
50
51
  var import_main_only_adapter = require("./main-only-adapter");
51
52
  var import_handler = require("../errors/handler");
52
53
  var import_condition_registry = require("./condition-registry");
@@ -288,6 +289,10 @@ const _AppSupervisor = class _AppSupervisor extends import_events.EventEmitter {
288
289
  return this.discoveryAdapter.getAppStatus(appName, defaultStatus);
289
290
  }
290
291
  async setAppStatus(appName, status, options = {}) {
292
+ if ((0, import_worker_mode.isTransient)()) {
293
+ this.logger.debug("App running as worker, status will not be set", { appName, status });
294
+ return;
295
+ }
291
296
  this.logger.debug("Setting app status", { appName, status });
292
297
  return this.discoveryAdapter.setAppStatus(appName, status, options);
293
298
  }
@@ -329,7 +334,7 @@ const _AppSupervisor = class _AppSupervisor extends import_events.EventEmitter {
329
334
  };
330
335
  }
331
336
  const app = new import_application.default(options);
332
- if (hook !== false) {
337
+ if (hook ?? !(0, import_worker_mode.isTransient)()) {
333
338
  app.on("afterStart", async () => {
334
339
  await this.sendSyncMessage(mainApp, {
335
340
  type: "app:started",
@@ -356,6 +361,9 @@ const _AppSupervisor = class _AppSupervisor extends import_events.EventEmitter {
356
361
  this.registerCommandHandler(app);
357
362
  app.on("afterStart", async (app2) => {
358
363
  var _a, _b;
364
+ if ((0, import_worker_mode.isTransient)()) {
365
+ return;
366
+ }
359
367
  await app2.syncMessageManager.subscribe(
360
368
  "app_supervisor:sync",
361
369
  async (message) => {
@@ -390,6 +398,9 @@ const _AppSupervisor = class _AppSupervisor extends import_events.EventEmitter {
390
398
  }
391
399
  });
392
400
  app.on("afterDestroy", async (app2) => {
401
+ if ((0, import_worker_mode.isTransient)()) {
402
+ return;
403
+ }
393
404
  await this.unregisterEnvironment();
394
405
  });
395
406
  return app;
@@ -586,6 +597,9 @@ const _AppSupervisor = class _AppSupervisor extends import_events.EventEmitter {
586
597
  return super.on(eventName, listener);
587
598
  }
588
599
  bindAppEvents(app) {
600
+ if ((0, import_worker_mode.isTransient)()) {
601
+ return;
602
+ }
589
603
  app.on("afterDestroy", async () => {
590
604
  delete this.apps[app.name];
591
605
  delete this.appStatus[app.name];
@@ -13,7 +13,7 @@ import type { AppSupervisor } from './index';
13
13
  export declare class MainOnlyAdapter implements AppDiscoveryAdapter, AppProcessAdapter {
14
14
  protected readonly supervisor: AppSupervisor;
15
15
  readonly name: string;
16
- app: Application;
16
+ apps: Record<string, Application>;
17
17
  status: AppStatus;
18
18
  appErrors: Record<string, Error>;
19
19
  constructor(supervisor: AppSupervisor);
@@ -36,7 +36,7 @@ const _MainOnlyAdapter = class _MainOnlyAdapter {
36
36
  this.name = "main-only";
37
37
  }
38
38
  name;
39
- app;
39
+ apps = {};
40
40
  status;
41
41
  appErrors = {};
42
42
  async getApp(appName, options = {}) {
@@ -47,10 +47,10 @@ const _MainOnlyAdapter = class _MainOnlyAdapter {
47
47
  if (!options.withOutBootStrap) {
48
48
  await this.bootstrapApp(appName);
49
49
  }
50
- return this.app;
50
+ return this.apps[appName];
51
51
  }
52
52
  async bootstrapApp(appName) {
53
- if (appName !== "main" || !this.app) {
53
+ if (appName !== "main" || !this.apps[appName]) {
54
54
  this.setAppStatus(appName, "not_found");
55
55
  return;
56
56
  }
@@ -66,23 +66,23 @@ const _MainOnlyAdapter = class _MainOnlyAdapter {
66
66
  this.supervisor.logger.warn(`only main app is supported`, { method: "addApp" });
67
67
  return;
68
68
  }
69
- if (this.app) {
69
+ if (this.apps[app.name]) {
70
70
  throw new Error(`app ${app.name} already exists`);
71
71
  }
72
- this.app = app;
72
+ this.apps[app.name] = app;
73
73
  if (!this.status || this.status === "not_found") {
74
74
  this.setAppStatus(app.name, "preparing");
75
75
  }
76
76
  return app;
77
77
  }
78
78
  getApps() {
79
- return [this.app];
79
+ return Object.values(this.apps);
80
80
  }
81
81
  hasApp(appName) {
82
82
  if (appName !== "main") {
83
83
  return false;
84
84
  }
85
- return !!this.app;
85
+ return !!this.apps[appName];
86
86
  }
87
87
  async startApp(appName) {
88
88
  if (appName !== "main") {
@@ -93,31 +93,36 @@ const _MainOnlyAdapter = class _MainOnlyAdapter {
93
93
  await (app == null ? void 0 : app.runCommand("start", "--quickstart"));
94
94
  }
95
95
  async stopApp(appName) {
96
+ var _a;
96
97
  if (appName !== "main") {
97
98
  this.supervisor.logger.warn(`only main app is supported`, { method: "stopApp" });
98
99
  return;
99
100
  }
100
- await this.app.runCommand("stop");
101
+ if (!this.apps[appName]) {
102
+ return;
103
+ }
104
+ await ((_a = this.apps[appName]) == null ? void 0 : _a.runCommand("stop"));
101
105
  }
102
106
  async removeApp(appName) {
103
107
  if (appName !== "main") {
104
108
  this.supervisor.logger.warn(`only main app is supported`, { method: "removeApp" });
105
109
  return;
106
110
  }
107
- if (!this.app) {
111
+ if (!this.apps[appName]) {
108
112
  return;
109
113
  }
110
- await this.app.runCommand("destroy");
114
+ await this.apps[appName].runCommand("destroy");
115
+ this.apps[appName] = null;
111
116
  }
112
117
  async upgradeApp(appName) {
113
118
  if (appName !== "main") {
114
119
  this.supervisor.logger.warn(`only main app is supported`, { method: "upgrade" });
115
120
  return;
116
121
  }
117
- if (!this.app) {
122
+ if (!this.apps[appName]) {
118
123
  return;
119
124
  }
120
- await this.app.runCommand("upgrade");
125
+ await this.apps[appName].runCommand("upgrade");
121
126
  }
122
127
  async removeAllApps() {
123
128
  return this.removeApp("main");
@@ -270,8 +270,7 @@ export declare class Application<StateT = DefaultState, ContextT = DefaultContex
270
270
  protected _aesEncryptor: AesEncryptor;
271
271
  get aesEncryptor(): AesEncryptor;
272
272
  /**
273
- * Check if the application is serving as a specific worker.
274
- * @experimental
273
+ * @deprecated use {@link serving} from './worker-mode' instead.
275
274
  */
276
275
  serving(key?: string): boolean;
277
276
  /**
@@ -87,6 +87,7 @@ var import_redis_connection_manager = require("./redis-connection-manager");
87
87
  var import_service_container = require("./service-container");
88
88
  var import_snowflake_id_field = require("./snowflake-id-field");
89
89
  var import_worker_id_allocator = require("./worker-id-allocator");
90
+ var import_worker_mode = require("./worker-mode");
90
91
  const _Application = class _Application extends import_koa.default {
91
92
  constructor(options) {
92
93
  super();
@@ -282,32 +283,10 @@ const _Application = class _Application extends import_koa.default {
282
283
  return this._aesEncryptor;
283
284
  }
284
285
  /**
285
- * Check if the application is serving as a specific worker.
286
- * @experimental
286
+ * @deprecated use {@link serving} from './worker-mode' instead.
287
287
  */
288
288
  serving(key) {
289
- const { WORKER_MODE = "" } = process.env;
290
- if (!WORKER_MODE) {
291
- return true;
292
- }
293
- if (WORKER_MODE === "-") {
294
- return false;
295
- }
296
- const topics = WORKER_MODE.trim().split(",");
297
- if (key) {
298
- if (WORKER_MODE === "*") {
299
- return true;
300
- }
301
- if (topics.includes(key)) {
302
- return true;
303
- }
304
- return false;
305
- } else {
306
- if (topics.includes("!")) {
307
- return true;
308
- }
309
- return false;
310
- }
289
+ return (0, import_worker_mode.serving)(key);
311
290
  }
312
291
  /**
313
292
  * @internal
@@ -76,6 +76,6 @@ export default class extends Migration {
76
76
  `;
77
77
  await import_fs.default.promises.mkdir((0, import_path.dirname)(filename), { recursive: true });
78
78
  await import_fs.default.promises.writeFile(filename, data, "utf8");
79
- app.log.info(`migration file in ${filename}`);
79
+ console.log(`migration file in ${filename}`);
80
80
  });
81
81
  }, "default");
@@ -37,7 +37,9 @@ var install_default = /* @__PURE__ */ __name((app) => {
37
37
  if (options.lang) {
38
38
  process.env.INIT_APP_LANG = options.lang;
39
39
  }
40
- await (0, import_create_docs_index.createDocsIndex)(app);
40
+ if (!process.env.VITEST) {
41
+ await (0, import_create_docs_index.createDocsIndex)(app);
42
+ }
41
43
  await app.install(options);
42
44
  const reinstall = options.clean || options.force;
43
45
  app.log.info(`app ${reinstall ? "reinstalled" : "installed"} successfully [v${app.getVersion()}]`);
@@ -32,9 +32,16 @@ __export(pm_exports, {
32
32
  module.exports = __toCommonJS(pm_exports);
33
33
  var import_app_supervisor = require("../app-supervisor");
34
34
  var import_plugin_command_error = require("../errors/plugin-command-error");
35
+ var import_utils = require("../plugin-manager/utils");
35
36
  /* istanbul ignore file -- @preserve */
36
37
  var pm_default = /* @__PURE__ */ __name((app) => {
37
38
  const pm = app.command("pm");
39
+ pm.command("list").action(async () => {
40
+ const items = await (0, import_utils.pmListSummary)(app);
41
+ console.log("--- BEGIN_PLUGIN_LIST_JSON ---");
42
+ console.log(JSON.stringify(items));
43
+ console.log("--- END_PLUGIN_LIST_JSON ---");
44
+ });
38
45
  pm.command("create").argument("plugin").option("--force-recreate").action(async (plugin, options) => {
39
46
  await app.pm.create(plugin, options);
40
47
  });
@@ -41,14 +41,14 @@ __export(start_exports, {
41
41
  });
42
42
  module.exports = __toCommonJS(start_exports);
43
43
  var import_fs_extra = __toESM(require("fs-extra"));
44
- var import_path = require("path");
44
+ var import_utils = require("@nocobase/utils");
45
45
  var import_create_docs_index = require("../ai/create-docs-index");
46
46
  var import_application_not_install = require("../errors/application-not-install");
47
47
  /* istanbul ignore file -- @preserve */
48
48
  var start_default = /* @__PURE__ */ __name((app) => {
49
49
  app.command("start").auth().option("--db-sync").option("--quickstart").action(async (...cliArgs) => {
50
50
  const [options] = cliArgs;
51
- const file = (0, import_path.resolve)(process.cwd(), "storage/.upgrading");
51
+ const file = (0, import_utils.storagePathJoin)(".upgrading");
52
52
  const upgrading = await import_fs_extra.default.exists(file);
53
53
  if (upgrading) {
54
54
  if (!process.env.VITEST) {
@@ -34,7 +34,9 @@ var import_create_docs_index = require("../ai/create-docs-index");
34
34
  /* istanbul ignore file -- @preserve */
35
35
  var upgrade_default = /* @__PURE__ */ __name((app) => {
36
36
  app.command("upgrade").ipc().auth().action(async (options) => {
37
- await (0, import_create_docs_index.createDocsIndex)(app);
37
+ if (!process.env.VITEST) {
38
+ await (0, import_create_docs_index.createDocsIndex)(app);
39
+ }
38
40
  await app.upgrade(options);
39
41
  app.log.info(`\u2728 NocoBase has been upgraded to v${app.getVersion()}`);
40
42
  });
@@ -71,7 +71,7 @@ const _MemoryEventQueueAdapter = class _MemoryEventQueueAdapter {
71
71
  return null;
72
72
  }
73
73
  get storagePath() {
74
- return import_path.default.resolve(process.cwd(), "storage", "apps", this.options.appName, "event-queue.json");
74
+ return (0, import_utils.storagePathJoin)("apps", this.options.appName, "event-queue.json");
75
75
  }
76
76
  listen = /* @__PURE__ */ __name((channel) => {
77
77
  if (!this.connected) {
@@ -19,6 +19,7 @@ import { IPCSocketClient } from './ipc-socket-client';
19
19
  import { IPCSocketServer } from './ipc-socket-server';
20
20
  import { WSServer } from './ws-server';
21
21
  import { Duplex } from 'node:stream';
22
+ export { getHost, getHostname } from './utils';
22
23
  export interface IncomingRequest {
23
24
  url: string;
24
25
  headers: any;
@@ -40,7 +41,7 @@ interface RunOptions {
40
41
  mainAppOptions: ApplicationOptions;
41
42
  }
42
43
  export interface AppSelectorMiddlewareContext {
43
- req: IncomingRequest;
44
+ req: IncomingMessage | IncomingRequest;
44
45
  resolvedAppName: string | null;
45
46
  }
46
47
  export declare class Gateway extends EventEmitter {
@@ -57,6 +58,7 @@ export declare class Gateway extends EventEmitter {
57
58
  private port;
58
59
  private host;
59
60
  private socketPath;
61
+ private v2IndexTemplateCache;
60
62
  private terminating;
61
63
  private onTerminate;
62
64
  private constructor();
@@ -74,9 +76,18 @@ export declare class Gateway extends EventEmitter {
74
76
  code: string;
75
77
  }): void;
76
78
  responseErrorWithCode(code: any, res: any, options: any): void;
79
+ private getV2PublicPath;
80
+ private getAppPublicPath;
81
+ private isV2Request;
82
+ private isV2IndexRequest;
83
+ private getV2RuntimeConfig;
84
+ private getV2RuntimeConfigScript;
85
+ private getV2AssetPublicPath;
86
+ private getV2IndexTemplate;
87
+ private renderV2IndexHtml;
77
88
  requestHandler(req: IncomingMessage, res: ServerResponse): Promise<void>;
78
89
  getAppSelectorMiddlewares(): Toposort<AppSelectorMiddleware>;
79
- getRequestHandleAppName(req: IncomingRequest): Promise<string>;
90
+ getRequestHandleAppName(req: IncomingMessage | IncomingRequest): Promise<string>;
80
91
  getCallback(): any;
81
92
  watch(): Promise<void>;
82
93
  run(options: RunOptions): Promise<void>;
@@ -96,4 +107,3 @@ export declare class Gateway extends EventEmitter {
96
107
  static registerWsHandler(wsServer: (req: IncomingMessage, socket: Duplex, head: Buffer, app: Application) => boolean | void): void;
97
108
  static unregisterWsHandler(wsServer: (req: IncomingMessage, socket: Duplex, head: Buffer, app: Application) => boolean | void): void;
98
109
  }
99
- export {};