egg 4.1.0-beta.14 → 4.1.0-beta.16

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.
@@ -179,29 +179,5 @@ declare class Context extends Context$1 {
179
179
  get realStatus(): number;
180
180
  set realStatus(val: number);
181
181
  }
182
- declare module '@eggjs/core' {
183
- interface Context {
184
- proxy: any;
185
- performanceStarttime: number;
186
- starttime: number;
187
- runInBackground(scope: (ctx: Context) => Promise<void>, taskName?: string): void;
188
- _runInBackground(scope: (ctx: Context) => Promise<void>, taskName: string): void;
189
- get acceptJSON(): boolean;
190
- get query(): Record<string, string>;
191
- get queries(): Record<string, string[]>;
192
- curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
193
- get router(): Router;
194
- set router(val: Router);
195
- get helper(): Helper;
196
- get httpclient(): HttpClient;
197
- get httpClient(): HttpClient;
198
- getLogger(name: string): EggLogger;
199
- get logger(): EggLogger;
200
- get coreLogger(): EggLogger;
201
- get locals(): Record<string, any>;
202
- get realStatus(): number;
203
- set realStatus(val: number);
204
- }
205
- }
206
182
  //#endregion
207
183
  export { Context as default };
@@ -132,14 +132,5 @@ declare class Request extends Request$1 {
132
132
  */
133
133
  set query(obj: Record<string, string>);
134
134
  }
135
- declare module '@eggjs/core' {
136
- interface Request {
137
- body: any;
138
- get acceptJSON(): boolean;
139
- get query(): Record<string, string>;
140
- set query(obj: Record<string, string>);
141
- get queries(): Record<string, string[]>;
142
- }
143
- }
144
135
  //#endregion
145
136
  export { Request as default };
@@ -25,11 +25,5 @@ declare class Response extends Response$1 {
25
25
  */
26
26
  set realStatus(status: number);
27
27
  }
28
- declare module 'egg' {
29
- interface Response {
30
- get realStatus(): number;
31
- set realStatus(status: number);
32
- }
33
- }
34
28
  //#endregion
35
29
  export { Response as default };
package/dist/index.d.ts CHANGED
@@ -4,10 +4,12 @@ import { Agent } from "./lib/agent.js";
4
4
  import Helper from "./app/extend/helper.js";
5
5
  import { Application } from "./lib/application.js";
6
6
  import { EggContextHttpClient as HttpClient, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse } from "./lib/core/httpclient.js";
7
+ import Response from "./app/extend/response.js";
8
+ import Request from "./app/extend/request.js";
7
9
  import Context from "./app/extend/context.js";
8
10
  import { ClientErrorResponse, CustomLoaderConfig, EggAppConfig, EggAppInfo, EggConfigFactory, EggEnvType, EggLoggerConfig, EggPlugin, EggPluginItem, HttpClientConfig, IEggPluginItem, PartialDeep, PartialEggConfig, PowerPartial, RequestObjectBody, defineConfig, defineConfigFactory } from "./lib/types.js";
9
11
  import { ContextHttpClient } from "./lib/core/context_httpclient.js";
10
- import { EggApplicationCore, EggApplicationCoreOptions, EggContext, IBoot as ILifecycleBoot, MiddlewareFunc, Next, Request, Response, Router } from "./lib/egg.js";
12
+ import { EggApplicationCore, EggApplicationCoreOptions, EggContext, IBoot as ILifecycleBoot, MiddlewareFunc, Next, Router } from "./lib/egg.js";
11
13
  import { BaseContextClass } from "./lib/core/base_context_class.js";
12
14
  import { SingleModeAgent, SingleModeApplication, StartEggOptions, startEgg } from "./lib/start.js";
13
15
  import { CookieLimitExceedError } from "./lib/error/CookieLimitExceedError.js";
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { BaseHookClass } from "./lib/core/base_hook_class.js";
2
2
  import { BaseContextClass } from "./lib/core/base_context_class.js";
3
3
  import Context from "./app/extend/context.js";
4
+ import Response from "./app/extend/response.js";
5
+ import Request from "./app/extend/request.js";
4
6
  import { CookieLimitExceedError } from "./lib/error/CookieLimitExceedError.js";
5
7
  import { MessageUnhandledRejectionError } from "./lib/error/MessageUnhandledRejectionError.js";
6
8
  import { ContextHttpClient } from "./lib/core/context_httpclient.js";
7
9
  import { HttpClient } from "./lib/core/httpclient.js";
8
- import { EggApplicationCore, Request, Response, Router } from "./lib/egg.js";
10
+ import { EggApplicationCore, Router } from "./lib/egg.js";
9
11
  import { AppWorkerLoader } from "./lib/loader/AppWorkerLoader.js";
10
12
  import { AgentWorkerLoader } from "./lib/loader/AgentWorkerLoader.js";
