egg 4.1.0-beta.18 → 4.1.0-beta.19

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.
package/dist/lib/egg.d.ts CHANGED
@@ -34,6 +34,12 @@ type MiddlewareFunc<T extends Context = Context> = MiddlewareFunc$1<T>;
34
34
  declare class EggApplicationCore extends EggCore {
35
35
  #private;
36
36
  ctxStorage: AsyncLocalStorage<Context>;
37
+ /**
38
+ * Get the current request context from AsyncLocalStorage.
39
+ * This provides access to the context object for the current request lifecycle.
40
+ * @returns {Context | undefined} The current request context, or undefined if not in a request scope.
41
+ */
42
+ get currentContext(): Context | undefined;
37
43
  ContextCookies: typeof Cookies;
38
44
  ContextLogger: typeof EggContextLogger;
39
45
  ContextHttpClient: typeof ContextHttpClient;
package/dist/lib/egg.js CHANGED
@@ -31,6 +31,14 @@ const EGG_PATH = Symbol.for("egg#eggPath");
31
31
  * @augments EggCore
32
32
  */
33
33
  var EggApplicationCore = class extends EggCore {
34
+ /**
35
+ * Get the current request context from AsyncLocalStorage.
36
+ * This provides access to the context object for the current request lifecycle.
37
+ * @returns {Context | undefined} The current request context, or undefined if not in a request scope.
38
+ */
39
+ get currentContext() {
40
+ return this.ctxStorage.getStore();
41
+ }
34
42
  ContextCookies = Cookies;
35
43
  ContextLogger = EggContextLogger;
36
44
  ContextHttpClient = ContextHttpClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egg",
3
- "version": "4.1.0-beta.18",
3
+ "version": "4.1.0-beta.19",
4
4
  "engines": {
5
5
  "node": ">=22.18.0"
6
6
  },
@@ -86,23 +86,23 @@
86
86
  "type-fest": "^5.0.1",
87
87
  "urllib": "^4.8.2",
88
88
  "utility": "^2.5.0",
89
- "@eggjs/cluster": "4.0.0-beta.18",
90
- "@eggjs/cookies": "4.0.0-beta.18",
91
- "@eggjs/core": "7.0.0-beta.18",
92
- "@eggjs/development": "5.0.0-beta.18",
93
- "@eggjs/extend2": "5.0.0-beta.18",
94
- "@eggjs/logrotator": "5.0.0-beta.18",
95
- "@eggjs/i18n": "4.0.0-beta.18",
96
- "@eggjs/jsonp": "4.0.0-beta.18",
97
- "@eggjs/onerror": "4.0.0-beta.18",
98
- "@eggjs/multipart": "5.0.0-beta.18",
99
- "@eggjs/schedule": "6.0.0-beta.18",
100
- "@eggjs/security": "5.0.0-beta.18",
101
- "@eggjs/session": "5.0.0-beta.18",
102
- "@eggjs/utils": "5.0.0-beta.18",
103
- "@eggjs/watcher": "5.0.0-beta.18",
104
- "@eggjs/static": "4.0.0-beta.18",
105
- "@eggjs/view": "4.0.0-beta.18"
89
+ "@eggjs/cookies": "4.0.0-beta.19",
90
+ "@eggjs/cluster": "4.0.0-beta.19",
91
+ "@eggjs/development": "5.0.0-beta.19",
92
+ "@eggjs/core": "7.0.0-beta.19",
93
+ "@eggjs/extend2": "5.0.0-beta.19",
94
+ "@eggjs/jsonp": "4.0.0-beta.19",
95
+ "@eggjs/logrotator": "5.0.0-beta.19",
96
+ "@eggjs/i18n": "4.0.0-beta.19",
97
+ "@eggjs/multipart": "5.0.0-beta.19",
98
+ "@eggjs/onerror": "4.0.0-beta.19",
99
+ "@eggjs/schedule": "6.0.0-beta.19",
100
+ "@eggjs/security": "5.0.0-beta.19",
101
+ "@eggjs/view": "4.0.0-beta.19",
102
+ "@eggjs/utils": "5.0.0-beta.19",
103
+ "@eggjs/static": "4.0.0-beta.19",
104
+ "@eggjs/watcher": "5.0.0-beta.19",
105
+ "@eggjs/session": "5.0.0-beta.19"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@types/koa-bodyparser": "^4.3.12",
@@ -117,13 +117,12 @@
117
117
  "runscript": "^2.0.1",
118
118
  "sdk-base": "^5.0.1",
119
119
  "spy": "^1.0.0",
120
- "tsd": "^0.33.0",
121
120
  "tsdown": "^0.15.4",
122
- "typescript": "5.9.2",
123
- "@eggjs/koa": "3.1.0-beta.18",
124
- "@eggjs/mock": "7.0.0-beta.18",
125
- "@eggjs/supertest": "9.0.0-beta.18",
126
- "@eggjs/tracer": "4.0.0-beta.18"
121
+ "typescript": "^5.9.3",
122
+ "@eggjs/koa": "3.1.0-beta.19",
123
+ "@eggjs/supertest": "9.0.0-beta.19",
124
+ "@eggjs/mock": "7.0.0-beta.19",
125
+ "@eggjs/tracer": "4.0.0-beta.19"
127
126
  },
128
127
  "repository": {
129
128
  "type": "git",