@bepalo/router 1.0.3

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.
Files changed (67) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +557 -0
  3. package/dist/cjs/helpers.d.ts +290 -0
  4. package/dist/cjs/helpers.d.ts.map +1 -0
  5. package/dist/cjs/helpers.js +691 -0
  6. package/dist/cjs/helpers.js.map +1 -0
  7. package/dist/cjs/index.d.ts +5 -0
  8. package/dist/cjs/index.d.ts.map +1 -0
  9. package/dist/cjs/index.js +21 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/list.d.ts +166 -0
  12. package/dist/cjs/list.d.ts.map +1 -0
  13. package/dist/cjs/list.js +483 -0
  14. package/dist/cjs/list.js.map +1 -0
  15. package/dist/cjs/middlewares.d.ts +251 -0
  16. package/dist/cjs/middlewares.d.ts.map +1 -0
  17. package/dist/cjs/middlewares.js +359 -0
  18. package/dist/cjs/middlewares.js.map +1 -0
  19. package/dist/cjs/router.d.ts +333 -0
  20. package/dist/cjs/router.d.ts.map +1 -0
  21. package/dist/cjs/router.js +659 -0
  22. package/dist/cjs/router.js.map +1 -0
  23. package/dist/cjs/tree.d.ts +18 -0
  24. package/dist/cjs/tree.d.ts.map +1 -0
  25. package/dist/cjs/tree.js +162 -0
  26. package/dist/cjs/tree.js.map +1 -0
  27. package/dist/cjs/types.d.ts +127 -0
  28. package/dist/cjs/types.d.ts.map +1 -0
  29. package/dist/cjs/types.js +3 -0
  30. package/dist/cjs/types.js.map +1 -0
  31. package/dist/cjs/upload-stream.d.ts +105 -0
  32. package/dist/cjs/upload-stream.d.ts.map +1 -0
  33. package/dist/cjs/upload-stream.js +417 -0
  34. package/dist/cjs/upload-stream.js.map +1 -0
  35. package/dist/helpers.d.ts +290 -0
  36. package/dist/helpers.d.ts.map +1 -0
  37. package/dist/helpers.js +691 -0
  38. package/dist/helpers.js.map +1 -0
  39. package/dist/index.d.ts +5 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +21 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/list.d.ts +166 -0
  44. package/dist/list.d.ts.map +1 -0
  45. package/dist/list.js +483 -0
  46. package/dist/list.js.map +1 -0
  47. package/dist/middlewares.d.ts +251 -0
  48. package/dist/middlewares.d.ts.map +1 -0
  49. package/dist/middlewares.js +359 -0
  50. package/dist/middlewares.js.map +1 -0
  51. package/dist/router.d.ts +333 -0
  52. package/dist/router.d.ts.map +1 -0
  53. package/dist/router.js +659 -0
  54. package/dist/router.js.map +1 -0
  55. package/dist/tree.d.ts +18 -0
  56. package/dist/tree.d.ts.map +1 -0
  57. package/dist/tree.js +162 -0
  58. package/dist/tree.js.map +1 -0
  59. package/dist/types.d.ts +127 -0
  60. package/dist/types.d.ts.map +1 -0
  61. package/dist/types.js +3 -0
  62. package/dist/types.js.map +1 -0
  63. package/dist/upload-stream.d.ts +105 -0
  64. package/dist/upload-stream.d.ts.map +1 -0
  65. package/dist/upload-stream.js +417 -0
  66. package/dist/upload-stream.js.map +1 -0
  67. package/package.json +51 -0
