@midwayjs/koa 4.0.0-beta.5 → 4.0.0-beta.6
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/framework.d.ts +0 -5
- package/dist/framework.js +4 -9
- package/dist/interface.d.ts +0 -5
- package/package.json +6 -6
package/dist/framework.d.ts
CHANGED
|
@@ -14,11 +14,6 @@ export declare class MidwayKoaFramework extends BaseFramework<IMidwayKoaApplicat
|
|
|
14
14
|
* wrap controller string to middleware function
|
|
15
15
|
*/
|
|
16
16
|
generateController(routeInfo: RouterInfo): Middleware<DefaultState, IMidwayKoaContext>;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated
|
|
19
|
-
* @param middlewareId
|
|
20
|
-
*/
|
|
21
|
-
generateMiddleware(middlewareId: any): Promise<Middleware<DefaultState, IMidwayKoaContext, any>>;
|
|
22
17
|
run(): Promise<void>;
|
|
23
18
|
beforeStop(): Promise<void>;
|
|
24
19
|
getFrameworkName(): string;
|
package/dist/framework.js
CHANGED
|
@@ -161,7 +161,10 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
161
161
|
},
|
|
162
162
|
]);
|
|
163
163
|
this.generator = new KoaControllerGenerator(this.app, this.webRouterService);
|
|
164
|
-
this.defineApplicationProperties(
|
|
164
|
+
this.defineApplicationProperties({
|
|
165
|
+
generateController: this.generateController.bind(this),
|
|
166
|
+
getPort: this.getPort.bind(this),
|
|
167
|
+
});
|
|
165
168
|
// hack use method
|
|
166
169
|
this.app.originUse = this.app.use;
|
|
167
170
|
this.app.use = this.app.useMiddleware;
|
|
@@ -179,14 +182,6 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
179
182
|
generateController(routeInfo) {
|
|
180
183
|
return this.generator.generateKoaController(routeInfo);
|
|
181
184
|
}
|
|
182
|
-
/**
|
|
183
|
-
* @deprecated
|
|
184
|
-
* @param middlewareId
|
|
185
|
-
*/
|
|
186
|
-
async generateMiddleware(middlewareId) {
|
|
187
|
-
const mwIns = await this.getApplicationContext().getAsync(middlewareId);
|
|
188
|
-
return mwIns.resolve();
|
|
189
|
-
}
|
|
190
185
|
async run() {
|
|
191
186
|
// load controller
|
|
192
187
|
await this.loadMidwayController();
|
package/dist/interface.d.ts
CHANGED
|
@@ -12,11 +12,6 @@ export interface State extends DefaultState {
|
|
|
12
12
|
export type IMidwayKoaContext = IMidwayContext<KoaContext>;
|
|
13
13
|
export type IMidwayKoaApplication = IMidwayApplication<IMidwayKoaContext, koa<State, IMidwayKoaContext> & {
|
|
14
14
|
generateController(controllerMapping: string, routeArgsInfo?: RouterParamValue[], routerResponseData?: any[]): Middleware<State, IMidwayKoaContext>;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated
|
|
17
|
-
* @param middlewareId
|
|
18
|
-
*/
|
|
19
|
-
generateMiddleware(middlewareId: any): Promise<Middleware<State, IMidwayKoaContext>>;
|
|
20
15
|
/**
|
|
21
16
|
* Get the port that the application is listening on
|
|
22
17
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/koa",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.6",
|
|
4
4
|
"description": "Midway Web Framework for KOA",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@midwayjs/core": "^4.0.0-beta.
|
|
28
|
-
"@midwayjs/mock": "^4.0.0-beta.
|
|
27
|
+
"@midwayjs/core": "^4.0.0-beta.6",
|
|
28
|
+
"@midwayjs/mock": "^4.0.0-beta.6",
|
|
29
29
|
"@types/koa-router": "7.4.8",
|
|
30
30
|
"axios": "1.12.0",
|
|
31
31
|
"fs-extra": "11.3.0"
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@koa/router": "^12.0.0",
|
|
35
35
|
"@midwayjs/cookies": "^1.3.0",
|
|
36
|
-
"@midwayjs/session": "^4.0.0-beta.
|
|
36
|
+
"@midwayjs/session": "^4.0.0-beta.6",
|
|
37
37
|
"@types/koa": "3.0.0",
|
|
38
38
|
"@types/qs": "6.9.18",
|
|
39
|
-
"koa": "3.0.
|
|
39
|
+
"koa": "3.0.3",
|
|
40
40
|
"koa-bodyparser": "4.4.1",
|
|
41
41
|
"qs": "6.14.0"
|
|
42
42
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "a02425777d044ec502d050993bc256dc26d5b586"
|
|
52
52
|
}
|