11
13
  import "./lib/loader/index.js";
package/dist/lib/egg.d.ts CHANGED
@@ -2,13 +2,15 @@ import { EggApplicationLoader } from "./loader/EggApplicationLoader.js";
2
2
  import { Agent } from "./agent.js";
3
3
  import { Application } from "./application.js";
4
4
  import { EggContextHttpClient as HttpClient, HttpClientOptions, HttpClientRequestOptions, HttpClientRequestURL, HttpClientResponse } from "./core/httpclient.js";
5
+ import Response from "../app/extend/response.js";
6
+ import Request from "../app/extend/request.js";
5
7
  import Context from "../app/extend/context.js";
6
8
  import { EggAppConfig as EggAppConfig$1 } from "./types.js";
7
9
  import { IMessenger } from "./core/messenger/IMessenger.js";
8
10
  import { ContextHttpClient } from "./core/context_httpclient.js";
9
11
  import { BaseContextClass as BaseContextClass$1 } from "./core/base_context_class.js";
10
12
  import { BaseHookClass } from "./core/base_hook_class.js";
11
- import { EggCore, EggCoreOptions, ILifecycleBoot, MiddlewareFunc as MiddlewareFunc$1, Next, Request as Request$1, Response as Response$1, Router } from "@eggjs/core";
13
+ import { EggCore, EggCoreOptions, ILifecycleBoot, MiddlewareFunc as MiddlewareFunc$1, Next, Router } from "@eggjs/core";
12
14
  import { IncomingMessage, ServerResponse } from "node:http";
13
15
  import { AsyncLocalStorage } from "node:async_hooks";
14
16
  import { EggContextLogger, EggLogger, EggLoggers } from "egg-logger";
@@ -21,16 +23,6 @@ interface EggApplicationCoreOptions extends Omit<EggCoreOptions, 'baseDir'> {
21
23
  clusterPort?: number;
22
24
  baseDir?: string;
23
25
  }
24
- declare class Request extends Request$1 {
25
- app: EggCore;
26
- response: Response;
27
- ctx: Context;
28
- }
29
- declare class Response extends Response$1 {
30
- app: EggCore;
31
- request: Request;
32
- ctx: Context;
33
- }
34
26
  type EggContext = Context;
35
27
  type MiddlewareFunc<T extends Context = Context> = MiddlewareFunc$1<T>;
36
28
  /**
package/dist/lib/egg.js CHANGED
@@ -1,13 +1,15 @@
1
1
  import { BaseHookClass } from "./core/base_hook_class.js";
2
2
  import { BaseContextClass as BaseContextClass$1 } from "./core/base_context_class.js";
3
3
  import Context from "../app/extend/context.js";
4
+ import Response from "../app/extend/response.js";
5
+ import Request from "../app/extend/request.js";
4
6
  import { create } from "./core/messenger/index.js";
5
7
  import { ContextHttpClient } from "./core/context_httpclient.js";
6
8
  import { HttpClient } from "./core/httpclient.js";
7
9
  import { createLoggers } from "./core/logger.js";
8
10
  import { convertObject } from "./core/utils.js";
9
11
  import { getSourceDirname } from "./utils.js";
10
- import { EggCore, Request as Request$1, Response as Response$1, Router, utils } from "@eggjs/core";
12
+ import { EggCore, Router, utils } from "@eggjs/core";
11
13
  import path from "node:path";
12
14
  import { performance } from "node:perf_hooks";
13
15
  import fs from "node:fs";
@@ -22,8 +24,6 @@ import CircularJSON from "circular-json-for-egg";
22
24
 
23
25
  //#region src/lib/egg.ts
24
26
  const EGG_PATH = Symbol.for("egg#eggPath");
25
- var Request = class extends Request$1 {};
26
- var Response = class extends Response$1 {};
27
27
  /**
28
28
  * Based on koa's Application
29
29
  * @see https://github.com/eggjs/egg-core
@@ -208,7 +208,8 @@ interface EggAppConfig extends EggAppConfig$1 {
208
208
  httpOnly?: boolean;
209
209
  };
210
210
  /**
211
- * The key that signing cookies. It can contain multiple keys separated by .
211
+ * The key that signing cookies. It can contain multiple keys separated by `.`
212
+ * @requires Cookie secret key to sign and encrypt, see https://eggjs.org/core/cookie-and-session#cookie-secret-key
212
213
  */
213
214
  keys: string;
