egg 4.1.0-beta.2 → 4.1.0-beta.20

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 (109) hide show
  1. package/dist/AgentWorkerLoader-DG_hAClt.d.ts +17 -0
  2. package/dist/AgentWorkerLoader-D_hceBRW.js +24 -0
  3. package/dist/AppWorkerLoader-CAtxJvGl.js +37 -0
  4. package/dist/AppWorkerLoader-CT875rYM.d.ts +22 -0
  5. package/dist/CookieLimitExceedError-CAW0HYJw.d.ts +8 -0
  6. package/dist/CookieLimitExceedError-DLGakbeu.js +15 -0
  7. package/dist/EggApplicationLoader-CMe1VQt1.js +7 -0
  8. package/dist/EggApplicationLoader-PnIvd5oV.d.ts +8 -0
  9. package/dist/IMessenger-C9g6ypSI.d.ts +54 -0
  10. package/dist/MessageUnhandledRejectionError-Lq5fWw24.d.ts +8 -0
  11. package/dist/MessageUnhandledRejectionError-oD_E1Ewl.js +15 -0
  12. package/dist/agent-BfFWeJj4.js +55 -0
  13. package/dist/agent.d.ts +11 -1
  14. package/dist/agent.js +1 -1
  15. package/dist/app/extend/context.d.ts +11 -206
  16. package/dist/app/extend/context.js +1 -242
  17. package/dist/app/extend/helper.d.ts +11 -41
  18. package/dist/app/extend/helper.js +3 -45
  19. package/dist/app/extend/request.d.ts +11 -144
  20. package/dist/app/extend/request.js +2 -224
  21. package/dist/app/extend/response.d.ts +1 -34
  22. package/dist/app/extend/response.js +1 -34
  23. package/dist/app/middleware/meta.d.ts +11 -10
  24. package/dist/app/middleware/notfound.d.ts +11 -10
  25. package/dist/app/middleware/site_file.d.ts +11 -12
  26. package/dist/application-DVwFQSa9.js +208 -0
  27. package/dist/base-KLVtlzUD.d.ts +12 -0
  28. package/dist/base_context_class-Xc1OZql9.js +19 -0
  29. package/dist/base_context_logger-CZU59PGA.js +58 -0
  30. package/dist/base_hook_class-D0Gu2p8r.js +26 -0
  31. package/dist/base_hook_class-R8A8gm1s.d.ts +1109 -0
  32. package/dist/config/config.default.d.ts +12 -4
  33. package/dist/config/config.default.js +34 -7
  34. package/dist/config/favicon.png +0 -0
  35. package/dist/config/plugin.d.ts +1 -1
  36. package/dist/config/plugin.js +1 -1
  37. package/dist/context-D1Wg7CXs.js +244 -0
  38. package/dist/context_httpclient-BpRMdJhf.js +29 -0
  39. package/dist/egg-DVo5e_lr.js +800 -0
  40. package/dist/error-BYo_LRnd.js +1 -0
  41. package/dist/helper-B3PKMPXq.js +47 -0
  42. package/dist/httpclient-C1QPc_R7.js +36 -0
  43. package/dist/index-CUPkUUOR.d.ts +1 -0
  44. package/dist/index-CkgLZdB4.d.ts +1 -0
  45. package/dist/index.d.ts +12 -18
  46. package/dist/index.js +27 -18
  47. package/dist/lib/agent.d.ts +11 -21
  48. package/dist/lib/agent.js +20 -54
  49. package/dist/lib/application.d.ts +11 -70
  50. package/dist/lib/application.js +21 -207
  51. package/dist/lib/core/base_context_class.d.ts +11 -22
  52. package/dist/lib/core/base_context_class.js +2 -17
  53. package/dist/lib/core/base_context_logger.d.ts +11 -39
  54. package/dist/lib/core/base_context_logger.js +1 -56
  55. package/dist/lib/core/base_hook_class.d.ts +11 -17
  56. package/dist/lib/core/base_hook_class.js +1 -24
  57. package/dist/lib/core/context_httpclient.d.ts +11 -20
  58. package/dist/lib/core/context_httpclient.js +1 -27
  59. package/dist/lib/core/httpclient.d.ts +12 -17
  60. package/dist/lib/core/httpclient.js +1 -34
  61. package/dist/lib/core/logger.d.ts +11 -1
  62. package/dist/lib/core/logger.js +1 -29
  63. package/dist/lib/core/messenger/IMessenger.d.ts +1 -53
  64. package/dist/lib/core/messenger/base.d.ts +12 -11
  65. package/dist/lib/core/messenger/base.js +15 -27
  66. package/dist/lib/core/messenger/index.d.ts +12 -11
  67. package/dist/lib/core/messenger/index.js +15 -11
  68. package/dist/lib/core/messenger/ipc.d.ts +13 -4
  69. package/dist/lib/core/messenger/ipc.js +15 -120
  70. package/dist/lib/core/messenger/local.d.ts +12 -4
  71. package/dist/lib/core/messenger/local.js +15 -124
  72. package/dist/lib/core/utils.js +1 -46
  73. package/dist/lib/egg.d.ts +12 -306
  74. package/dist/lib/egg.js +15 -510
  75. package/dist/lib/error/CookieLimitExceedError.d.ts +1 -7
  76. package/dist/lib/error/CookieLimitExceedError.js +1 -13
  77. package/dist/lib/error/MessageUnhandledRejectionError.d.ts +1 -7
  78. package/dist/lib/error/MessageUnhandledRejectionError.js +1 -13
  79. package/dist/lib/error/index.d.ts +3 -2
  80. package/dist/lib/error/index.js +3 -2
  81. package/dist/lib/loader/AgentWorkerLoader.d.ts +2 -16
  82. package/dist/lib/loader/AgentWorkerLoader.js +2 -22
  83. package/dist/lib/loader/AppWorkerLoader.d.ts +2 -21
  84. package/dist/lib/loader/AppWorkerLoader.js +2 -35
  85. package/dist/lib/loader/EggApplicationLoader.d.ts +1 -7
  86. package/dist/lib/loader/EggApplicationLoader.js +1 -5
  87. package/dist/lib/loader/index.d.ts +4 -3
  88. package/dist/lib/loader/index.js +4 -3
  89. package/dist/lib/start.d.ts +11 -27
  90. package/dist/lib/start.js +25 -34
  91. package/dist/lib/types.d.ts +12 -259
  92. package/dist/lib/types.js +3 -13
  93. package/dist/lib/types.plugin.d.ts +1 -0
  94. package/dist/lib/types.plugin.js +3 -0
  95. package/dist/lib/utils.js +1 -12
  96. package/dist/loader-3myZ-rpm.js +1 -0
  97. package/dist/logger-C4tIcO3S.js +31 -0
  98. package/dist/request-Cy_1DlaX.js +225 -0
  99. package/dist/response-CDeQ9Sx2.js +36 -0
  100. package/dist/response-DlNYDj00.d.ts +29 -0
  101. package/dist/src-BuOjXSrB.js +3 -0
  102. package/dist/start-4E84z796.js +35 -0
  103. package/dist/types-dKSyDnVp.js +32 -0
  104. package/dist/types.plugin-B2v0K0I8.js +14 -0
  105. package/dist/types.plugin-C3D5I7VD.d.ts +12 -0
  106. package/dist/urllib.d.ts +1 -2
  107. package/dist/utils-B1Rjsoi9.js +48 -0
  108. package/dist/utils-BDoYg6z6.js +14 -0
  109. package/package.json +30 -30
