tspace-spear 1.2.3 → 1.2.5-beta.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/README.md +268 -19
- package/dist/lib/core/client/index.d.ts +23 -0
- package/dist/lib/core/client/index.js +45 -0
- package/dist/lib/core/client/index.js.map +1 -0
- package/dist/lib/core/compiler/generator.d.ts +18 -0
- package/dist/lib/core/compiler/generator.js +142 -0
- package/dist/lib/core/compiler/generator.js.map +1 -0
- package/dist/lib/core/compiler/index.d.ts +14 -0
- package/dist/lib/core/compiler/index.js +11 -0
- package/dist/lib/core/compiler/index.js.map +1 -0
- package/dist/lib/core/compiler/pre-routes.d.ts +3 -0
- package/dist/lib/core/compiler/pre-routes.js +5 -0
- package/dist/lib/core/compiler/pre-routes.js.map +1 -0
- package/dist/lib/core/compiler/types.d.ts +12 -0
- package/dist/lib/core/compiler/types.js +3 -0
- package/dist/lib/core/compiler/types.js.map +1 -0
- package/dist/lib/core/const/index.d.ts +153 -0
- package/dist/lib/core/const/index.js +105 -0
- package/dist/lib/core/const/index.js.map +1 -0
- package/dist/lib/core/decorators/context.d.ts +16 -9
- package/dist/lib/core/decorators/context.js +85 -59
- package/dist/lib/core/decorators/context.js.map +1 -1
- package/dist/lib/core/decorators/headers.d.ts +2 -2
- package/dist/lib/core/decorators/headers.js +1 -1
- package/dist/lib/core/decorators/headers.js.map +1 -1
- package/dist/lib/core/decorators/methods.d.ts +7 -7
- package/dist/lib/core/decorators/methods.js.map +1 -1
- package/dist/lib/core/decorators/middleware.d.ts +3 -3
- package/dist/lib/core/decorators/middleware.js +2 -2
- package/dist/lib/core/decorators/middleware.js.map +1 -1
- package/dist/lib/core/decorators/statusCode.d.ts +1 -1
- package/dist/lib/core/decorators/statusCode.js.map +1 -1
- package/dist/lib/core/decorators/swagger.d.ts +1 -1
- package/dist/lib/core/decorators/swagger.js.map +1 -1
- package/dist/lib/core/server/fast-router.d.ts +133 -0
- package/dist/lib/core/server/fast-router.js +277 -0
- package/dist/lib/core/server/fast-router.js.map +1 -0
- package/dist/lib/core/server/index.d.ts +39 -37
- package/dist/lib/core/server/index.js +201 -501
- package/dist/lib/core/server/index.js.map +1 -1
- package/dist/lib/core/server/net/index.d.ts +20 -0
- package/dist/lib/core/server/net/index.js +393 -0
- package/dist/lib/core/server/net/index.js.map +1 -0
- package/dist/lib/core/server/parser-factory.d.ts +10 -11
- package/dist/lib/core/server/parser-factory.js +259 -437
- package/dist/lib/core/server/parser-factory.js.map +1 -1
- package/dist/lib/core/server/response.d.ts +6 -0
- package/dist/lib/core/server/response.js +168 -0
- package/dist/lib/core/server/response.js.map +1 -0
- package/dist/lib/core/server/router.d.ts +2 -12
- package/dist/lib/core/server/router.js +2 -13
- package/dist/lib/core/server/router.js.map +1 -1
- package/dist/lib/core/server/uWS/index.d.ts +30 -0
- package/dist/lib/core/server/uWS/index.js +357 -0
- package/dist/lib/core/server/uWS/index.js.map +1 -0
- package/dist/lib/core/types/index.d.ts +150 -48
- package/dist/lib/core/utils/index.d.ts +12 -0
- package/dist/lib/core/utils/index.js +137 -0
- package/dist/lib/core/utils/index.js.map +1 -0
- package/dist/lib/index.d.ts +4 -3
- package/dist/lib/index.js +4 -2
- package/dist/lib/index.js.map +1 -1
- package/package.json +20 -14
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* }
|
|
10
10
|
* ```
|
|
11
11
|
*/
|
|
12
|
-
export declare const Get: (path: `/${string}`) =>
|
|
12
|
+
export declare const Get: (path: `/${string}`) => MethodDecorator;
|
|
13
13
|
/**
|
|
14
14
|
* Maps a controller method to an HTTP POST route.
|
|
15
15
|
*
|
|
@@ -21,7 +21,7 @@ export declare const Get: (path: `/${string}`) => (target: any, propertyKey: any
|
|
|
21
21
|
* }
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export declare const Post: (path: `/${string}`) =>
|
|
24
|
+
export declare const Post: (path: `/${string}`) => MethodDecorator;
|
|
25
25
|
/**
|
|
26
26
|
* Maps a controller method to an HTTP PUT route.
|
|
27
27
|
*
|
|
@@ -33,7 +33,7 @@ export declare const Post: (path: `/${string}`) => (target: any, propertyKey: an
|
|
|
33
33
|
* async update(ctx: T.Context) {}
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare const Put: (path: `/${string}`) =>
|
|
36
|
+
export declare const Put: (path: `/${string}`) => MethodDecorator;
|
|
37
37
|
/**
|
|
38
38
|
* Maps a controller method to an HTTP PATCH route.
|
|
39
39
|
*
|
|
@@ -45,7 +45,7 @@ export declare const Put: (path: `/${string}`) => (target: any, propertyKey: any
|
|
|
45
45
|
* async patch(ctx: T.Context) {}
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
|
-
export declare const Patch: (path: `/${string}`) =>
|
|
48
|
+
export declare const Patch: (path: `/${string}`) => MethodDecorator;
|
|
49
49
|
/**
|
|
50
50
|
* Maps a controller method to an HTTP DELETE route.
|
|
51
51
|
*
|
|
@@ -55,7 +55,7 @@ export declare const Patch: (path: `/${string}`) => (target: any, propertyKey: a
|
|
|
55
55
|
* async remove(ctx: T.Context) {}
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
|
-
export declare const Delete: (path: `/${string}`) =>
|
|
58
|
+
export declare const Delete: (path: `/${string}`) => MethodDecorator;
|
|
59
59
|
/**
|
|
60
60
|
* Maps a controller method to an HTTP HEAD route.
|
|
61
61
|
*
|
|
@@ -67,7 +67,7 @@ export declare const Delete: (path: `/${string}`) => (target: any, propertyKey:
|
|
|
67
67
|
* async health(ctx: T.Context) {}
|
|
68
68
|
* ```
|
|
69
69
|
*/
|
|
70
|
-
export declare const Head: (path: `/${string}`) =>
|
|
70
|
+
export declare const Head: (path: `/${string}`) => MethodDecorator;
|
|
71
71
|
/**
|
|
72
72
|
* Maps a controller method to an HTTP OPTIONS route.
|
|
73
73
|
*
|
|
@@ -79,4 +79,4 @@ export declare const Head: (path: `/${string}`) => (target: any, propertyKey: an
|
|
|
79
79
|
* async options(ctx: T.Context) {}
|
|
80
80
|
* ```
|
|
81
81
|
*/
|
|
82
|
-
export declare const Options: (path: `/${string}`) =>
|
|
82
|
+
export declare const Options: (path: `/${string}`) => MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/methods.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,CAAC,MAAgB,EAAE,EAAE;IAC3C,OAAO,CAAC,IAAkB,
|
|
1
|
+
{"version":3,"file":"methods.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/methods.ts"],"names":[],"mappings":";;;AAEA,MAAM,eAAe,GAAG,CAAC,MAAgB,EAAE,EAAE;IAC3C,OAAO,CAAC,IAAkB,EAAmB,EAAE;QAC7C,OAAO,CAAC,MAAU,EAAE,WAAe,EAAE,EAAE;YACrC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;YAEtC,MAAM,OAAO,GAAe,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC;gBACpE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,SAAS,EAAE,UAAU,CAAC;gBAC5C,CAAC,CAAC,EAAE,CAAC;YAEP,OAAO,CAAC,IAAI,CAAC;gBACX,MAAM;gBACN,IAAI;gBACJ,OAAO,EAAE,WAAW;aACrB,CAAC,CAAC;YAEH,OAAO,CAAC,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACzD,CAAC,CAAA;IACH,CAAC,CAAA;AACH,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACU,QAAA,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAE1C;;;;;;;;;;GAUG;AACU,QAAA,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;;;;;;GAUG;AACU,QAAA,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;AAE1C;;;;;;;;;;GAUG;AACU,QAAA,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;AAE9C;;;;;;;;GAQG;AACU,QAAA,MAAM,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;AAEhD;;;;;;;;;;GAUG;AACU,QAAA,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAE5C;;;;;;;;;;GAUG;AACU,QAAA,OAAO,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -25,7 +25,7 @@ import { T } from '../types';
|
|
|
25
25
|
* Example middleware:
|
|
26
26
|
*
|
|
27
27
|
* ```ts
|
|
28
|
-
* const authMiddleware: T.
|
|
28
|
+
* const authMiddleware: T.ContextHandler = (ctx, next) => {
|
|
29
29
|
* if (!ctx.user) {
|
|
30
30
|
* return next(new Error("Unauthorized"));
|
|
31
31
|
* }
|
|
@@ -33,7 +33,7 @@ import { T } from '../types';
|
|
|
33
33
|
* };
|
|
34
34
|
* ```
|
|
35
35
|
*
|
|
36
|
-
* @param {T.
|
|
36
|
+
* @param {T.ContextHandler} middleware - Middleware function to execute before the route handler.
|
|
37
37
|
* @returns {MethodDecorator}
|
|
38
38
|
*/
|
|
39
|
-
export declare const Middleware: (middleware: T.
|
|
39
|
+
export declare const Middleware: (middleware: T.ContextHandler) => MethodDecorator;
|
|
@@ -27,7 +27,7 @@ exports.Middleware = void 0;
|
|
|
27
27
|
* Example middleware:
|
|
28
28
|
*
|
|
29
29
|
* ```ts
|
|
30
|
-
* const authMiddleware: T.
|
|
30
|
+
* const authMiddleware: T.ContextHandler = (ctx, next) => {
|
|
31
31
|
* if (!ctx.user) {
|
|
32
32
|
* return next(new Error("Unauthorized"));
|
|
33
33
|
* }
|
|
@@ -35,7 +35,7 @@ exports.Middleware = void 0;
|
|
|
35
35
|
* };
|
|
36
36
|
* ```
|
|
37
37
|
*
|
|
38
|
-
* @param {T.
|
|
38
|
+
* @param {T.ContextHandler} middleware - Middleware function to execute before the route handler.
|
|
39
39
|
* @returns {MethodDecorator}
|
|
40
40
|
*/
|
|
41
41
|
const Middleware = (middleware) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/middleware.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACI,MAAM,UAAU,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/middleware.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACI,MAAM,UAAU,GAAG,CAAC,UAA4B,EAAmB,EAAE;IAE1E,OAAO,CAAC,MAAW,EAAE,GAAQ,EAAE,UAA8B,EAAE,EAAE;QAC/D,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAc,EAAE,IAAoB;YAC/D,IAAI,CAAC;gBAEH,OAAO,CAAC,cAAc,CAAC,aAAa,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;gBAE1D,OAAO,UAAU,CAAC,GAAG,EAAE,CAAC,GAAS,EAAE,EAAE;oBACnC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;wBAChB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;oBACnB,CAAC;oBAED,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;gBAC9C,CAAC,CAAC,CAAC;YAEL,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,UAAU,cAuBrB"}
|
|
@@ -23,4 +23,4 @@ import { type T } from '../types';
|
|
|
23
23
|
* @param {T.StatusCode} statusCode - HTTP status code to send with the response.
|
|
24
24
|
* @returns {MethodDecorator}
|
|
25
25
|
*/
|
|
26
|
-
export declare const StatusCode: (statusCode: T.StatusCode) =>
|
|
26
|
+
export declare const StatusCode: (statusCode: T.StatusCode) => MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusCode.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/statusCode.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,MAAM,UAAU,GAAG,CAAC,UAAwB,
|
|
1
|
+
{"version":3,"file":"statusCode.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/statusCode.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,MAAM,UAAU,GAAG,CAAC,UAAwB,EAAmB,EAAE;IACpE,OAAO,CAAC,MAAW,EAAE,GAAQ,EAAE,UAA8B,EAAE,EAAE;QAC7D,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,MAAM,IAAI,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC;QAE1E,UAAU,CAAC,KAAK,GAAG,KAAK,WAAW,GAAc,EAAE,IAAoB;YACnE,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAChE,OAAO,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,UAAU,cAarB"}
|
|
@@ -33,4 +33,4 @@ import { type T } from "../types";
|
|
|
33
33
|
* @param {T.Swagger.Spec} data - Swagger/OpenAPI specification for the route.
|
|
34
34
|
* @returns {MethodDecorator}
|
|
35
35
|
*/
|
|
36
|
-
export declare const Swagger: (data: T.Swagger.Spec) =>
|
|
36
|
+
export declare const Swagger: (data: T.Swagger.Spec) => MethodDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/swagger.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACI,MAAM,OAAO,GAAG,CAAC,IAAoB,
|
|
1
|
+
{"version":3,"file":"swagger.js","sourceRoot":"","sources":["../../../../src/lib/core/decorators/swagger.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACI,MAAM,OAAO,GAAG,CAAC,IAAoB,EAAmB,EAAE;IAC/D,OAAO,CAAC,MAAW,EAAE,WAAgB,EAAE,EAAE;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;QAEtC,MAAM,QAAQ,GAAU,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC;YACjE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,UAAU,CAAC;YAC7C,CAAC,CAAC,EAAE,CAAC;QAEP,QAAQ,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,WAAW;YACpB,GAAG,IAAI;SACR,CAAC,CAAC;QAEH,OAAO,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC3D,CAAC,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,OAAO,WAelB"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { IncomingMessage, ServerResponse } from "http";
|
|
2
|
+
type Handler = (req: IncomingMessage, res: ServerResponse, params: Record<string, string>) => any;
|
|
3
|
+
export declare class FastRouter {
|
|
4
|
+
private trees;
|
|
5
|
+
private _routes;
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Get all registered routes in the router.
|
|
9
|
+
*
|
|
10
|
+
* Returns the internal route registry used for debugging,
|
|
11
|
+
* inspection, or serialization of the router tree.
|
|
12
|
+
*
|
|
13
|
+
* @returns Internal routes structure
|
|
14
|
+
*/
|
|
15
|
+
get routes(): {
|
|
16
|
+
path: string;
|
|
17
|
+
method: string;
|
|
18
|
+
params: string[];
|
|
19
|
+
}[];
|
|
20
|
+
/**
|
|
21
|
+
* Register a GET route.
|
|
22
|
+
*
|
|
23
|
+
* Handles HTTP GET requests for the specified path.
|
|
24
|
+
*
|
|
25
|
+
* @param path Route path (e.g. "/users/:id")
|
|
26
|
+
* @param handler Function executed when route matches
|
|
27
|
+
* @returns Router instance for chaining
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* router.get("/users", (req, res) => {});
|
|
31
|
+
*/
|
|
32
|
+
get(path: string, handler: Handler): this;
|
|
33
|
+
/**
|
|
34
|
+
* Register a POST route.
|
|
35
|
+
*
|
|
36
|
+
* Used for creating resources or submitting data.
|
|
37
|
+
*
|
|
38
|
+
* @param path Route path
|
|
39
|
+
* @param handler Route handler function
|
|
40
|
+
* @returns Router instance for chaining
|
|
41
|
+
*/
|
|
42
|
+
post(path: string, handler: Handler): this;
|
|
43
|
+
/**
|
|
44
|
+
* Register a PUT route.
|
|
45
|
+
*
|
|
46
|
+
* Typically used for full resource replacement.
|
|
47
|
+
*
|
|
48
|
+
* @param path Route path
|
|
49
|
+
* @param handler Route handler function
|
|
50
|
+
* @returns Router instance for chaining
|
|
51
|
+
*/
|
|
52
|
+
put(path: string, handler: Handler): this;
|
|
53
|
+
/**
|
|
54
|
+
* Register a PATCH route.
|
|
55
|
+
*
|
|
56
|
+
* Used for partial updates to a resource.
|
|
57
|
+
*
|
|
58
|
+
* @param path Route path
|
|
59
|
+
* @param handler Route handler function
|
|
60
|
+
* @returns Router instance for chaining
|
|
61
|
+
*/
|
|
62
|
+
patch(path: string, handler: Handler): this;
|
|
63
|
+
/**
|
|
64
|
+
* Register a DELETE route.
|
|
65
|
+
*
|
|
66
|
+
* Used for removing a resource.
|
|
67
|
+
*
|
|
68
|
+
* @param path Route path
|
|
69
|
+
* @param handler Route handler function
|
|
70
|
+
* @returns Router instance for chaining
|
|
71
|
+
*/
|
|
72
|
+
delete(path: string, handler: Handler): this;
|
|
73
|
+
/**
|
|
74
|
+
* Register an OPTIONS route.
|
|
75
|
+
*
|
|
76
|
+
* Used for CORS preflight requests or capability discovery.
|
|
77
|
+
*
|
|
78
|
+
* @param path Route path
|
|
79
|
+
* @param handler Route handler function
|
|
80
|
+
* @returns Router instance for chaining
|
|
81
|
+
*/
|
|
82
|
+
options(path: string, handler: Handler): this;
|
|
83
|
+
/**
|
|
84
|
+
* Register a HEAD route.
|
|
85
|
+
*
|
|
86
|
+
* Same as GET but returns headers only (no body).
|
|
87
|
+
*
|
|
88
|
+
* @param path Route path
|
|
89
|
+
* @param handler Route handler function
|
|
90
|
+
* @returns Router instance for chaining
|
|
91
|
+
*/
|
|
92
|
+
head(path: string, handler: Handler): this;
|
|
93
|
+
/**
|
|
94
|
+
* Register a route for all HTTP methods.
|
|
95
|
+
*
|
|
96
|
+
* This registers the same handler for every supported HTTP method.
|
|
97
|
+
* Useful for middleware-like or catch-all behavior.
|
|
98
|
+
*
|
|
99
|
+
* @param path Route path
|
|
100
|
+
* @param handler Route handler function
|
|
101
|
+
* @returns Router instance for chaining
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* router.all("/health", (req, res) => res.send("OK"));
|
|
105
|
+
*/
|
|
106
|
+
all(path: string, handler: Handler): this;
|
|
107
|
+
/**
|
|
108
|
+
* Lookup a route handler based on the incoming request.
|
|
109
|
+
*
|
|
110
|
+
* This method is responsible for resolving the correct route
|
|
111
|
+
* from the registered router tree and executing the matched handler.
|
|
112
|
+
*
|
|
113
|
+
* It supports parameterized routes, static routes, and (optionally)
|
|
114
|
+
* wildcard matching depending on router implementation.
|
|
115
|
+
*
|
|
116
|
+
* @param req Incoming HTTP request object
|
|
117
|
+
* @param res Server response object used to send output
|
|
118
|
+
*
|
|
119
|
+
* @returns void
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* router.lookup(req, res);
|
|
123
|
+
*
|
|
124
|
+
* @internal
|
|
125
|
+
* This is typically called by the HTTP server layer and should not
|
|
126
|
+
* be invoked directly in most application code.
|
|
127
|
+
*/
|
|
128
|
+
lookup(req: IncomingMessage, res: ServerResponse): any;
|
|
129
|
+
private _createNode;
|
|
130
|
+
private _add;
|
|
131
|
+
private _extractParams;
|
|
132
|
+
}
|
|
133
|
+
export {};
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FastRouter = void 0;
|
|
4
|
+
const METHODS = [
|
|
5
|
+
"GET", "POST", "PUT", "PATCH",
|
|
6
|
+
"DELETE", "OPTIONS", "HEAD"
|
|
7
|
+
];
|
|
8
|
+
class FastRouter {
|
|
9
|
+
trees = Object.create(null);
|
|
10
|
+
_routes = [];
|
|
11
|
+
constructor() {
|
|
12
|
+
for (const m of METHODS) {
|
|
13
|
+
this.trees[m] = this._createNode();
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get all registered routes in the router.
|
|
18
|
+
*
|
|
19
|
+
* Returns the internal route registry used for debugging,
|
|
20
|
+
* inspection, or serialization of the router tree.
|
|
21
|
+
*
|
|
22
|
+
* @returns Internal routes structure
|
|
23
|
+
*/
|
|
24
|
+
get routes() {
|
|
25
|
+
return this._routes;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Register a GET route.
|
|
29
|
+
*
|
|
30
|
+
* Handles HTTP GET requests for the specified path.
|
|
31
|
+
*
|
|
32
|
+
* @param path Route path (e.g. "/users/:id")
|
|
33
|
+
* @param handler Function executed when route matches
|
|
34
|
+
* @returns Router instance for chaining
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* router.get("/users", (req, res) => {});
|
|
38
|
+
*/
|
|
39
|
+
get(path, handler) {
|
|
40
|
+
this._add("GET", path, handler);
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Register a POST route.
|
|
45
|
+
*
|
|
46
|
+
* Used for creating resources or submitting data.
|
|
47
|
+
*
|
|
48
|
+
* @param path Route path
|
|
49
|
+
* @param handler Route handler function
|
|
50
|
+
* @returns Router instance for chaining
|
|
51
|
+
*/
|
|
52
|
+
post(path, handler) {
|
|
53
|
+
this._add("POST", path, handler);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Register a PUT route.
|
|
58
|
+
*
|
|
59
|
+
* Typically used for full resource replacement.
|
|
60
|
+
*
|
|
61
|
+
* @param path Route path
|
|
62
|
+
* @param handler Route handler function
|
|
63
|
+
* @returns Router instance for chaining
|
|
64
|
+
*/
|
|
65
|
+
put(path, handler) {
|
|
66
|
+
this._add("PUT", path, handler);
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Register a PATCH route.
|
|
71
|
+
*
|
|
72
|
+
* Used for partial updates to a resource.
|
|
73
|
+
*
|
|
74
|
+
* @param path Route path
|
|
75
|
+
* @param handler Route handler function
|
|
76
|
+
* @returns Router instance for chaining
|
|
77
|
+
*/
|
|
78
|
+
patch(path, handler) {
|
|
79
|
+
this._add("PATCH", path, handler);
|
|
80
|
+
return this;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Register a DELETE route.
|
|
84
|
+
*
|
|
85
|
+
* Used for removing a resource.
|
|
86
|
+
*
|
|
87
|
+
* @param path Route path
|
|
88
|
+
* @param handler Route handler function
|
|
89
|
+
* @returns Router instance for chaining
|
|
90
|
+
*/
|
|
91
|
+
delete(path, handler) {
|
|
92
|
+
this._add("DELETE", path, handler);
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Register an OPTIONS route.
|
|
97
|
+
*
|
|
98
|
+
* Used for CORS preflight requests or capability discovery.
|
|
99
|
+
*
|
|
100
|
+
* @param path Route path
|
|
101
|
+
* @param handler Route handler function
|
|
102
|
+
* @returns Router instance for chaining
|
|
103
|
+
*/
|
|
104
|
+
options(path, handler) {
|
|
105
|
+
this._add("OPTIONS", path, handler);
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Register a HEAD route.
|
|
110
|
+
*
|
|
111
|
+
* Same as GET but returns headers only (no body).
|
|
112
|
+
*
|
|
113
|
+
* @param path Route path
|
|
114
|
+
* @param handler Route handler function
|
|
115
|
+
* @returns Router instance for chaining
|
|
116
|
+
*/
|
|
117
|
+
head(path, handler) {
|
|
118
|
+
this._add("HEAD", path, handler);
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Register a route for all HTTP methods.
|
|
123
|
+
*
|
|
124
|
+
* This registers the same handler for every supported HTTP method.
|
|
125
|
+
* Useful for middleware-like or catch-all behavior.
|
|
126
|
+
*
|
|
127
|
+
* @param path Route path
|
|
128
|
+
* @param handler Route handler function
|
|
129
|
+
* @returns Router instance for chaining
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* router.all("/health", (req, res) => res.send("OK"));
|
|
133
|
+
*/
|
|
134
|
+
all(path, handler) {
|
|
135
|
+
for (const method of METHODS) {
|
|
136
|
+
this._add(method, path, handler);
|
|
137
|
+
}
|
|
138
|
+
return this;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Lookup a route handler based on the incoming request.
|
|
142
|
+
*
|
|
143
|
+
* This method is responsible for resolving the correct route
|
|
144
|
+
* from the registered router tree and executing the matched handler.
|
|
145
|
+
*
|
|
146
|
+
* It supports parameterized routes, static routes, and (optionally)
|
|
147
|
+
* wildcard matching depending on router implementation.
|
|
148
|
+
*
|
|
149
|
+
* @param req Incoming HTTP request object
|
|
150
|
+
* @param res Server response object used to send output
|
|
151
|
+
*
|
|
152
|
+
* @returns void
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* router.lookup(req, res);
|
|
156
|
+
*
|
|
157
|
+
* @internal
|
|
158
|
+
* This is typically called by the HTTP server layer and should not
|
|
159
|
+
* be invoked directly in most application code.
|
|
160
|
+
*/
|
|
161
|
+
lookup(req, res) {
|
|
162
|
+
const method = req.method;
|
|
163
|
+
let node = this.trees[method];
|
|
164
|
+
if (!node) {
|
|
165
|
+
res.statusCode = 405;
|
|
166
|
+
console.log({ method });
|
|
167
|
+
return res.end("Method Not Allowed");
|
|
168
|
+
}
|
|
169
|
+
let url = req.url || "/";
|
|
170
|
+
let q = url.indexOf("?");
|
|
171
|
+
if (q !== -1)
|
|
172
|
+
url = url.slice(0, q);
|
|
173
|
+
const params = Object.create(null);
|
|
174
|
+
const rootWildcard = node.wildcard;
|
|
175
|
+
let start = 1;
|
|
176
|
+
for (let i = 1; i <= url.length; i++) {
|
|
177
|
+
if (url[i] === "/" || i === url.length) {
|
|
178
|
+
const part = url.slice(start, i);
|
|
179
|
+
if (!part) {
|
|
180
|
+
start = i + 1;
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
183
|
+
let next = node.static[part];
|
|
184
|
+
if (next) {
|
|
185
|
+
node = next;
|
|
186
|
+
start = i + 1;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (node.param) {
|
|
190
|
+
params[node.param.paramName] = part;
|
|
191
|
+
node = node.param;
|
|
192
|
+
start = i + 1;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (node.wildcard) {
|
|
196
|
+
params["*"] = url.slice(start);
|
|
197
|
+
node = node.wildcard;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
if (rootWildcard?.handler) {
|
|
201
|
+
return rootWildcard.handler(req, res, params);
|
|
202
|
+
}
|
|
203
|
+
res.statusCode = 404;
|
|
204
|
+
res.end("Not Found");
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (!node.handler) {
|
|
209
|
+
if (rootWildcard?.handler) {
|
|
210
|
+
return rootWildcard.handler(req, res, params);
|
|
211
|
+
}
|
|
212
|
+
res.statusCode = 404;
|
|
213
|
+
return res.end("Not Found");
|
|
214
|
+
}
|
|
215
|
+
return node.handler(req, res, params);
|
|
216
|
+
}
|
|
217
|
+
_createNode() {
|
|
218
|
+
return { static: Object.create(null) };
|
|
219
|
+
}
|
|
220
|
+
_add(method, path, handler) {
|
|
221
|
+
let node = this.trees[method];
|
|
222
|
+
let start = 1;
|
|
223
|
+
for (let i = 1; i <= path.length; i++) {
|
|
224
|
+
if (path[i] === "/" || i === path.length) {
|
|
225
|
+
const part = path.slice(start, i);
|
|
226
|
+
if (!part) {
|
|
227
|
+
start = i + 1;
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if (part[0] === ":") {
|
|
231
|
+
if (!node.param) {
|
|
232
|
+
node.param = this._createNode();
|
|
233
|
+
node.param.paramName = part.slice(1);
|
|
234
|
+
}
|
|
235
|
+
node = node.param;
|
|
236
|
+
}
|
|
237
|
+
else if (part === "*") {
|
|
238
|
+
if (!node.wildcard) {
|
|
239
|
+
node.wildcard = this._createNode();
|
|
240
|
+
}
|
|
241
|
+
node = node.wildcard;
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
if (!node.static[part]) {
|
|
246
|
+
node.static[part] = this._createNode();
|
|
247
|
+
}
|
|
248
|
+
node = node.static[part];
|
|
249
|
+
}
|
|
250
|
+
start = i + 1;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
node.handler = handler;
|
|
254
|
+
this._routes.push({
|
|
255
|
+
path,
|
|
256
|
+
method,
|
|
257
|
+
params: this._extractParams(path)
|
|
258
|
+
});
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
_extractParams(path) {
|
|
262
|
+
const params = [];
|
|
263
|
+
let start = 1;
|
|
264
|
+
for (let i = 1; i <= path.length; i++) {
|
|
265
|
+
if (path[i] === "/" || i === path.length) {
|
|
266
|
+
const part = path.slice(start, i);
|
|
267
|
+
if (part && part[0] === ":") {
|
|
268
|
+
params.push(part.slice(1));
|
|
269
|
+
}
|
|
270
|
+
start = i + 1;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return params;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.FastRouter = FastRouter;
|
|
277
|
+
//# sourceMappingURL=fast-router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fast-router.js","sourceRoot":"","sources":["../../../../src/lib/core/server/fast-router.ts"],"names":[],"mappings":";;;AAiBA,MAAM,OAAO,GAAG;IACd,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;IAC7B,QAAQ,EAAE,SAAS,EAAE,MAAM;CACnB,CAAA;AAGV,MAAa,UAAU;IACb,KAAK,GAAyB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClD,OAAO,GAAc,EAAE,CAAA;IAE/B;QACE,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACrC,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;;;;;;;;;;OAWG;IACI,GAAG,CAAC,IAAY,EAAE,OAAgB;QACvC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;OAQG;IACI,IAAI,CAAC,IAAY,EAAE,OAAgB;QACxC,IAAI,CAAC,IAAI,CAAC,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