clear-router 2.7.5 → 2.7.7
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/ClearRequest.cjs +23 -0
- package/dist/ClearRequest.d.cts +28 -0
- package/dist/ClearRequest.d.mts +28 -0
- package/dist/ClearRequest.mjs +22 -0
- package/dist/Contracts.d.cts +12 -0
- package/dist/Contracts.d.mts +12 -0
- package/dist/Controller.cjs +12 -0
- package/dist/Controller.d.cts +14 -0
- package/dist/Controller.d.mts +14 -0
- package/dist/Controller.mjs +11 -0
- package/dist/{Request-DKXwa_W0.d.mts → Request-BhTJDR_5.d.mts} +5 -5
- package/dist/Route.cjs +58 -0
- package/dist/Route.d.cts +35 -0
- package/dist/Route.d.mts +35 -0
- package/dist/Route.mjs +57 -0
- package/dist/core/Request.cjs +35 -0
- package/dist/core/Request.d.cts +25 -0
- package/dist/core/Request.d.mts +25 -0
- package/dist/core/Request.mjs +35 -0
- package/dist/core/Response.cjs +59 -0
- package/dist/core/Response.d.cts +24 -0
- package/dist/core/Response.d.mts +24 -0
- package/dist/core/Response.mjs +58 -0
- package/dist/{bindings-CLsZjOEy.cjs → core/bindings.cjs} +10 -160
- package/dist/{bindings-CNL7bpz5.d.mts → core/bindings.d.cts} +1 -1
- package/dist/{bindings-CxvtC8XS.d.cts → core/bindings.d.mts} +1 -1
- package/dist/{bindings-XLDXFpHZ.mjs → core/bindings.mjs} +3 -110
- package/dist/core/index.cjs +4 -20
- package/dist/core/index.d.cts +4 -1
- package/dist/core/index.d.mts +4 -1
- package/dist/core/index.mjs +4 -14
- package/dist/core/plugins.cjs +14 -0
- package/dist/core/plugins.d.cts +109 -0
- package/dist/core/plugins.d.mts +109 -0
- package/dist/core/plugins.mjs +13 -0
- package/dist/{responses-Bvnk0uvc.cjs → core/responses.cjs} +5 -20
- package/dist/{responses-BvETUeDL.mjs → core/responses.mjs} +2 -2
- package/dist/{router-C6W-k6sS.cjs → core/router.cjs} +11 -69
- package/dist/core/router.d.cts +274 -0
- package/dist/core/router.d.mts +274 -0
- package/dist/{router-Dc9w86Wn.mjs → core/router.mjs} +5 -58
- package/dist/decorators/index.cjs +1 -1
- package/dist/decorators/index.d.cts +1 -1
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.mjs +1 -1
- package/dist/decorators/setup.cjs +2 -2
- package/dist/decorators/setup.d.cts +1 -1
- package/dist/decorators/setup.d.mts +1 -1
- package/dist/decorators/setup.mjs +2 -2
- package/dist/express/index.cjs +2 -265
- package/dist/express/index.d.cts +1 -127
- package/dist/express/index.d.mts +1 -127
- package/dist/express/index.mjs +1 -264
- package/dist/express/router.cjs +265 -0
- package/dist/express/router.d.cts +131 -0
- package/dist/express/router.d.mts +131 -0
- package/dist/express/router.mjs +265 -0
- package/dist/fastify/index.cjs +2 -254
- package/dist/fastify/index.d.cts +1 -125
- package/dist/fastify/index.d.mts +1 -125
- package/dist/fastify/index.mjs +1 -253
- package/dist/fastify/router.cjs +254 -0
- package/dist/fastify/router.d.cts +129 -0
- package/dist/fastify/router.d.mts +129 -0
- package/dist/fastify/router.mjs +254 -0
- package/dist/h3/index.cjs +2 -260
- package/dist/h3/index.d.cts +1 -128
- package/dist/h3/index.d.mts +1 -128
- package/dist/h3/index.mjs +1 -259
- package/dist/h3/router.cjs +260 -0
- package/dist/h3/router.d.cts +132 -0
- package/dist/h3/router.d.mts +132 -0
- package/dist/h3/router.mjs +260 -0
- package/dist/hono/index.cjs +2 -251
- package/dist/hono/index.d.cts +1 -130
- package/dist/hono/index.d.mts +1 -130
- package/dist/hono/index.mjs +1 -250
- package/dist/hono/router.cjs +251 -0
- package/dist/hono/router.d.cts +134 -0
- package/dist/hono/router.d.mts +134 -0
- package/dist/hono/router.mjs +251 -0
- package/dist/index.cjs +16 -1097
- package/dist/index.d.cts +9 -563
- package/dist/index.d.mts +9 -563
- package/dist/index.mjs +8 -1089
- package/dist/koa/index.cjs +2 -261
- package/dist/koa/index.d.cts +1 -131
- package/dist/koa/index.d.mts +1 -131
- package/dist/koa/index.mjs +1 -260
- package/dist/koa/router.cjs +261 -0
- package/dist/koa/router.d.cts +135 -0
- package/dist/koa/router.d.mts +135 -0
- package/dist/koa/router.mjs +261 -0
- package/dist/types/basic.d.cts +43 -0
- package/dist/types/express.d.cts +44 -0
- package/dist/types/express.d.mts +4 -2
- package/dist/types/fastify.d.cts +23 -0
- package/dist/types/fastify.d.mts +4 -2
- package/dist/types/h3.d.cts +41 -0
- package/dist/types/h3.d.mts +5 -6
- package/dist/types/hono.d.cts +21 -0
- package/dist/types/hono.d.mts +5 -5
- package/dist/types/koa.d.cts +25 -0
- package/dist/types/koa.d.mts +5 -5
- package/package.json +1 -1
- package/dist/router-CYBshGMl.d.mts +0 -652
- package/dist/router-tpnSi_Y7.d.cts +0 -652
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ControllerHandler } from "./basic.cjs";
|
|
2
|
+
import { ClearHttpContext } from "../Contracts.cjs";
|
|
3
|
+
import { Response } from "../core/Response.cjs";
|
|
4
|
+
import { Request } from "../core/Request.cjs";
|
|
5
|
+
import Koa from "koa";
|
|
6
|
+
import Router from "@koa/router";
|
|
7
|
+
|
|
8
|
+
//#region src/types/koa.d.ts
|
|
9
|
+
interface RequestWithGetBody extends Koa.Request {
|
|
10
|
+
getBody: () => Record<string, any>;
|
|
11
|
+
body?: any;
|
|
12
|
+
}
|
|
13
|
+
interface HttpContext extends Koa.Context, ClearHttpContext {
|
|
14
|
+
request: RequestWithGetBody;
|
|
15
|
+
clearRequest: Request;
|
|
16
|
+
clearResponse: Response;
|
|
17
|
+
params: Record<string, any>;
|
|
18
|
+
query: Record<string, any>;
|
|
19
|
+
}
|
|
20
|
+
type RouteHandler = (ctx: HttpContext, req: Request) => any | Promise<any>;
|
|
21
|
+
type Handler = RouteHandler | ControllerHandler;
|
|
22
|
+
type Middleware = Koa.Middleware<any, any>;
|
|
23
|
+
type KoaRouterApp = Router<any, any>;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { Handler, HttpContext, KoaRouterApp, Middleware };
|
package/dist/types/koa.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ControllerHandler } from "./basic.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { ClearHttpContext } from "../Contracts.mjs";
|
|
3
|
+
import { Response } from "../core/Response.mjs";
|
|
4
|
+
import { Request } from "../core/Request.mjs";
|
|
3
5
|
import Koa from "koa";
|
|
4
6
|
import Router from "@koa/router";
|
|
5
7
|
|
|
@@ -8,8 +10,7 @@ interface RequestWithGetBody extends Koa.Request {
|
|
|
8
10
|
getBody: () => Record<string, any>;
|
|
9
11
|
body?: any;
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
interface HttpContext extends MergedHttpContext {
|
|
13
|
+
interface HttpContext extends Koa.Context, ClearHttpContext {
|
|
13
14
|
request: RequestWithGetBody;
|
|
14
15
|
clearRequest: Request;
|
|
15
16
|
clearResponse: Response;
|
|
@@ -18,8 +19,7 @@ interface HttpContext extends MergedHttpContext {
|
|
|
18
19
|
}
|
|
19
20
|
type RouteHandler = (ctx: HttpContext, req: Request) => any | Promise<any>;
|
|
20
21
|
type Handler = RouteHandler | ControllerHandler;
|
|
21
|
-
type NextFunction = Koa.Next;
|
|
22
22
|
type Middleware = Koa.Middleware<any, any>;
|
|
23
23
|
type KoaRouterApp = Router<any, any>;
|
|
24
24
|
//#endregion
|
|
25
|
-
export { Handler, HttpContext, KoaRouterApp, Middleware
|
|
25
|
+
export { Handler, HttpContext, KoaRouterApp, Middleware };
|
package/package.json
CHANGED