@@ -0,0 +1,333 @@
1
+ /**
2
+ * @file A fast radix-trie based router for JavaScript runtimes.
3
+ * @module @bepalo/router
4
+ * @author Natnael Eshetu
5
+ * @exports Router
6
+ */
7
+ import { Tree } from "./tree.js";
8
+ import { HttpMethod, MethodPath, Pipeline, HandlerType, HttpPath, Handler } from "./types.js";
9
+ /**
10
+ * Checks if a string is a valid HTTP method.
11
+ * @param {string} method - The method string to validate
12
+ * @returns {boolean} True if the method is valid, false otherwise
13
+ */
14
+ export declare const isValidHttpMethod: (method: string) => boolean;
15
+ /**
16
+ * Represents a parameter extracted from a route path.
17
+ * @typedef {Object} NodeParam
18
+ * @property {string} name - The parameter name (without the colon)
19
+ * @property {number} index - The position of the parameter in the path
20
+ */
21
+ type NodeParam = {
22
+ name: string;
23
+ index: number;
24
+ };
25
+ /**
26
+ * Represents a node in the routing tree.
27
+ * @typedef {Object} RouteNode
28
+ * @property {HttpMethod} method - HTTP method for this route
29
+ * @property {string} pathname - The original path pattern
30
+ * @property {Array<string>} nodes - Split path segments for the trie
31
+ * @property {Pipeline<Context>} pipeline - Handlers to execute for this route
32
+ * @property {Map<number, NodeParam>} [params] - Parameters extracted from the path
33
+ * @template Context
34
+ */
35
+ type RouteNode<Context> = {
36
+ method: HttpMethod;
37
+ pathname: string;
38
+ nodes: Array<string>;
39
+ pipeline: Pipeline<Context>;
40
+ params?: Map<number, NodeParam>;
41
+ };
42
+ /**
43
+ * Base context object for router handlers.
44
+ * @typedef {Object} RouterContext
45
+ * @property {Record<string, string>} params - Route parameters extracted from the URL
46
+ * @property {Headers} headers - Response headers (can be modified by handlers)
47
+ * @property {Response} [response] - The final response object (set by handlers)
48
+ * @property {Error} [error] - Error object (set when an exception occurs)
49
+ * @property {Object} found - Information about which route types were matched
50
+ * @property {boolean} found.hooks - Whether any hooks were found
51
+ * @property {boolean} found.afters - Whether any after handlers were found
52
+ * @property {boolean} found.filters - Whether any filters were found
53
+ * @property {boolean} found.handlers - Whether any handlers were found
54
+ * @property {boolean} found.fallbacks - Whether any fallbacks were found
55
+ * @property {boolean} found.catchers - Whether any catchers were found
56
+ */
57
+ export interface RouterContext {
58
+ params: Record<string, string>;
59
+ headers: Headers;
60
+ response?: Response;
61
+ error?: Error;
62
+ found: {
63
+ hooks: boolean;
64
+ afters: boolean;
65
+ filters: boolean;
66
+ handlers: boolean;
67
+ fallbacks: boolean;
68
+ catchers: boolean;
69
+ };
70
+ }
71
+ /**
72
+ * Configuration options for enabling/disabling handler types.
73
+ * @typedef {Object} HandlerEnable
74
+ * @property {boolean} hooks - Enable hook handlers
75
+ * @property {boolean} afters - Enable after handlers
76
+ * @property {boolean} filters - Enable filter handlers
77
+ * @property {boolean} fallbacks - Enable fallback handlers
78
+ * @property {boolean} catchers - Enable catcher handlers
79
+ */
80
+ interface HandlerEnable {
81
+ hooks: boolean;
82
+ afters: boolean;
83
+ filters: boolean;
84
+ fallbacks: boolean;
85
+ catchers: boolean;
86
+ }
87
+ /**
88
+ * Configuration options for the Router.
89
+ * @typedef {Object} RouterConfig
90
+ * @property {Array<[string, string]>} [defaultHeaders] - Default headers to add to all responses
91
+ * @property {Handler<Context>} [defaultCatcher] - Default error handler for uncaught exceptions
92
+ * @property {Handler<Context>} [defaultFallback] - Default handler for unmatched routes
93
+ * @property {HandlerEnable} [enable] - Configuration for enabling/disabling handler types
94
+ * @template Context
95
+ */
96
+ export interface RouterConfig<Context extends RouterContext> {
97
+ defaultHeaders?: Array<[string, string]>;
98
+ defaultCatcher?: Handler<Context>;
99
+ defaultFallback?: Handler<Context>;
100
+ enable?: HandlerEnable;
101
+ }
102
+ /**
103
+ * Options for route registration.
104
+ * @typedef {Object} HandlerOptions
105
+ * @property {boolean} [overwrite] - Allow overwriting existing routes
106
+ */
107
+ export interface HandlerOptions {
108
+ overwrite?: boolean;
109
+ }
110
+ /**
111
+ * Handler settings infromation for use with append and auditing
112
+ */
113
+ interface HandlerSetter<Context extends RouterContext> {
114
+ handlerType: HandlerType;
115
+ urls: "*" | MethodPath | Array<MethodPath>;
116
+ pipeline: Handler<Context> | Pipeline<Context>;
117
+ options?: HandlerOptions;
118
+ }
119
+ /**
120
+ * A fast radix-trie based router for JavaScript runtimes.
121
+ * Supports hooks, filters, handlers, fallbacks, catchers, and after handlers.
122
+ * @class
123
+ * @template Context
124
+ * @example
125
+ * const router = new Router();
126
+ *
127
+ * // Register a simple GET handler
128
+ * router.handle("GET /users/:id", async (req, ctx) => {
129
+ * const userId = ctx.params.id;
130
+ * return json({ userId });
131
+ * });
132
+ *
133
+ * // Register a hook that runs before all /api routes
134
+ * router.hook("* /api/**", (req, ctx) => {
135
+ * console.log(`API request: ${req.method} ${req.url}`);
136
+ * });
137
+ *
138
+ * // Register an error handler
139
+ * router.catch("* /**", (req, ctx) => {
140
+ * console.error(ctx.error);
141
+ * return json({ error: "Something went wrong" }, { status: 500 });
142
+ * });
143
+ *
144
+ * // Handle a request and get a response
145
+ * const response = await router.respond(new Request("http://localhost/"));
146
+ *
147
+ */
148
+ export declare class Router<Context extends RouterContext = RouterContext> {
149
+ #private;
150
+ /**
151
+ * Static property containing all HTTP methods with wildcard paths.
152
+ * @type {Array<SplitURL>}
153
+ * @readonly
154
+ */
155
+ static ALL_METHOD_PATHS: SplitURL[];
156
+ /**
157
+ * Gets the routing trees for all handler types.
158
+ * @returns {Record<HandlerType, Record<HttpMethod, Tree<RouteNode<Context>>>>}
159
+ */
160
+ get trees(): Record<HandlerType, Record<HttpMethod, Tree<RouteNode<Context>>>>;
161
+ /**
162
+ * Gets the enabled handler types configuration.
163
+ * @returns {HandlerEnable}
164
+ */
165
+ get enabled(): HandlerEnable;
166
+ /**
167
+ * Gets the default headers configuration.
168
+ * @returns {Array<[string, string]>}
169
+ */
170
+ get defaultHeaders(): Array<[string, string]>;
171
+ /**
172
+ * Gets the default catcher handler.
173
+ * @returns {Handler<Context>|undefined}
174
+ */
175
+ get defaultCatcher(): Handler<Context> | undefined;
176
+ /**
177
+ * Gets the default fallback handler.
178
+ * @returns {Handler<Context>|undefined}
179
+ */
180
+ get defaultFallback(): Handler<Context> | undefined;
181
+ /**
182
+ * Gets the route registration history.
183
+ * @returns {Set<HandlerSetter<Context>>}
184
+ */
185
+ get setters(): Set<HandlerSetter<Context>>;
186
+ /**
187
+ * Creates a new Router instance.
188
+ * @param {RouterConfig<Context>} [config] - Configuration options
189
+ */
190
+ constructor(config?: RouterConfig<Context>);
191
+ /**
192
+ * Registers a hook handler that runs before other handlers.
193
+ * Hooks cannot modify the response directly but can modify context.
194
+ * Their responses are ignored.
195
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
196
+ * @param {Handler<Context & XContext>|Pipeline<Context & XContext>} pipeline - Handler(s) to execute
197
+ * @param {HandlerOptions} [options] - Registration options
198
+ * @returns {Router<Context & XContext>} The router instance for chaining
199
+ * @template XContext
200
+ * @example
201
+ * router.hook("GET /api/**", (req, ctx) => {
202
+ * ctx.startTime = Date.now();
203
+ * });
204
+ */
205
+ hook<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext> | Pipeline<Context & XContext>, options?: HandlerOptions): Router<Context & XContext>;
206
+ /**
207
+ * Registers an after handler that runs after the response is created.
208
+ * After handlers can inspect and modify the response from the context.
209
+ * Their responses are ignored.
210
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
211
+ * @param {Handler<Context & XContext>|Pipeline<Context & XContext>} pipeline - Handler(s) to execute
212
+ * @param {HandlerOptions} [options] - Registration options
213
+ * @returns {Router<Context & XContext>} The router instance for chaining
214
+ * @template XContext
215
+ * @example
216
+ * router.after("GET /**", (req, ctx) => {
217
+ * console.log(`Request completed: ${req.method} ${req.url}`);
218
+ * });
219
+ */
220
+ after<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext> | Pipeline<Context & XContext>, options?: HandlerOptions): Router<Context & XContext>;
221
+ /**
222
+ * Registers a filter handler that can intercept and modify requests.
223
+ * Filters run after hooks but before handlers and can return a response.
224
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
225
+ * @param {Handler<Context & XContext>|Pipeline<Context & XContext>} pipeline - Handler(s) to execute
226
+ * @param {HandlerOptions} [options] - Registration options
227
+ * @returns {Router<Context & XContext>} The router instance for chaining
228
+ * @template XContext
229
+ * @example
230
+ * router.filter("GET /admin/**", (req, ctx) => {
231
+ * if (!req.headers.get("x-admin-token")) {
232
+ * return json({ error: "Unauthorized" }, { status: 401 });
233
+ * }
234
+ * });
235
+ */
236
+ filter<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext> | Pipeline<Context & XContext>, options?: HandlerOptions): Router<Context & XContext>;
237
+ /**
238
+ * Registers a main request handler.
239
+ * Handlers are the primary way to respond to requests.
240
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
241
+ * @param {Handler<Context & XContext>|Pipeline<Context & XContext>} pipeline - Handler(s) to execute
242
+ * @param {HandlerOptions} [options] - Registration options
243
+ * @returns {Router<Context & XContext>} The router instance for chaining
244
+ * @template XContext
245
+ * @example
246
+ * router.handle("GET /users", async (req, ctx) => {
247
+ * const users = await getUsers();
248
+ * return json({ users });
249
+ * });
250
+ */
251
+ handle<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext> | Pipeline<Context & XContext>, options?: HandlerOptions): Router<Context & XContext>;
252
+ /**
253
+ * Registers a fallback handler that runs when no main handler matches.
254
+ * Fallbacks are useful for custom 404 pages or default behaviors.
255
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
256
+ * @param {Handler<Context & XContext>|Pipeline<Context & XContext>} pipeline - Handler(s) to execute
257
+ * @param {HandlerOptions} [options] - Registration options
258
+ * @returns {Router<Context & XContext>} The router instance for chaining
259
+ * @template XContext
260
+ * @example
261
+ * router.fallback("GET /**", (req, ctx) => {
262
+ * return json({ error: "Not found" }, { status: 404 });
263
+ * });
264
+ */
265
+ fallback<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext> | Pipeline<Context & XContext>, options?: HandlerOptions): Router<Context & XContext>;
266
+ /**
267
+ * Registers an error handler for catching exceptions.
268
+ * Catchers receive the error in the context and can return a response.
269
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
270
+ * @param {Handler<Context & XContext & { error: Error }>|Pipeline<Context & XContext & { error: Error }>} pipeline - Handler(s) to execute
271
+ * @param {HandlerOptions} [options] - Registration options
272
+ * @returns {Router<Context & XContext & { error: Error }>} The router instance for chaining
273
+ * @template XContext
274
+ * @example
275
+ * router.catch("GET /**", (req, ctx) => {
276
+ * console.error(ctx.error);
277
+ * return json({ error: "Internal server error" }, { status: 500 });
278
+ * });
279
+ */
280
+ catch<XContext = {}>(urls: "*" | MethodPath | Array<MethodPath>, pipeline: Handler<Context & XContext & {
281
+ error: Error;
282
+ }> | Pipeline<Context & XContext & {
283
+ error: Error;
284
+ }>, options?: HandlerOptions): Router<Context & XContext & {
285
+ error: Error;
286
+ }>;
287
+ /**
288
+ * Appends routes from another router under a base URL.
289
+ * Useful for mounting sub-routers or organizing routes by prefix.
290
+ * @param {`/${string}`} baseUrl - The base URL to mount the router under
291
+ * @param {Router<Context>} router - The router to append
292
+ * @param {HandlerOptions} [options] - Registration options
293
+ * @returns {Router<Context>} The router instance for chaining
294
+ * @example
295
+ * const apiRouter = new Router();
296
+ * apiRouter.handle("GET /users", getUsersHandler);
297
+ *
298
+ * const mainRouter = new Router();
299
+ * mainRouter.append("/api", apiRouter);
300
+ * // Now GET /api/users routes to getUsersHandler
301
+ */
302
+ append(baseUrl: `/${string}`, router: Router<Context>, options?: HandlerOptions): Router<Context>;
303
+ /**
304
+ * Low-level method to register routes of any handler type.
305
+ * @param {HandlerType} handlerType - The type of handler to register
306
+ * @param {"*"|MethodPath|Array<MethodPath>} urls - URL patterns to match
307
+ * @param {Handler<Context>|Pipeline<Context>} pipeline_ - Handler(s) to execute
308
+ * @param {HandlerOptions} [options] - Registration options
309
+ * @returns {Router<Context>} The router instance for chaining
310
+ * @private
311
+ */
312
+ setRoutes(handlerType: HandlerType, urls: "*" | MethodPath | Array<MethodPath>, pipeline_: Handler<Context> | Pipeline<Context>, options?: HandlerOptions): Router<Context>;
313
+ /**
314
+ * Handles an incoming HTTP request and returns a response.
315
+ * This is the main entry point for request processing.
316
+ * Handlers are only called if they are not disabled.
317
+ * @param {Request} req - The incoming HTTP request
318
+ * @param {Partial<Context>} [context] - Initial context object
319
+ * @returns {Promise<Response>} The HTTP response
320
+ */
321
+ respond(req: Request, context?: Partial<Context>): Promise<Response>;
322
+ }
323
+ export interface SplitURL {
324
+ method: HttpMethod;
325
+ pathname: HttpPath;
326
+ nodes: string[];
327
+ params: Map<number, {
328
+ name: string;
329
+ index: number;
330
+ }>;
331
+ }
332
+ export default Router;
333
+ //# sourceMappingURL=router.d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