egg 4.0.0-beta.9 → 4.0.1
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/commonjs/app/extend/context.d.ts +52 -12
- package/dist/commonjs/app/extend/context.js +25 -24
- package/dist/commonjs/app/extend/request.d.ts +15 -2
- package/dist/commonjs/app/extend/request.js +1 -1
- package/dist/commonjs/app/extend/response.d.ts +6 -0
- package/dist/commonjs/app/middleware/meta.d.ts +2 -2
- package/dist/commonjs/app/middleware/meta.js +1 -1
- package/dist/commonjs/app/middleware/notfound.d.ts +2 -2
- package/dist/commonjs/app/middleware/notfound.js +1 -1
- package/dist/commonjs/app/middleware/site_file.d.ts +3 -3
- package/dist/commonjs/app/middleware/site_file.js +1 -1
- package/dist/commonjs/config/config.default.d.ts +1 -1
- package/dist/commonjs/config/plugin.js +5 -6
- package/dist/commonjs/index.d.ts +12 -7
- package/dist/commonjs/index.js +11 -22
- package/dist/commonjs/lib/application.d.ts +7 -3
- package/dist/commonjs/lib/application.js +15 -4
- package/dist/commonjs/lib/core/base_context_class.d.ts +6 -3
- package/dist/commonjs/lib/core/base_context_class.js +1 -2
- package/dist/commonjs/lib/core/base_hook_class.d.ts +2 -2
- package/dist/commonjs/lib/core/base_hook_class.js +1 -2
- package/dist/commonjs/lib/core/context_httpclient.d.ts +3 -3
- package/dist/commonjs/lib/core/context_httpclient.js +1 -1
- package/dist/commonjs/lib/core/httpclient.d.ts +7 -6
- package/dist/commonjs/lib/core/httpclient.js +10 -5
- package/dist/commonjs/lib/core/messenger/base.d.ts +8 -0
- package/dist/commonjs/lib/core/messenger/base.js +31 -0
- package/dist/commonjs/lib/core/messenger/index.js +3 -2
- package/dist/commonjs/lib/core/messenger/ipc.d.ts +2 -3
- package/dist/commonjs/lib/core/messenger/ipc.js +4 -6
- package/dist/commonjs/lib/core/messenger/local.d.ts +2 -3
- package/dist/commonjs/lib/core/messenger/local.js +4 -9
- package/dist/commonjs/lib/core/utils.d.ts +1 -1
- package/dist/commonjs/lib/core/utils.js +3 -3
- package/dist/commonjs/lib/egg.d.ts +37 -13
- package/dist/commonjs/lib/egg.js +21 -6
- package/dist/commonjs/lib/error/CookieLimitExceedError.d.ts +5 -0
- package/dist/commonjs/lib/error/CookieLimitExceedError.js +16 -0
- package/dist/commonjs/lib/error/MessageUnhandledRejectionError.d.ts +5 -0
- package/dist/commonjs/lib/error/MessageUnhandledRejectionError.js +16 -0
- package/dist/commonjs/lib/error/index.d.ts +2 -0
- package/dist/commonjs/lib/error/index.js +19 -0
- package/dist/commonjs/lib/start.d.ts +10 -1
- package/dist/commonjs/lib/start.js +1 -1
- package/dist/commonjs/lib/{type.d.ts → types.d.ts} +51 -85
- package/dist/commonjs/lib/types.js +9 -0
- package/dist/commonjs/lib/utils.js +1 -1
- package/dist/commonjs/urllib.d.ts +1 -0
- package/dist/commonjs/urllib.js +18 -0
- package/dist/esm/app/extend/context.d.ts +52 -12
- package/dist/esm/app/extend/context.js +24 -20
- package/dist/esm/app/extend/request.d.ts +15 -2
- package/dist/esm/app/extend/request.js +1 -1
- package/dist/esm/app/extend/response.d.ts +6 -0
- package/dist/esm/app/middleware/meta.d.ts +2 -2
- package/dist/esm/app/middleware/meta.js +1 -1
- package/dist/esm/app/middleware/notfound.d.ts +2 -2
- package/dist/esm/app/middleware/notfound.js +1 -1
- package/dist/esm/app/middleware/site_file.d.ts +3 -3
- package/dist/esm/app/middleware/site_file.js +1 -1
- package/dist/esm/config/config.default.d.ts +1 -1
- package/dist/esm/config/plugin.js +5 -6
- package/dist/esm/index.d.ts +12 -7
- package/dist/esm/index.js +13 -8
- package/dist/esm/lib/application.d.ts +7 -3
- package/dist/esm/lib/application.js +15 -4
- package/dist/esm/lib/core/base_context_class.d.ts +6 -3
- package/dist/esm/lib/core/base_context_class.js +1 -2
- package/dist/esm/lib/core/base_hook_class.d.ts +2 -2
- package/dist/esm/lib/core/base_hook_class.js +1 -2
- package/dist/esm/lib/core/context_httpclient.d.ts +3 -3
- package/dist/esm/lib/core/context_httpclient.js +1 -1
- package/dist/esm/lib/core/httpclient.d.ts +7 -6
- package/dist/esm/lib/core/httpclient.js +10 -5
- package/dist/esm/lib/core/messenger/base.d.ts +8 -0
- package/dist/esm/lib/core/messenger/base.js +27 -0
- package/dist/esm/lib/core/messenger/index.js +3 -2
- package/dist/esm/lib/core/messenger/ipc.d.ts +2 -3
- package/dist/esm/lib/core/messenger/ipc.js +4 -6
- package/dist/esm/lib/core/messenger/local.d.ts +2 -3
- package/dist/esm/lib/core/messenger/local.js +4 -6
- package/dist/esm/lib/core/utils.d.ts +1 -1
- package/dist/esm/lib/core/utils.js +3 -3
- package/dist/esm/lib/egg.d.ts +37 -13
- package/dist/esm/lib/egg.js +23 -7
- package/dist/esm/lib/error/CookieLimitExceedError.d.ts +5 -0
- package/dist/esm/lib/error/CookieLimitExceedError.js +12 -0
- package/dist/esm/lib/error/MessageUnhandledRejectionError.d.ts +5 -0
- package/dist/esm/lib/error/MessageUnhandledRejectionError.js +12 -0
- package/dist/esm/lib/error/index.d.ts +2 -0
- package/dist/esm/lib/error/index.js +3 -0
- package/dist/esm/lib/start.d.ts +10 -1
- package/dist/esm/lib/start.js +1 -1
- package/dist/esm/lib/{type.d.ts → types.d.ts} +51 -85
- package/dist/esm/lib/types.js +7 -0
- package/dist/esm/lib/utils.js +1 -1
- package/dist/esm/urllib.d.ts +1 -0
- package/dist/esm/urllib.js +2 -0
- package/dist/package.json +1 -1
- package/package.json +30 -22
- package/src/app/extend/context.ts +53 -34
- package/src/app/extend/request.ts +18 -2
- package/src/app/extend/response.ts +8 -0
- package/src/app/middleware/meta.ts +2 -2
- package/src/app/middleware/notfound.ts +2 -2
- package/src/app/middleware/site_file.ts +3 -3
- package/src/config/config.default.ts +1 -1
- package/src/config/config.local.ts +1 -1
- package/src/config/config.unittest.ts +1 -1
- package/src/config/plugin.ts +4 -6
- package/src/index.ts +40 -7
- package/src/lib/agent.ts +1 -1
- package/src/lib/application.ts +18 -6
- package/src/lib/core/base_context_class.ts +6 -3
- package/src/lib/core/base_hook_class.ts +2 -2
- package/src/lib/core/context_httpclient.ts +3 -3
- package/src/lib/core/httpclient.ts +21 -8
- package/src/lib/core/messenger/base.ts +30 -0
- package/src/lib/core/messenger/index.ts +2 -1
- package/src/lib/core/messenger/ipc.ts +3 -5
- package/src/lib/core/messenger/local.ts +3 -5
- package/src/lib/core/utils.ts +2 -2
- package/src/lib/egg.ts +58 -23
- package/src/lib/error/CookieLimitExceedError.ts +12 -0
- package/src/lib/error/MessageUnhandledRejectionError.ts +12 -0
- package/src/lib/error/index.ts +2 -0
- package/src/lib/start.ts +12 -2
- package/src/lib/{type.ts → types.ts} +65 -89
- package/src/lib/utils.ts +0 -1
- package/src/urllib.ts +1 -0
- package/dist/commonjs/app/extend/context.types.d.ts +0 -16
- package/dist/commonjs/app/extend/context.types.js +0 -3
- package/dist/commonjs/lib/egg.types.d.ts +0 -6
- package/dist/commonjs/lib/egg.types.js +0 -3
- package/dist/commonjs/lib/type.js +0 -3
- package/dist/esm/app/extend/context.types.d.ts +0 -16
- package/dist/esm/app/extend/context.types.js +0 -2
- package/dist/esm/lib/egg.types.d.ts +0 -6
- package/dist/esm/lib/egg.types.js +0 -2
- package/dist/esm/lib/type.js +0 -2
- package/src/app/extend/context.types.ts +0 -24
- package/src/lib/egg.types.ts +0 -6
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class CookieLimitExceedError extends Error {
|
|
2
|
+
key: string;
|
|
3
|
+
cookie: string;
|
|
4
|
+
|
|
5
|
+
constructor(key: string, cookie: string) {
|
|
6
|
+
super(`cookie ${key}'s length(${cookie.length}) exceed the limit(4093)`);
|
|
7
|
+
this.name = this.constructor.name;
|
|
8
|
+
this.key = key;
|
|
9
|
+
this.cookie = cookie;
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class MessageUnhandledRejectionError extends Error {
|
|
2
|
+
event: string | symbol;
|
|
3
|
+
args: any[];
|
|
4
|
+
|
|
5
|
+
constructor(err: Error, event: string | symbol, ...args: any[]) {
|
|
6
|
+
super(`event: ${String(event)}, error: ${err.message}`, { cause: err });
|
|
7
|
+
this.name = this.constructor.name;
|
|
8
|
+
this.event = event;
|
|
9
|
+
this.args = args;
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/lib/start.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { readJSON } from 'utility';
|
|
|
3
3
|
import { importModule } from '@eggjs/utils';
|
|
4
4
|
import { Agent } from './agent.js';
|
|
5
5
|
import { Application } from './application.js';
|
|
6
|
+
import { EggPlugin } from './types.js';
|
|
6
7
|
|
|
7
8
|
export interface StartEggOptions {
|
|
8
9
|
/** specify framework that can be absolute path or npm package */
|
|
@@ -13,6 +14,15 @@ export interface StartEggOptions {
|
|
|
13
14
|
ignoreWarning?: boolean;
|
|
14
15
|
mode?: 'single';
|
|
15
16
|
env?: string;
|
|
17
|
+
plugins?: EggPlugin;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SingleModeApplication extends Application {
|
|
21
|
+
agent: SingleModeAgent;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface SingleModeAgent extends Agent {
|
|
25
|
+
app: SingleModeApplication;
|
|
16
26
|
}
|
|
17
27
|
|
|
18
28
|
/**
|
|
@@ -41,11 +51,11 @@ export async function startEgg(options: StartEggOptions = {}) {
|
|
|
41
51
|
|
|
42
52
|
const agent = new AgentClass({
|
|
43
53
|
...options,
|
|
44
|
-
});
|
|
54
|
+
}) as SingleModeAgent;
|
|
45
55
|
await agent.ready();
|
|
46
56
|
const application = new ApplicationClass({
|
|
47
57
|
...options,
|
|
48
|
-
});
|
|
58
|
+
}) as SingleModeApplication;
|
|
49
59
|
application.agent = agent;
|
|
50
60
|
agent.application = application;
|
|
51
61
|
await application.ready();
|
|
@@ -7,18 +7,28 @@ import type {
|
|
|
7
7
|
} from 'egg-logger';
|
|
8
8
|
import type {
|
|
9
9
|
FileLoaderOptions,
|
|
10
|
+
EggAppConfig as EggCoreAppConfig,
|
|
10
11
|
} from '@eggjs/core';
|
|
11
12
|
import type {
|
|
12
|
-
EggApplicationCore,
|
|
13
|
+
EggApplicationCore, Context,
|
|
13
14
|
} from './egg.js';
|
|
14
15
|
import type { MetaMiddlewareOptions } from '../app/middleware/meta.js';
|
|
15
16
|
import type { NotFoundMiddlewareOptions } from '../app/middleware/notfound.js';
|
|
16
17
|
import type { SiteFileMiddlewareOptions } from '../app/middleware/site_file.js';
|
|
17
18
|
|
|
18
|
-
// import
|
|
19
|
-
|
|
19
|
+
// import plugins types
|
|
20
|
+
import '@eggjs/watcher';
|
|
21
|
+
import '@eggjs/development';
|
|
22
|
+
import '@eggjs/jsonp';
|
|
23
|
+
import '@eggjs/i18n';
|
|
24
|
+
import '@eggjs/static';
|
|
20
25
|
|
|
21
|
-
type
|
|
26
|
+
export type {
|
|
27
|
+
EggAppInfo,
|
|
28
|
+
} from '@eggjs/core';
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
type IgnoreItem = string | RegExp | ((ctx: Context) => boolean);
|
|
22
32
|
type IgnoreOrMatch = IgnoreItem | IgnoreItem[];
|
|
23
33
|
|
|
24
34
|
export interface ClientErrorResponse {
|
|
@@ -56,7 +66,18 @@ export interface CustomLoaderConfig extends Omit<FileLoaderOptions, 'inject' | '
|
|
|
56
66
|
loadunit?: boolean;
|
|
57
67
|
}
|
|
58
68
|
|
|
59
|
-
export interface
|
|
69
|
+
export interface HttpClientConfig {
|
|
70
|
+
/** Request timeout */
|
|
71
|
+
timeout?: number;
|
|
72
|
+
/** Default request args for httpclient */
|
|
73
|
+
request?: HttpClientRequestOptions;
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated keep compatible with egg 3.x, no more used
|
|
76
|
+
*/
|
|
77
|
+
useHttpClientNext?: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface EggAppConfig extends EggCoreAppConfig {
|
|
60
81
|
workerStartTimeout: number;
|
|
61
82
|
baseDir: string;
|
|
62
83
|
middleware: string[];
|
|
@@ -103,7 +124,7 @@ export interface EggAppConfig {
|
|
|
103
124
|
};
|
|
104
125
|
/** Default is `'error'`, it will return `400` response when `Prototype-Poisoning` happen. */
|
|
105
126
|
onProtoPoisoning: 'error' | 'remove' | 'ignore';
|
|
106
|
-
onerror(err: any, ctx:
|
|
127
|
+
onerror(err: any, ctx: Context): void;
|
|
107
128
|
};
|
|
108
129
|
|
|
109
130
|
/**
|
|
@@ -131,50 +152,14 @@ export interface EggAppConfig {
|
|
|
131
152
|
};
|
|
132
153
|
|
|
133
154
|
/** Configuration of httpclient in egg. */
|
|
134
|
-
httpclient:
|
|
135
|
-
/** Request timeout */
|
|
136
|
-
timeout?: number;
|
|
137
|
-
/** Default request args for httpclient */
|
|
138
|
-
request?: HttpClientRequestOptions;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
development: {
|
|
142
|
-
/**
|
|
143
|
-
* dirs needed watch, when files under these change, application will reload, use relative path
|
|
144
|
-
*/
|
|
145
|
-
watchDirs: string[];
|
|
146
|
-
/**
|
|
147
|
-
* dirs don't need watch, including subdirectories, use relative path
|
|
148
|
-
*/
|
|
149
|
-
ignoreDirs: string[];
|
|
150
|
-
/**
|
|
151
|
-
* don't wait all plugins ready, default is true.
|
|
152
|
-
*/
|
|
153
|
-
fastReady: boolean;
|
|
154
|
-
/**
|
|
155
|
-
* whether reload on debug, default is true.
|
|
156
|
-
*/
|
|
157
|
-
reloadOnDebug: boolean;
|
|
158
|
-
/**
|
|
159
|
-
* whether override default watchDirs, default is false.
|
|
160
|
-
*/
|
|
161
|
-
overrideDefault: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* whether override default ignoreDirs, default is false.
|
|
164
|
-
*/
|
|
165
|
-
overrideIgnore: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* whether to reload, use https://github.com/sindresorhus/multimatch
|
|
168
|
-
*/
|
|
169
|
-
reloadPattern: string[] | string;
|
|
170
|
-
};
|
|
155
|
+
httpclient: HttpClientConfig;
|
|
171
156
|
|
|
172
157
|
/**
|
|
173
158
|
* customLoader config
|
|
174
159
|
*/
|
|
175
|
-
customLoader: {
|
|
176
|
-
|
|
177
|
-
};
|
|
160
|
+
// customLoader: {
|
|
161
|
+
// [key: string]: CustomLoaderConfig;
|
|
162
|
+
// };
|
|
178
163
|
|
|
179
164
|
/**
|
|
180
165
|
* It will ignore special keys when dumpConfig
|
|
@@ -198,32 +183,6 @@ export interface EggAppConfig {
|
|
|
198
183
|
|
|
199
184
|
hostHeaders: string;
|
|
200
185
|
|
|
201
|
-
/**
|
|
202
|
-
* I18n options
|
|
203
|
-
*/
|
|
204
|
-
i18n: {
|
|
205
|
-
/**
|
|
206
|
-
* default value EN_US
|
|
207
|
-
*/
|
|
208
|
-
defaultLocale: string;
|
|
209
|
-
/**
|
|
210
|
-
* i18n resource file dir, not recommend to change default value
|
|
211
|
-
*/
|
|
212
|
-
dirs: string[];
|
|
213
|
-
/**
|
|
214
|
-
* custom the locale value field, default `query.locale`, you can modify this config, such as `query.lang`
|
|
215
|
-
*/
|
|
216
|
-
queryField: string;
|
|
217
|
-
/**
|
|
218
|
-
* The locale value key in the cookie, default is locale.
|
|
219
|
-
*/
|
|
220
|
-
cookieField: string;
|
|
221
|
-
/**
|
|
222
|
-
* Locale cookie expire time, default `1y`, If pass number value, the unit will be ms
|
|
223
|
-
*/
|
|
224
|
-
cookieMaxAge: string | number;
|
|
225
|
-
};
|
|
226
|
-
|
|
227
186
|
/**
|
|
228
187
|
* Detect request' ip from specified headers, not case-sensitive. Only worked when config.proxy set to true.
|
|
229
188
|
*/
|
|
@@ -238,21 +197,6 @@ export interface EggAppConfig {
|
|
|
238
197
|
httpOnly?: boolean;
|
|
239
198
|
};
|
|
240
199
|
|
|
241
|
-
/**
|
|
242
|
-
* jsonp options
|
|
243
|
-
* @member Config#jsonp
|
|
244
|
-
* @property {String} callback - jsonp callback method key, default to `_callback`
|
|
245
|
-
* @property {Number} limit - callback method name's max length, default to `50`
|
|
246
|
-
* @property {Boolean} csrf - enable csrf check or not. default to false
|
|
247
|
-
* @property {String|RegExp|Array} whiteList - referrer white list
|
|
248
|
-
*/
|
|
249
|
-
jsonp: {
|
|
250
|
-
limit: number;
|
|
251
|
-
callback: string;
|
|
252
|
-
csrf: boolean;
|
|
253
|
-
whiteList: string | RegExp | Array<string | RegExp>;
|
|
254
|
-
};
|
|
255
|
-
|
|
256
200
|
/**
|
|
257
201
|
* The key that signing cookies. It can contain multiple keys separated by .
|
|
258
202
|
*/
|
|
@@ -299,8 +243,6 @@ export interface EggAppConfig {
|
|
|
299
243
|
allowedMethods: string[];
|
|
300
244
|
};
|
|
301
245
|
|
|
302
|
-
watcher: Record<string, any>;
|
|
303
|
-
|
|
304
246
|
onClientError?(err: Error, socket: Socket, app: EggApplicationCore): ClientErrorResponse | Promise<ClientErrorResponse>;
|
|
305
247
|
|
|
306
248
|
/**
|
|
@@ -327,3 +269,37 @@ export interface EggAppConfig {
|
|
|
327
269
|
|
|
328
270
|
[prop: string]: any;
|
|
329
271
|
}
|
|
272
|
+
|
|
273
|
+
export type RequestObjectBody = Record<string, any>;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* plugin config item interface
|
|
277
|
+
*/
|
|
278
|
+
export interface IEggPluginItem {
|
|
279
|
+
env?: EggEnvType[];
|
|
280
|
+
path?: string;
|
|
281
|
+
package?: string;
|
|
282
|
+
enable?: boolean;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export type EggPluginItem = IEggPluginItem | boolean;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* build-in plugin list
|
|
289
|
+
*/
|
|
290
|
+
export interface EggPlugin {
|
|
291
|
+
[key: string]: EggPluginItem | undefined;
|
|
292
|
+
onerror?: EggPluginItem;
|
|
293
|
+
session?: EggPluginItem;
|
|
294
|
+
i18n?: EggPluginItem;
|
|
295
|
+
watcher?: EggPluginItem;
|
|
296
|
+
multipart?: EggPluginItem;
|
|
297
|
+
security?: EggPluginItem;
|
|
298
|
+
development?: EggPluginItem;
|
|
299
|
+
logrotator?: EggPluginItem;
|
|
300
|
+
schedule?: EggPluginItem;
|
|
301
|
+
static?: EggPluginItem;
|
|
302
|
+
jsonp?: EggPluginItem;
|
|
303
|
+
view?: EggPluginItem;
|
|
304
|
+
}
|
|
305
|
+
|
package/src/lib/utils.ts
CHANGED
package/src/urllib.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'urllib';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Router } from '@eggjs/core';
|
|
2
|
-
import type { HttpClientRequestURL, HttpClientRequestOptions, HttpClient } from '../../lib/core/httpclient.js';
|
|
3
|
-
import type { ContextHttpClient } from '../../lib/core/context_httpclient.js';
|
|
4
|
-
import type Helper from './helper.js';
|
|
5
|
-
import type { EggLogger } from 'egg-logger';
|
|
6
|
-
declare module '@eggjs/core' {
|
|
7
|
-
interface Context {
|
|
8
|
-
curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
|
|
9
|
-
get router(): Router;
|
|
10
|
-
set router(val: Router);
|
|
11
|
-
get helper(): Helper;
|
|
12
|
-
get httpclient(): ContextHttpClient;
|
|
13
|
-
get httpClient(): ContextHttpClient;
|
|
14
|
-
getLogger(name: string): EggLogger;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC50eXBlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9hcHAvZXh0ZW5kL2NvbnRleHQudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWdnLnR5cGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9lZ2cudHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdHlwZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Router } from '@eggjs/core';
|
|
2
|
-
import type { HttpClientRequestURL, HttpClientRequestOptions, HttpClient } from '../../lib/core/httpclient.js';
|
|
3
|
-
import type { ContextHttpClient } from '../../lib/core/context_httpclient.js';
|
|
4
|
-
import type Helper from './helper.js';
|
|
5
|
-
import type { EggLogger } from 'egg-logger';
|
|
6
|
-
declare module '@eggjs/core' {
|
|
7
|
-
interface Context {
|
|
8
|
-
curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
|
|
9
|
-
get router(): Router;
|
|
10
|
-
set router(val: Router);
|
|
11
|
-
get helper(): Helper;
|
|
12
|
-
get httpclient(): ContextHttpClient;
|
|
13
|
-
get httpClient(): ContextHttpClient;
|
|
14
|
-
getLogger(name: string): EggLogger;
|
|
15
|
-
}
|
|
16
|
-
}
|
package/dist/esm/lib/type.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
Router,
|
|
3
|
-
} from '@eggjs/core';
|
|
4
|
-
import type {
|
|
5
|
-
HttpClientRequestURL, HttpClientRequestOptions, HttpClient,
|
|
6
|
-
} from '../../lib/core/httpclient.js';
|
|
7
|
-
import type {
|
|
8
|
-
ContextHttpClient,
|
|
9
|
-
} from '../../lib/core/context_httpclient.js';
|
|
10
|
-
import type Helper from './helper.js';
|
|
11
|
-
import type { EggLogger } from 'egg-logger';
|
|
12
|
-
|
|
13
|
-
declare module '@eggjs/core' {
|
|
14
|
-
// add Context overrides types
|
|
15
|
-
interface Context {
|
|
16
|
-
curl(url: HttpClientRequestURL, options?: HttpClientRequestOptions): ReturnType<HttpClient['request']>;
|
|
17
|
-
get router(): Router;
|
|
18
|
-
set router(val: Router);
|
|
19
|
-
get helper(): Helper;
|
|
20
|
-
get httpclient(): ContextHttpClient;
|
|
21
|
-
get httpClient(): ContextHttpClient;
|
|
22
|
-
getLogger(name: string): EggLogger;
|
|
23
|
-
}
|
|
24
|
-
}
|