214
215
  /**
@@ -1,4 +1,12 @@
1
- import "@eggjs/i18n";
2
- import "@eggjs/multipart";
3
- import "@eggjs/view";
4
- import "@eggjs/watcher";
1
+ import "@eggjs/development/types";
2
+ import "@eggjs/i18n/types";
3
+ import "@eggjs/jsonp/types";
4
+ import "@eggjs/logrotator/types";
5
+ import "@eggjs/multipart/types";
6
+ import "@eggjs/onerror/types";
7
+ import "@eggjs/schedule/types";
8
+ import "@eggjs/security/types";
9
+ import "@eggjs/session/types";
10
+ import "@eggjs/static/types";
11
+ import "@eggjs/view/types";
12
+ import "@eggjs/watcher/types";
@@ -1,6 +1,14 @@
1
- import "@eggjs/i18n";
2
- import "@eggjs/multipart";
3
- import "@eggjs/view";
4
- import "@eggjs/watcher";
1
+ import "@eggjs/development/types";
2
+ import "@eggjs/i18n/types";
3
+ import "@eggjs/jsonp/types";
4
+ import "@eggjs/logrotator/types";
5
+ import "@eggjs/multipart/types";
6
+ import "@eggjs/onerror/types";
7
+ import "@eggjs/schedule/types";
8
+ import "@eggjs/security/types";
9
+ import "@eggjs/session/types";
10
+ import "@eggjs/static/types";
11
+ import "@eggjs/view/types";
12
+ import "@eggjs/watcher/types";
5
13
 
6
14
  export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "4.1.0-beta.14",
3
+ "version": "4.1.0-beta.16",
4
4
  "engines": {
5
5
  "node": ">=22.18.0"
6
6
  },
@@ -72,9 +72,6 @@
72
72
  "egg"
73
73
  ],
74
74
  "dependencies": {
75
- "@eggjs/i18n": "^3.0.1",
76
- "@eggjs/multipart": "^4.0.0",
77
- "@eggjs/view": "^3.0.1",
78
75
  "circular-json-for-egg": "^1.0.0",
79
76
  "cluster-client": "^3.7.0",
80
77
  "egg-logger": "^3.5.0",
@@ -89,20 +86,23 @@
89
86
  "type-fest": "^5.0.1",
90
87
  "urllib": "^4.8.2",
91
88
  "utility": "^2.5.0",
92
- "@eggjs/cookies": "4.0.0-beta.14",
93
- "@eggjs/core": "7.0.0-beta.14",
94
- "@eggjs/cluster": "4.0.0-beta.14",
95
- "@eggjs/extend2": "5.0.0-beta.14",
96
- "@eggjs/jsonp": "4.0.0-beta.14",
97
- "@eggjs/logrotator": "5.0.0-beta.14",
98
- "@eggjs/schedule": "6.0.0-beta.14",
99
- "@eggjs/onerror": "4.0.0-beta.14",
100
- "@eggjs/security": "5.0.0-beta.14",
101
- "@eggjs/session": "5.0.0-beta.14",
102
- "@eggjs/static": "4.0.0-beta.14",
103
- "@eggjs/utils": "5.0.0-beta.14",
104
- "@eggjs/development": "5.0.0-beta.14",
105
- "@eggjs/watcher": "5.0.0-beta.14"
89
+ "@eggjs/cluster": "4.0.0-beta.16",
90
+ "@eggjs/cookies": "4.0.0-beta.16",
91
+ "@eggjs/development": "5.0.0-beta.16",
92
+ "@eggjs/core": "7.0.0-beta.16",
93
+ "@eggjs/extend2": "5.0.0-beta.16",
94
+ "@eggjs/i18n": "4.0.0-beta.16",
95
+ "@eggjs/jsonp": "4.0.0-beta.16",
96
+ "@eggjs/logrotator": "5.0.0-beta.16",
97
+ "@eggjs/onerror": "4.0.0-beta.16",
98
+ "@eggjs/multipart": "5.0.0-beta.16",
99
+ "@eggjs/schedule": "6.0.0-beta.16",
100
+ "@eggjs/security": "5.0.0-beta.16",
101
+ "@eggjs/session": "5.0.0-beta.16",
102
+ "@eggjs/static": "4.0.0-beta.16",
103
+ "@eggjs/utils": "5.0.0-beta.16",
104
+ "@eggjs/watcher": "5.0.0-beta.16",
105
+ "@eggjs/view": "4.0.0-beta.16"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@types/koa-bodyparser": "^4.3.12",
@@ -121,9 +121,9 @@
121
121
  "tsd": "^0.33.0",
122
122
  "tsdown": "^0.15.4",
123
123
  "typescript": "5.9.2",
124
- "@eggjs/koa": "3.1.0-beta.14",
125
- "@eggjs/mock": "7.0.0-beta.14",
126
- "@eggjs/supertest": "9.0.0-beta.14"
124
+ "@eggjs/koa": "3.1.0-beta.16",
125
+ "@eggjs/mock": "7.0.0-beta.16",
126
+ "@eggjs/supertest": "9.0.0-beta.16"
127
127
  },
128
128
  "repository": {
129
129
  "type": "git",