@@ -1,40 +1,12 @@
1
- import { EggContext } from "../egg.js";
2
-
3
- //#region src/lib/core/base_context_logger.d.ts
4
- declare class BaseContextLogger {
5
- #private;
6
- /**
7
- * @class
8
- * @param {Context} ctx - context instance
9
- * @param {String} pathName - class path name
10
- * @since 1.0.0
11
- */
12
- constructor(ctx: EggContext, pathName?: string);
13
- protected _log(method: 'info' | 'warn' | 'error' | 'debug', args: any[]): void;
14
- /**
15
- * @member {Function} BaseContextLogger#debug
16
- * @param {...any} args - log msg
17
- * @since 1.2.0
18
- */
19
- debug(...args: any[]): void;
20
- /**
21
- * @member {Function} BaseContextLogger#info
22
- * @param {...any} args - log msg
23
- * @since 1.2.0
24
- */
25
- info(...args: any[]): void;
26
- /**
27
- * @member {Function} BaseContextLogger#warn
28
- * @param {...any} args - log msg
29
- * @since 1.2.0
30
- */
31
- warn(...args: any[]): void;
32
- /**
33
- * @member {Function} BaseContextLogger#error
34
- * @param {...any} args - log msg
35
- * @since 1.2.0
36
- */
37
- error(...args: any[]): void;
38
- }
39
- //#endregion
1
+ import "../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../index-CUPkUUOR.js";
5
+ import { BaseContextLogger } from "../../base_hook_class-R8A8gm1s.js";
6
+ import "../../response-DlNYDj00.js";
7
+ import "../../types.plugin-C3D5I7VD.js";
8
+ import "../../IMessenger-C9g6ypSI.js";
9
+ import "../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../index-CkgLZdB4.js";
40
12
  export { BaseContextLogger };
@@ -1,58 +1,3 @@
1
- //#region src/lib/core/base_context_logger.ts
2
- var BaseContextLogger = class {
3
- #ctx;
4
- #pathName;
5
- /**
6
- * @class
7
- * @param {Context} ctx - context instance
8
- * @param {String} pathName - class path name
9
- * @since 1.0.0
10
- */
11
- constructor(ctx, pathName) {
12
- /**
13
- * @member {Context} BaseContextLogger#ctx
14
- * @since 1.2.0
15
- */
16
- this.#ctx = ctx;
17
- this.#pathName = pathName;
18
- }
19
- _log(method, args) {
20
- if (this.#pathName && typeof args[0] === "string") args[0] = `[${this.#pathName}] ${args[0]}`;
21
- this.#ctx.app.logger[method](...args);
22
- }
23
- /**
24
- * @member {Function} BaseContextLogger#debug
25
- * @param {...any} args - log msg
26
- * @since 1.2.0
27
- */
28
- debug(...args) {
29
- this._log("debug", args);
30
- }
31
- /**
32
- * @member {Function} BaseContextLogger#info
33
- * @param {...any} args - log msg
34
- * @since 1.2.0
35
- */
36
- info(...args) {
37
- this._log("info", args);
38
- }
39
- /**
40
- * @member {Function} BaseContextLogger#warn
41
- * @param {...any} args - log msg
42
- * @since 1.2.0
43
- */
44
- warn(...args) {
45
- this._log("warn", args);
46
- }
47
- /**
48
- * @member {Function} BaseContextLogger#error
49
- * @param {...any} args - log msg
50
- * @since 1.2.0
51
- */
52
- error(...args) {
53
- this._log("error", args);
54
- }
55
- };
1
+ import { BaseContextLogger } from "../../base_context_logger-CZU59PGA.js";
56
2
 
57
- //#endregion
58
3
  export { BaseContextLogger };
@@ -1,18 +1,12 @@
1
- import { Agent } from "../agent.js";
2
- import { Application } from "../application.js";
3
- import { EggAppConfig as EggAppConfig$1 } from "../types.js";
4
- import { ILifecycleBoot } from "@eggjs/core";
5
- import * as egg_logger0 from "egg-logger";
6
-
7
- //#region src/lib/core/base_hook_class.d.ts
8
- declare class BaseHookClass implements ILifecycleBoot {
9
- #private;
10
- fullPath?: string;
11
- constructor(instance: Application | Agent);
12
- get logger(): egg_logger0.EggLogger;
13
- get config(): EggAppConfig$1;
14
- get app(): Application;
15
- get agent(): Agent;
16
- }
17
- //#endregion
1
+ import "../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../index-CUPkUUOR.js";
5
+ import { BaseHookClass } from "../../base_hook_class-R8A8gm1s.js";
6
+ import "../../response-DlNYDj00.js";
7
+ import "../../types.plugin-C3D5I7VD.js";
8
+ import "../../IMessenger-C9g6ypSI.js";
9
+ import "../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../index-CkgLZdB4.js";
18
12
  export { BaseHookClass };
@@ -1,26 +1,3 @@
1
- import assert from "node:assert";
1
+ import { BaseHookClass } from "../../base_hook_class-D0Gu2p8r.js";
2
2
 
3
- //#region src/lib/core/base_hook_class.ts
4
- var BaseHookClass = class {
5
- #instance;
6
- constructor(instance) {
7
- this.#instance = instance;
8
- }
9
- get logger() {
10
- return this.#instance.logger;
11
- }
12
- get config() {
13
- return this.#instance.config;
14
- }
15
- get app() {
16
- assert(this.#instance.type === "application", "agent boot should not use app instance");
17
- return this.#instance;
18
- }
19
- get agent() {
20
- assert(this.#instance.type === "agent", "app boot should not use agent instance");
21
- return this.#instance;
22
- }
23
- };
24
-
25
- //#endregion
26
3
  export { BaseHookClass };
@@ -1,21 +1,12 @@
1
- import { HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse } from "./httpclient.js";
2
- import Context from "../../app/extend/context.js";
3
- import { EggApplicationCore } from "../egg.js";
4
-
5
- //#region src/lib/core/context_httpclient.d.ts
6
- declare class ContextHttpClient {
7
- ctx: Context;
8
- app: EggApplicationCore;
9
- constructor(ctx: Context);
10
- /**
11
- * http request helper base on {@link HttpClient}, it will auto save httpclient log.
12
- * Keep the same api with {@link Application#curl}.
13
- *
14
- * @param {String|Object} url - request url address.
15
- * @param {Object} [options] - options for request.
16
- */
17
- curl<T = any>(url: HttpClientRequestURL, options?: HttpClientRequestOptions): Promise<HttpClientResponse<T>>;
18
- request<T = any>(url: HttpClientRequestURL, options?: HttpClientRequestOptions): Promise<HttpClientResponse<T>>;
19
- }
20
- //#endregion
1
+ import "../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../index-CUPkUUOR.js";
5
+ import { ContextHttpClient } from "../../base_hook_class-R8A8gm1s.js";
6
+ import "../../response-DlNYDj00.js";
7
+ import "../../types.plugin-C3D5I7VD.js";
8
+ import "../../IMessenger-C9g6ypSI.js";
9
+ import "../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../index-CkgLZdB4.js";
21
12
  export { ContextHttpClient };
@@ -1,29 +1,3 @@
1
- //#region src/lib/core/context_httpclient.ts
2
- var ContextHttpClient = class {
3
- ctx;
4
- app;
5
- constructor(ctx) {
6
- this.ctx = ctx;
7
- this.app = ctx.app;
8
- }
9
- /**
10
- * http request helper base on {@link HttpClient}, it will auto save httpclient log.
11
- * Keep the same api with {@link Application#curl}.
12
- *
13
- * @param {String|Object} url - request url address.
14
- * @param {Object} [options] - options for request.
15
- */
16
- async curl(url, options) {
17
- options = {
18
- ...options,
19
- ctx: this.ctx
20
- };
21
- return await this.app.curl(url, options);
22
- }
23
- async request(url, options) {
24
- return await this.curl(url, options);
25
- }
26
- };
1
+ import { ContextHttpClient } from "../../context_httpclient-BpRMdJhf.js";
27
2
 
28
- //#endregion
29
3
  export { ContextHttpClient };
@@ -1,17 +1,12 @@
1
- import { EggApplicationCore } from "../egg.js";
2
- import * as urllib0 from "urllib";
3
- import { ClientOptions, ClientOptions as HttpClientOptions, HttpClient as HttpClient$1, HttpClientResponse, RequestOptions, RequestURL, RequestURL as HttpClientRequestURL } from "urllib";
4
-
5
- //#region src/lib/core/httpclient.d.ts
6
- interface HttpClientRequestOptions extends RequestOptions {
7
- ctx?: any;
8
- tracer?: any;
9
- }
10
- declare class HttpClient extends HttpClient$1 {
11
- #private;
12
- constructor(app: EggApplicationCore, options?: ClientOptions);
13
- request<T = any>(url: RequestURL, options?: HttpClientRequestOptions): Promise<urllib0.HttpClientResponse<T>>;
14
- curl<T = any>(url: RequestURL, options?: HttpClientRequestOptions): Promise<urllib0.HttpClientResponse<T>>;
15
- }
16
- //#endregion
17
- export { type HttpClient as EggContextHttpClient, type HttpClient as EggHttpClient, HttpClient, type HttpClientOptions, HttpClientRequestOptions, type HttpClientRequestURL, type HttpClientResponse };
1
+ import "../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../index-CUPkUUOR.js";
5
+ import { HttpClient, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse } from "../../base_hook_class-R8A8gm1s.js";
6
+ import "../../response-DlNYDj00.js";
7
+ import "../../types.plugin-C3D5I7VD.js";
8
+ import "../../IMessenger-C9g6ypSI.js";
9
+ import "../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../index-CkgLZdB4.js";
12
+ export { HttpClient as EggContextHttpClient, HttpClient as EggHttpClient, HttpClient, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse };
@@ -1,36 +1,3 @@
1
- import { HttpClient as HttpClient$1 } from "urllib";
2
- import { ms } from "humanize-ms";
1
+ import { HttpClient } from "../../httpclient-C1QPc_R7.js";
3
2
 
4
- //#region src/lib/core/httpclient.ts
5
- var HttpClient = class extends HttpClient$1 {
6
- #app;
7
- constructor(app, options = {}) {
8
- normalizeConfig(app);
9
- const config = app.config.httpclient;
10
- const initOptions = {
11
- ...options,
12
- defaultArgs: {
13
- ...config.request,
14
- ...options.defaultArgs
15
- }
16
- };
17
- super(initOptions);
18
- this.#app = app;
19
- }
20
- async request(url, options) {
21
- options = options ?? {};
22
- if (options.ctx?.tracer) options.tracer = options.ctx.tracer;
23
- else options.tracer = options.tracer ?? this.#app.tracer;
24
- return await super.request(url, options);
25
- }
26
- async curl(url, options) {
27
- return await this.request(url, options);
28
- }
29
- };
30
- function normalizeConfig(app) {
31
- const config = app.config.httpclient;
32
- if (typeof config.request?.timeout === "string") config.request.timeout = ms(config.request.timeout);
33
- }
34
-
35
- //#endregion
36
3
  export { HttpClient };
@@ -1,4 +1,14 @@
1
- import { EggApplicationCore } from "../egg.js";
1
+ import "../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../index-CUPkUUOR.js";
5
+ import { EggApplicationCore } from "../../base_hook_class-R8A8gm1s.js";
6
+ import "../../response-DlNYDj00.js";
7
+ import "../../types.plugin-C3D5I7VD.js";
8
+ import "../../IMessenger-C9g6ypSI.js";
9
+ import "../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../index-CkgLZdB4.js";
2
12
  import { EggLoggers } from "egg-logger";
3
13
 
4
14
  //#region src/lib/core/logger.d.ts
@@ -1,31 +1,3 @@
1
- import { EggLoggers } from "egg-logger";
2
- import { setCustomLogger } from "onelogger";
1
+ import { createLoggers } from "../../logger-C4tIcO3S.js";
3
2
 
4
- //#region src/lib/core/logger.ts
5
- function createLoggers(app) {
6
- const loggerOptions = {
7
- ...app.config.logger,
8
- type: app.type,
9
- localStorage: app.ctxStorage
10
- };
11
- if (app.config.env === "prod" && loggerOptions.level === "DEBUG" && !app.config.logger.allowDebugAtProd) loggerOptions.level = "INFO";
12
- const loggers = new EggLoggers({
13
- logger: loggerOptions,
14
- customLogger: app.config.customLogger
15
- });
16
- app.ready(() => {
17
- if (app.config.logger.disableConsoleAfterReady) {
18
- loggers.disableConsole();
19
- loggers.coreLogger.info("[egg:lib:core:logger] disable console log after app ready");
20
- }
21
- });
22
- for (const loggerName of Object.keys(loggers)) setCustomLogger(loggerName, loggers[loggerName]);
23
- app.lifecycle.registerBeforeClose(() => {
24
- for (const loggerName of Object.keys(loggers)) setCustomLogger(loggerName, void 0);
25
- });
26
- loggers.coreLogger.info("[egg:lib:core:logger] init all loggers with options: %j", loggerOptions);
27
- return loggers;
28
- }
29
-
30
- //#endregion
31
3
  export { createLoggers };
@@ -1,54 +1,2 @@
1
- import { EventEmitter } from "node:events";
2
-
3
- //#region src/lib/core/messenger/IMessenger.d.ts
4
- interface IMessenger extends EventEmitter {
5
- /**
6
- * Send message to all agent and app
7
- * @param {String} action - message key
8
- * @param {Object} data - message value
9
- * @return {Messenger} this
10
- */
11
- broadcast(action: string, data?: unknown): IMessenger;
12
- /**
13
- * send message to the specified process
14
- * @param {String} workerId - the workerId of the receiver
15
- * @param {String} action - message key
16
- * @param {Object} data - message value
17
- * @return {Messenger} this
18
- */
19
- sendTo(workerId: string, action: string, data?: unknown): IMessenger;
20
- /**
21
- * send message to one app worker by random
22
- * - if it's running in agent, it will send to one of app workers
23
- * - if it's running in app, it will send to agent
24
- * @param {String} action - message key
25
- * @param {Object} data - message value
26
- * @return {Messenger} this
27
- */
28
- sendRandom(action: string, data?: unknown): IMessenger;
29
- /**
30
- * send message to app
31
- * @param {String} action - message key
32
- * @param {Object} data - message value
33
- * @return {Messenger} this
34
- */
35
- sendToApp(action: string, data?: unknown): IMessenger;
36
- /**
37
- * send message to agent
38
- * @param {String} action - message key
39
- * @param {Object} data - message value
40
- * @return {Messenger} this
41
- */
42
- sendToAgent(action: string, data?: unknown): IMessenger;
43
- /**
44
- * @param {String} action - message key
45
- * @param {Object} data - message value
46
- * @param {String} to - let master know how to send message
47
- * @return {Messenger} this
48
- */
49
- send(action: string, data: unknown, to?: string): IMessenger;
50
- close(): void;
51
- onMessage(message: any): void;
52
- }
53
- //#endregion
1
+ import { IMessenger } from "../../../IMessenger-C9g6ypSI.js";
54
2
  export { IMessenger };
@@ -1,12 +1,13 @@
1
- import { EggApplicationCore } from "../../egg.js";
2
- import { EventEmitter, captureRejectionSymbol } from "node:events";
3
-
4
- //#region src/lib/core/messenger/base.d.ts
5
- declare class BaseMessenger extends EventEmitter {
6
- protected readonly egg: EggApplicationCore;
7
- constructor(egg: EggApplicationCore);
8
- [captureRejectionSymbol](err: Error, event: string | symbol, ...args: any[]): void;
9
- emit(eventName: string | symbol, ...args: any[]): boolean;
10
- }
11
- //#endregion
1
+ import "../../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../../index-CUPkUUOR.js";
5
+ import "../../../base_hook_class-R8A8gm1s.js";
6
+ import "../../../response-DlNYDj00.js";
7
+ import "../../../types.plugin-C3D5I7VD.js";
8
+ import "../../../IMessenger-C9g6ypSI.js";
9
+ import "../../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../../index-CkgLZdB4.js";
12
+ import { BaseMessenger } from "../../../base-KLVtlzUD.js";
12
13
  export { BaseMessenger };
@@ -1,29 +1,17 @@
1
- import { MessageUnhandledRejectionError } from "../../error/MessageUnhandledRejectionError.js";
2
- import "../../egg.js";
3
- import { EventEmitter, captureRejectionSymbol } from "node:events";
1
+ import "../../../base_hook_class-D0Gu2p8r.js";
2
+ import "../../../base_context_logger-CZU59PGA.js";
3
+ import "../../../base_context_class-Xc1OZql9.js";
4
+ import "../../../context-D1Wg7CXs.js";
5
+ import "../../../response-CDeQ9Sx2.js";
6
+ import "../../../request-Cy_1DlaX.js";
7
+ import "../../../CookieLimitExceedError-DLGakbeu.js";
8
+ import "../../../MessageUnhandledRejectionError-oD_E1Ewl.js";
9
+ import "../../../error-BYo_LRnd.js";
10
+ import { BaseMessenger } from "../../../egg-DVo5e_lr.js";
11
+ import "../../../context_httpclient-BpRMdJhf.js";
12
+ import "../../../httpclient-C1QPc_R7.js";
13
+ import "../../../logger-C4tIcO3S.js";
14
+ import "../../../utils-B1Rjsoi9.js";
15
+ import "../../../utils-BDoYg6z6.js";
4
16
 
5
- //#region src/lib/core/messenger/base.ts
6
- var BaseMessenger = class extends EventEmitter {
7
- egg;
8
- constructor(egg) {
9
- super({ captureRejections: true });
10
- this.egg = egg;
11
- }
12
- [captureRejectionSymbol](err, event, ...args) {
13
- this.egg.coreLogger.error(new MessageUnhandledRejectionError(err, event, args));
14
- }
15
- emit(eventName, ...args) {
16
- const hasListeners = this.listenerCount(eventName) > 0;
17
- try {
18
- return super.emit(eventName, ...args);
19
- } catch (e) {
20
- let err = e;
21
- if (!(err instanceof Error)) err = new Error(String(err));
22
- this.egg.coreLogger.error(new MessageUnhandledRejectionError(err, eventName, args));
23
- return hasListeners;
24
- }
25
- }
26
- };
27
-
28
- //#endregion
29
17
  export { BaseMessenger };
@@ -1,11 +1,12 @@
1
- import { IMessenger } from "./IMessenger.js";
2
- import { EggApplicationCore } from "../../egg.js";
3
-
4
- //#region src/lib/core/messenger/index.d.ts
5
-
6
- /**
7
- * @class Messenger
8
- */
9
- declare function create(egg: EggApplicationCore): IMessenger;
10
- //#endregion
11
- export { type IMessenger, create };
1
+ import "../../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../../index-CUPkUUOR.js";
5
+ import { create } from "../../../base_hook_class-R8A8gm1s.js";
6
+ import "../../../response-DlNYDj00.js";
7
+ import "../../../types.plugin-C3D5I7VD.js";
8
+ import { IMessenger } from "../../../IMessenger-C9g6ypSI.js";
9
+ import "../../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../../index-CkgLZdB4.js";
12
+ export { IMessenger, create };
@@ -1,13 +1,17 @@
1
- import { Messenger } from "./local.js";
2
- import { Messenger as Messenger$1 } from "./ipc.js";
1
+ import "../../../base_hook_class-D0Gu2p8r.js";
2
+ import "../../../base_context_logger-CZU59PGA.js";
3
+ import "../../../base_context_class-Xc1OZql9.js";
4
+ import "../../../context-D1Wg7CXs.js";
5
+ import "../../../response-CDeQ9Sx2.js";
6
+ import "../../../request-Cy_1DlaX.js";
7
+ import "../../../CookieLimitExceedError-DLGakbeu.js";
8
+ import "../../../MessageUnhandledRejectionError-oD_E1Ewl.js";
9
+ import "../../../error-BYo_LRnd.js";
10
+ import { create } from "../../../egg-DVo5e_lr.js";
11
+ import "../../../context_httpclient-BpRMdJhf.js";
12
+ import "../../../httpclient-C1QPc_R7.js";
13
+ import "../../../logger-C4tIcO3S.js";
14
+ import "../../../utils-B1Rjsoi9.js";
15
+ import "../../../utils-BDoYg6z6.js";
3
16
 
4
- //#region src/lib/core/messenger/index.ts
5
- /**
6
- * @class Messenger
7
- */
8
- function create(egg) {
9
- return egg.options.mode === "single" ? new Messenger(egg) : new Messenger$1(egg);
10
- }
11
-
12
- //#endregion
13
17
  export { create };
@@ -1,13 +1,22 @@
1
- import { IMessenger } from "./IMessenger.js";
2
- import { EggApplicationCore } from "../../egg.js";
3
- import { BaseMessenger } from "./base.js";
1
+ import "../../../EggApplicationLoader-PnIvd5oV.js";
2
+ import "../../../AppWorkerLoader-CT875rYM.js";
3
+ import "../../../AgentWorkerLoader-DG_hAClt.js";
4
+ import "../../../index-CUPkUUOR.js";
5
+ import { EggApplicationCore } from "../../../base_hook_class-R8A8gm1s.js";
6
+ import "../../../response-DlNYDj00.js";
7
+ import "../../../types.plugin-C3D5I7VD.js";
8
+ import { IMessenger } from "../../../IMessenger-C9g6ypSI.js";
9
+ import "../../../CookieLimitExceedError-CAW0HYJw.js";
10
+ import "../../../MessageUnhandledRejectionError-Lq5fWw24.js";
11
+ import "../../../index-CkgLZdB4.js";
12
+ import { BaseMessenger } from "../../../base-KLVtlzUD.js";
4
13
 
5
14
  //#region src/lib/core/messenger/ipc.d.ts
6
-
7
15
  /**
8
16
  * Communication between app worker and agent worker by IPC channel
9
17
  */
10
18
  declare class Messenger extends BaseMessenger implements IMessenger {
19
+ #private;
11
20
  readonly pid: string;
12
21
  opids: string[];
13
22
  constructor(egg: EggApplicationCore);