@forinda/kickjs 1.6.0 → 1.7.1-alpha.0

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 (104) hide show
  1. package/dist/chunk-DVVP7zzD.js +7 -0
  2. package/dist/core/adapter.d.ts +109 -0
  3. package/dist/core/adapter.d.ts.map +1 -0
  4. package/dist/core/adapter.js +0 -0
  5. package/dist/core/app-module.d.ts +28 -0
  6. package/dist/core/app-module.d.ts.map +1 -0
  7. package/dist/core/app-module.js +0 -0
  8. package/dist/core/cache.d.ts +93 -0
  9. package/dist/core/cache.d.ts.map +1 -0
  10. package/dist/core/cache.js +57 -0
  11. package/dist/core/container.d.ts +63 -0
  12. package/dist/core/container.d.ts.map +1 -0
  13. package/dist/core/container.js +117 -0
  14. package/dist/core/cron.d.ts +28 -0
  15. package/dist/core/cron.d.ts.map +1 -0
  16. package/dist/core/cron.js +22 -0
  17. package/dist/core/decorators.d.ts +152 -0
  18. package/dist/core/decorators.d.ts.map +1 -0
  19. package/dist/core/decorators.js +141 -0
  20. package/dist/core/errors.d.ts +64 -0
  21. package/dist/core/errors.d.ts.map +1 -0
  22. package/dist/core/errors.js +67 -0
  23. package/dist/core/index.d.ts +14 -0
  24. package/dist/core/index.d.ts.map +1 -0
  25. package/dist/core/interfaces.d.ts +44 -0
  26. package/dist/core/interfaces.d.ts.map +1 -0
  27. package/dist/core/interfaces.js +25 -0
  28. package/dist/core/logger.d.ts +43 -0
  29. package/dist/core/logger.d.ts.map +1 -0
  30. package/dist/core/logger.js +54 -0
  31. package/dist/core/path.d.ts +21 -0
  32. package/dist/core/path.d.ts.map +1 -0
  33. package/dist/core/path.js +12 -0
  34. package/dist/core/plugin.d.ts +90 -0
  35. package/dist/core/plugin.d.ts.map +1 -0
  36. package/dist/core/plugin.js +0 -0
  37. package/dist/core/reactivity.d.ts +83 -0
  38. package/dist/core/reactivity.d.ts.map +1 -0
  39. package/dist/core/reactivity.js +101 -0
  40. package/dist/core-B6Okew3W.js +7 -0
  41. package/dist/http/application.d.ts +103 -0
  42. package/dist/http/application.d.ts.map +1 -0
  43. package/dist/http/application.js +167 -0
  44. package/dist/http/bootstrap.d.ts +22 -0
  45. package/dist/http/bootstrap.d.ts.map +1 -0
  46. package/dist/http/bootstrap.js +40 -0
  47. package/dist/http/context.d.ts +129 -0
  48. package/dist/http/context.d.ts.map +1 -0
  49. package/dist/http/context.js +115 -0
  50. package/dist/http/index.d.ts +16 -0
  51. package/dist/http/index.d.ts.map +1 -0
  52. package/dist/http/middleware/cors.d.ts +43 -0
  53. package/dist/http/middleware/cors.d.ts.map +1 -0
  54. package/dist/http/middleware/cors.js +31 -0
  55. package/dist/http/middleware/csrf.d.ts +47 -0
  56. package/dist/http/middleware/csrf.d.ts.map +1 -0
  57. package/dist/http/middleware/csrf.js +25 -0
  58. package/dist/http/middleware/error-handler.d.ts +6 -0
  59. package/dist/http/middleware/error-handler.d.ts.map +1 -0
  60. package/dist/http/middleware/error-handler.js +37 -0
  61. package/dist/http/middleware/helmet.d.ts +36 -0
  62. package/dist/http/middleware/helmet.d.ts.map +1 -0
  63. package/dist/http/middleware/helmet.js +20 -0
  64. package/dist/http/middleware/rate-limit.d.ts +51 -0
  65. package/dist/http/middleware/rate-limit.d.ts.map +1 -0
  66. package/dist/http/middleware/rate-limit.js +46 -0
  67. package/dist/http/middleware/request-id.d.ts +5 -0
  68. package/dist/http/middleware/request-id.d.ts.map +1 -0
  69. package/dist/http/middleware/request-id.js +12 -0
  70. package/dist/http/middleware/request-logger.d.ts +27 -0
  71. package/dist/http/middleware/request-logger.d.ts.map +1 -0
  72. package/dist/http/middleware/request-logger.js +16 -0
  73. package/dist/http/middleware/session.d.ts +62 -0
  74. package/dist/http/middleware/session.d.ts.map +1 -0
  75. package/dist/http/middleware/session.js +76 -0
  76. package/dist/http/middleware/spa.d.ts +93 -0
  77. package/dist/http/middleware/spa.d.ts.map +1 -0
  78. package/dist/http/middleware/spa.js +52 -0
  79. package/dist/http/middleware/upload.d.ts +75 -0
  80. package/dist/http/middleware/upload.d.ts.map +1 -0
  81. package/dist/http/middleware/upload.js +119 -0
  82. package/dist/http/middleware/validate.d.ts +13 -0
  83. package/dist/http/middleware/validate.d.ts.map +1 -0
  84. package/dist/http/middleware/validate.js +45 -0
  85. package/dist/http/middleware/views.d.ts +56 -0
  86. package/dist/http/middleware/views.d.ts.map +1 -0
  87. package/dist/http/middleware/views.js +18 -0
  88. package/dist/http/query/index.d.ts +4 -0
  89. package/dist/http/query/index.d.ts.map +1 -0
  90. package/dist/http/query/index.js +10 -0
  91. package/dist/http/query/parse-query.d.ts +44 -0
  92. package/dist/http/query/parse-query.d.ts.map +1 -0
  93. package/dist/http/query/types.d.ts +100 -0
  94. package/dist/http/query/types.d.ts.map +1 -0
  95. package/dist/http/router-builder.d.ts +17 -0
  96. package/dist/http/router-builder.d.ts.map +1 -0
  97. package/dist/http/router-builder.js +37 -0
  98. package/dist/index.d.ts +23 -0
  99. package/dist/index.d.ts.map +1 -0
  100. package/dist/index.js +99 -0
  101. package/dist/query-Bym31XRp.js +88 -0
  102. package/package.json +90 -29
  103. package/index.d.ts +0 -3
  104. package/index.js +0 -13
@@ -0,0 +1,129 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ import { type ParsedQuery, type QueryFieldConfig } from './query';
3
+ /**
4
+ * Unified request/response abstraction passed to every controller method.
5
+ * Shields handlers from raw Express objects and provides convenience methods.
6
+ */
7
+ export declare class RequestContext<TBody = any, TParams = any, TQuery = any> {
8
+ readonly req: Request;
9
+ readonly res: Response;
10
+ readonly next: NextFunction;
11
+ constructor(req: Request, res: Response, next: NextFunction);
12
+ /**
13
+ * Per-request metadata map shared across all RequestContext instances
14
+ * for the same request. Stored on `req` so middleware can pass data
15
+ * to handlers via `ctx.set()` / `ctx.get()`.
16
+ */
17
+ private get metadata();
18
+ get body(): TBody;
19
+ get params(): TParams;
20
+ get query(): TQuery;
21
+ get headers(): import("node:http").IncomingHttpHeaders;
22
+ get requestId(): string | undefined;
23
+ /** Session data (requires session middleware) */
24
+ get session(): any;
25
+ /**
26
+ * Parse the request query string into structured filters, sort, pagination, and search.
27
+ * Pass the result to an ORM query builder adapter (Drizzle, Prisma, Sequelize, etc.).
28
+ *
29
+ * @param fieldConfig - Optional whitelist for filterable, sortable, and searchable fields
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * @Get('/')
34
+ * async list(ctx: RequestContext) {
35
+ * const parsed = ctx.qs({
36
+ * filterable: ['status', 'priority'],
37
+ * sortable: ['createdAt', 'title'],
38
+ * })
39
+ * const q = drizzleAdapter.build(parsed, { columns })
40
+ * // ... use q.where, q.orderBy, q.limit, q.offset
41
+ * }
42
+ * ```
43
+ */
44
+ qs(fieldConfig?: QueryFieldConfig): ParsedQuery;
45
+ /** Single uploaded file (requires @FileUpload({ mode: 'single' })) */
46
+ get file(): any;
47
+ /** Array of uploaded files (requires @FileUpload({ mode: 'array' })) */
48
+ get files(): any[] | undefined;
49
+ get<T = any>(key: string): T | undefined;
50
+ set(key: string, value: any): void;
51
+ json(data: any, status?: number): Response<any, Record<string, any>>;
52
+ created(data: any): Response<any, Record<string, any>>;
53
+ noContent(): Response<any, Record<string, any>>;
54
+ notFound(message?: string): Response<any, Record<string, any>>;
55
+ badRequest(message: string): Response<any, Record<string, any>>;
56
+ html(content: string, status?: number): Response<any, Record<string, any>>;
57
+ download(buffer: Buffer, filename: string, contentType?: string): Response<any, Record<string, any>>;
58
+ /**
59
+ * Render a template using the registered view engine (EJS, Pug, Handlebars, etc.).
60
+ * Requires a ViewAdapter to be configured in bootstrap().
61
+ *
62
+ * @param template - Template name (without extension, relative to viewsDir)
63
+ * @param data - Data to pass to the template
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * ctx.render('dashboard', { user, title: 'Dashboard' })
68
+ * ctx.render('emails/welcome', { name: 'Alice' })
69
+ * ```
70
+ */
71
+ render(template: string, data?: Record<string, any>): void;
72
+ /**
73
+ * Parse query params and return a standardized paginated response.
74
+ * Calls `ctx.qs()` internally, then wraps your data with pagination meta.
75
+ *
76
+ * @param fetcher - Async function that receives ParsedQuery and returns `{ data, total }`
77
+ * @param fieldConfig - Optional whitelist for filterable, sortable, searchable fields
78
+ *
79
+ * @example
80
+ * ```ts
81
+ * @Get('/')
82
+ * async list(ctx: RequestContext) {
83
+ * return ctx.paginate(
84
+ * async (parsed) => {
85
+ * const data = await db.select().from(users)
86
+ * .where(query.where).limit(parsed.pagination.limit)
87
+ * .offset(parsed.pagination.offset).all()
88
+ * const total = await db.select({ count: count() }).from(users).get()
89
+ * return { data, total: total?.count ?? 0 }
90
+ * },
91
+ * { filterable: ['name', 'role'], sortable: ['createdAt'] },
92
+ * )
93
+ * }
94
+ * ```
95
+ */
96
+ paginate<T>(fetcher: (parsed: ParsedQuery) => Promise<{
97
+ data: T[];
98
+ total: number;
99
+ }>, fieldConfig?: QueryFieldConfig): Promise<Response<any, Record<string, any>>>;
100
+ /**
101
+ * Start an SSE (Server-Sent Events) stream.
102
+ * Sets the correct headers and returns helpers to send events.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * @Get('/events')
107
+ * async stream(ctx: RequestContext) {
108
+ * const sse = ctx.sse()
109
+ *
110
+ * const interval = setInterval(() => {
111
+ * sse.send({ time: new Date().toISOString() }, 'tick')
112
+ * }, 1000)
113
+ *
114
+ * sse.onClose(() => clearInterval(interval))
115
+ * }
116
+ * ```
117
+ */
118
+ sse(): {
119
+ /** Send an SSE event with optional event name and id */
120
+ send: (data: any, event?: string, id?: string) => void;
121
+ /** Send a comment (keeps connection alive) */
122
+ comment: (text: string) => void;
123
+ /** Register a callback when the client disconnects */
124
+ onClose: (fn: () => void) => void;
125
+ /** End the SSE stream */
126
+ close: () => void;
127
+ };
128
+ }
129
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/http/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9D,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EAEtB,MAAM,SAAS,CAAA;AAEhB;;;GAGG;AACH,qBAAa,cAAc,CAAC,KAAK,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG;aAEhD,GAAG,EAAE,OAAO;aACZ,GAAG,EAAE,QAAQ;aACb,IAAI,EAAE,YAAY;gBAFlB,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY;IAGpC;;;;OAIG;IACH,OAAO,KAAK,QAAQ,GAInB;IAID,IAAI,IAAI,IAAI,KAAK,CAEhB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,OAAO,4CAEV;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,iDAAiD;IACjD,IAAI,OAAO,IAAI,GAAG,CAEjB;IAID;;;;;;;;;;;;;;;;;;OAkBG;IACH,EAAE,CAAC,WAAW,CAAC,EAAE,gBAAgB,GAAG,WAAW;IAM/C,sEAAsE;IACtE,IAAI,IAAI,IAAI,GAAG,CAEd;IAED,wEAAwE;IACxE,IAAI,KAAK,IAAI,GAAG,EAAE,GAAG,SAAS,CAE7B;IAID,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAMlC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,SAAM;IAI5B,OAAO,CAAC,IAAI,EAAE,GAAG;IAIjB,SAAS;IAIT,QAAQ,CAAC,OAAO,SAAc;IAI9B,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAM;IAIlC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,SAA6B;IAMnF;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM;IAIvD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,QAAQ,CAAC,CAAC,EACd,OAAO,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,EACvE,WAAW,CAAC,EAAE,gBAAgB;IAwBhC;;;;;;;;;;;;;;;;;OAiBG;IACH,GAAG;QAgBC,wDAAwD;qBAC3C,GAAG,UAAU,MAAM,OAAO,MAAM;QAK7C,8CAA8C;wBAC9B,MAAM;QAGtB,sDAAsD;sBACxC,MAAM,IAAI;QAGxB,yBAAyB;;;CAM9B"}
@@ -0,0 +1,115 @@
1
+ import { i as u } from "../query-Bym31XRp.js";
2
+ var d = class {
3
+ constructor(e, t, s) {
4
+ this.req = e, this.res = t, this.next = s;
5
+ }
6
+ get metadata() {
7
+ const e = this.req;
8
+ return e.__ctxMeta || (e.__ctxMeta = /* @__PURE__ */ new Map()), e.__ctxMeta;
9
+ }
10
+ get body() {
11
+ return this.req.body;
12
+ }
13
+ get params() {
14
+ return this.req.params;
15
+ }
16
+ get query() {
17
+ return this.req.query;
18
+ }
19
+ get headers() {
20
+ return this.req.headers;
21
+ }
22
+ get requestId() {
23
+ return this.req.requestId ?? this.req.headers["x-request-id"];
24
+ }
25
+ get session() {
26
+ return this.req.session;
27
+ }
28
+ qs(e) {
29
+ return u(this.req.query, e);
30
+ }
31
+ get file() {
32
+ return this.req.file;
33
+ }
34
+ get files() {
35
+ return this.req.files;
36
+ }
37
+ get(e) {
38
+ return this.metadata.get(e);
39
+ }
40
+ set(e, t) {
41
+ this.metadata.set(e, t);
42
+ }
43
+ json(e, t = 200) {
44
+ return this.res.status(t).json(e);
45
+ }
46
+ created(e) {
47
+ return this.res.status(201).json(e);
48
+ }
49
+ noContent() {
50
+ return this.res.status(204).end();
51
+ }
52
+ notFound(e = "Not Found") {
53
+ return this.res.status(404).json({ message: e });
54
+ }
55
+ badRequest(e) {
56
+ return this.res.status(400).json({ message: e });
57
+ }
58
+ html(e, t = 200) {
59
+ return this.res.status(t).type("html").send(e);
60
+ }
61
+ download(e, t, s = "application/octet-stream") {
62
+ return this.res.setHeader("Content-Disposition", `attachment; filename="${t}"`), this.res.setHeader("Content-Type", s), this.res.send(e);
63
+ }
64
+ render(e, t = {}) {
65
+ return this.res.render(e, t);
66
+ }
67
+ async paginate(e, t) {
68
+ const s = this.qs(t), { data: r, total: i } = await e(s), { page: n, limit: a } = s.pagination, o = Math.ceil(i / a) || 1, h = {
69
+ data: r,
70
+ meta: {
71
+ page: n,
72
+ limit: a,
73
+ total: i,
74
+ totalPages: o,
75
+ hasNext: n < o,
76
+ hasPrev: n > 1
77
+ }
78
+ };
79
+ return this.json(h);
80
+ }
81
+ sse() {
82
+ this.res.writeHead(200, {
83
+ "Content-Type": "text/event-stream",
84
+ "Cache-Control": "no-cache",
85
+ Connection: "keep-alive",
86
+ "X-Accel-Buffering": "no"
87
+ }), this.res.flushHeaders();
88
+ const e = [];
89
+ return this.req.on("close", () => {
90
+ for (const t of e) t();
91
+ }), {
92
+ send: (t, s, r) => {
93
+ r && this.res.write(`id: ${r}
94
+ `), s && this.res.write(`event: ${s}
95
+ `), this.res.write(`data: ${JSON.stringify(t)}
96
+
97
+ `);
98
+ },
99
+ comment: (t) => {
100
+ this.res.write(`: ${t}
101
+
102
+ `);
103
+ },
104
+ onClose: (t) => {
105
+ e.push(t);
106
+ },
107
+ close: () => {
108
+ this.res.end();
109
+ }
110
+ };
111
+ }
112
+ };
113
+ export {
114
+ d as RequestContext
115
+ };
@@ -0,0 +1,16 @@
1
+ export { Application, type ApplicationOptions, type MiddlewareEntry } from './application';
2
+ export { bootstrap } from './bootstrap';
3
+ export { RequestContext } from './context';
4
+ export { buildRoutes, getControllerPath } from './router-builder';
5
+ export { requestId, REQUEST_ID_HEADER } from './middleware/request-id';
6
+ export { validate } from './middleware/validate';
7
+ export { notFoundHandler, errorHandler } from './middleware/error-handler';
8
+ export { csrf, type CsrfOptions } from './middleware/csrf';
9
+ export { requestLogger, type RequestLoggerOptions } from './middleware/request-logger';
10
+ export { helmet, type HelmetOptions } from './middleware/helmet';
11
+ export { cors, type CorsOptions } from './middleware/cors';
12
+ export { rateLimit, type RateLimitOptions, type RateLimitStore } from './middleware/rate-limit';
13
+ export { session, type SessionOptions, type SessionStore, type SessionData, type Session, } from './middleware/session';
14
+ export { upload, cleanupFiles, resolveMimeTypes, buildUploadMiddleware, type UploadOptions, } from './middleware/upload';
15
+ export { parseQuery, parseFilters, parseSort, parsePagination, parseSearchQuery, buildQueryParams, FILTER_OPERATORS, type FilterOperator, type FilterItem, type SortItem, type PaginationParams, type ParsedQuery, type QueryFieldConfig, type QueryBuilderAdapter, type PaginatedResponse, } from './query';
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAA;AAG1F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAG1C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGjE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACtF,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAC/F,OAAO,EACL,OAAO,EACP,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,OAAO,GACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EACL,UAAU,EACV,YAAY,EACZ,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,43 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export interface CorsOptions {
3
+ /** Allowed origin(s). `true` reflects request origin, `'*'` allows all, string/regex/array for allowlist. Default: `'*'` */
4
+ origin?: boolean | string | RegExp | (string | RegExp)[];
5
+ /** Allowed HTTP methods. Default: `['GET','HEAD','PUT','PATCH','POST','DELETE']` */
6
+ methods?: string[];
7
+ /** Allowed request headers. Default: reflects `Access-Control-Request-Headers` */
8
+ allowedHeaders?: string[];
9
+ /** Headers exposed to the browser. Default: none */
10
+ exposedHeaders?: string[];
11
+ /** Allow credentials (cookies, authorization). Default: false */
12
+ credentials?: boolean;
13
+ /** Preflight cache duration in seconds. Default: 86400 (24h) */
14
+ maxAge?: number;
15
+ /** Handle preflight OPTIONS requests. Default: true */
16
+ preflight?: boolean;
17
+ }
18
+ /**
19
+ * CORS middleware with correct spec behavior.
20
+ *
21
+ * - Reflects origin from allowlist (sets `Vary: Origin`)
22
+ * - Handles preflight `OPTIONS` with `204 No Content`
23
+ * - Supports string, regex, and array origin matching
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * // Allow all origins
28
+ * bootstrap({ middleware: [cors(), express.json()] })
29
+ *
30
+ * // Allowlist specific origins
31
+ * bootstrap({
32
+ * middleware: [
33
+ * cors({
34
+ * origin: ['https://app.example.com', /\.example\.com$/],
35
+ * credentials: true,
36
+ * }),
37
+ * express.json(),
38
+ * ],
39
+ * })
40
+ * ```
41
+ */
42
+ export declare function cors(options?: CorsOptions): (req: Request, res: Response, next: NextFunction) => void;
43
+ //# sourceMappingURL=cors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cors.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/cors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,4HAA4H;IAC5H,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACxD,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,kFAAkF;IAClF,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAgBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,IAWpC,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UA4CxD"}
@@ -0,0 +1,31 @@
1
+ var u = [
2
+ "GET",
3
+ "HEAD",
4
+ "PUT",
5
+ "PATCH",
6
+ "POST",
7
+ "DELETE"
8
+ ];
9
+ function g(r, e) {
10
+ return e === !0 || e === "*" ? !0 : typeof e == "string" ? r === e : e instanceof RegExp ? e.test(r) : Array.isArray(e) ? e.some((s) => typeof s == "string" ? r === s : s.test(r)) : !1;
11
+ }
12
+ function C(r = {}) {
13
+ const { origin: e = "*", methods: s = u, allowedHeaders: d, exposedHeaders: c, credentials: a = !1, maxAge: A = 86400, preflight: f = !0 } = r;
14
+ return (o, t, H) => {
15
+ const i = o.headers.origin;
16
+ if (e === "*" && !a ? t.setHeader("Access-Control-Allow-Origin", "*") : i && g(i, e) && (t.setHeader("Access-Control-Allow-Origin", i), t.setHeader("Vary", "Origin")), a && t.setHeader("Access-Control-Allow-Credentials", "true"), c?.length && t.setHeader("Access-Control-Expose-Headers", c.join(", ")), f && o.method === "OPTIONS") {
17
+ t.setHeader("Access-Control-Allow-Methods", s.join(", "));
18
+ const n = d ?? o.headers["access-control-request-headers"];
19
+ if (n) {
20
+ const l = Array.isArray(n) ? n.join(", ") : n;
21
+ t.setHeader("Access-Control-Allow-Headers", l);
22
+ }
23
+ A && t.setHeader("Access-Control-Max-Age", String(A)), t.statusCode = 204, t.setHeader("Content-Length", "0"), t.end();
24
+ return;
25
+ }
26
+ H();
27
+ };
28
+ }
29
+ export {
30
+ C as cors
31
+ };
@@ -0,0 +1,47 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export interface CsrfOptions {
3
+ /** Cookie name for the CSRF token (default: '_csrf') */
4
+ cookie?: string;
5
+ /** Header name to check for the token (default: 'x-csrf-token') */
6
+ header?: string;
7
+ /** HTTP methods that require CSRF validation (default: POST, PUT, PATCH, DELETE) */
8
+ methods?: string[];
9
+ /** Paths to exclude from CSRF checks (e.g. webhooks) */
10
+ ignorePaths?: string[];
11
+ /** Token byte length before hex encoding (default: 32 = 64 hex chars) */
12
+ tokenLength?: number;
13
+ /** Cookie options */
14
+ cookieOptions?: {
15
+ httpOnly?: boolean;
16
+ sameSite?: 'strict' | 'lax' | 'none';
17
+ secure?: boolean;
18
+ path?: string;
19
+ };
20
+ }
21
+ /**
22
+ * Double-submit cookie CSRF protection middleware.
23
+ *
24
+ * On every request, sets a CSRF token cookie. For state-changing methods
25
+ * (POST, PUT, PATCH, DELETE), validates that the request header matches
26
+ * the cookie value.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * import { csrf } from '@forinda/kickjs-http'
31
+ *
32
+ * bootstrap({
33
+ * modules,
34
+ * middleware: [
35
+ * cookieParser(),
36
+ * csrf(),
37
+ * // ... other middleware
38
+ * ],
39
+ * })
40
+ * ```
41
+ *
42
+ * Client usage:
43
+ * 1. Read the `_csrf` cookie value
44
+ * 2. Send it in the `x-csrf-token` header on every mutating request
45
+ */
46
+ export declare function csrf(options?: CsrfOptions): (req: Request, res: Response, next: NextFunction) => void | Response<any, Record<string, any>>;
47
+ //# sourceMappingURL=csrf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csrf.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/csrf.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qBAAqB;IACrB,aAAa,CAAC,EAAE;QACd,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAA;QACpC,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,IAAI,CAAC,EAAE,MAAM,CAAA;KACd,CAAA;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,IAgBpC,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,+CA8BxD"}
@@ -0,0 +1,25 @@
1
+ import { randomBytes as d } from "node:crypto";
2
+ function f(e = {}) {
3
+ const r = e.cookie ?? "_csrf", a = e.header ?? "x-csrf-token", h = new Set((e.methods ?? [
4
+ "POST",
5
+ "PUT",
6
+ "PATCH",
7
+ "DELETE"
8
+ ]).map((t) => t.toUpperCase())), i = new Set(e.ignorePaths ?? []), k = e.tokenLength ?? 32, m = {
9
+ httpOnly: !0,
10
+ sameSite: "strict",
11
+ secure: process.env.NODE_ENV === "production",
12
+ path: "/",
13
+ ...e.cookieOptions
14
+ };
15
+ return (t, n, s) => {
16
+ let o = (t.cookies || {})[r];
17
+ if (o || (o = d(k).toString("hex"), n.cookie(r, o, m)), !h.has(t.method.toUpperCase()) || i.has(t.path)) return s();
18
+ const c = t.headers[a];
19
+ if (!c || c !== o) return n.status(403).json({ message: "CSRF token mismatch" });
20
+ s();
21
+ };
22
+ }
23
+ export {
24
+ f as csrf
25
+ };
@@ -0,0 +1,6 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ /** Catch-all for unmatched routes */
3
+ export declare function notFoundHandler(): (_req: Request, res: Response, _next: NextFunction) => void;
4
+ /** Global error handler */
5
+ export declare function errorHandler(): (err: any, req: Request, res: Response, _next: NextFunction) => Response<any, Record<string, any>> | undefined;
6
+ //# sourceMappingURL=error-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAK9D,qCAAqC;AACrC,wBAAgB,eAAe,KACrB,MAAM,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,YAAY,UAG1D;AAED,2BAA2B;AAC3B,wBAAgB,YAAY,KAClB,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,OAAO,YAAY,oDAiCnE"}
@@ -0,0 +1,37 @@
1
+ import { createLogger as i } from "../../core/logger.js";
2
+ import { HttpException as u } from "../../core/errors.js";
3
+ import "../../core-B6Okew3W.js";
4
+ var n = i("ErrorHandler");
5
+ function l() {
6
+ return (s, e, t) => {
7
+ e.status(404).json({ message: "Not Found" });
8
+ };
9
+ }
10
+ function c() {
11
+ return (s, e, t, m) => {
12
+ if (t.headersSent) {
13
+ n.warn(`Error after headers sent: ${s?.message || "Unknown"}`);
14
+ return;
15
+ }
16
+ if (s?.name === "ZodError") {
17
+ const r = s.issues?.[0];
18
+ return t.status(422).json({
19
+ message: r?.message || "Validation failed",
20
+ errors: s.issues
21
+ });
22
+ }
23
+ if (s instanceof u)
24
+ return s.status >= 500 && n.error(s, s.message), t.status(s.status).json({
25
+ message: s.message,
26
+ ...s.details ? { errors: s.details } : {}
27
+ });
28
+ const o = s.status || s.statusCode || 500;
29
+ n.error(s, `${e.method} ${e.originalUrl} — ${s.message || "Unhandled error"}`);
30
+ const a = o === 500 ? "Internal Server Error" : s.message || "Error";
31
+ t.status(o).json({ message: a });
32
+ };
33
+ }
34
+ export {
35
+ c as errorHandler,
36
+ l as notFoundHandler
37
+ };
@@ -0,0 +1,36 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export interface HelmetOptions {
3
+ /** Set Content-Security-Policy header (default: self-only policy) */
4
+ contentSecurityPolicy?: boolean | Record<string, string[]>;
5
+ /** Set X-Content-Type-Options: nosniff (default: true) */
6
+ noSniff?: boolean;
7
+ /** Set X-Frame-Options (default: 'DENY') */
8
+ frameguard?: false | 'DENY' | 'SAMEORIGIN';
9
+ /** Set Strict-Transport-Security (default: max-age=31536000; includeSubDomains) */
10
+ hsts?: false | {
11
+ maxAge?: number;
12
+ includeSubDomains?: boolean;
13
+ preload?: boolean;
14
+ };
15
+ /** Set X-DNS-Prefetch-Control (default: off) */
16
+ dnsPrefetch?: boolean;
17
+ /** Remove X-Powered-By header (default: true) */
18
+ hidePoweredBy?: boolean;
19
+ /** Set Referrer-Policy (default: 'no-referrer') */
20
+ referrerPolicy?: false | string;
21
+ /** Set X-XSS-Protection: 0 (default: true — disables legacy XSS auditor) */
22
+ xssFilter?: boolean;
23
+ }
24
+ /**
25
+ * Security headers middleware. Lightweight alternative to the `helmet` npm package
26
+ * with sensible defaults for API servers.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * bootstrap({
31
+ * middleware: [helmet(), requestId(), express.json()],
32
+ * })
33
+ * ```
34
+ */
35
+ export declare function helmet(options?: HelmetOptions): (req: Request, res: Response, next: NextFunction) => void;
36
+ //# sourceMappingURL=helmet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helmet.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/helmet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,qBAAqB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC1D,0DAA0D;IAC1D,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,YAAY,CAAA;IAC1C,mFAAmF;IACnF,IAAI,CAAC,EAAE,KAAK,GAAG;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAClF,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,mDAAmD;IACnD,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IAC/B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAAC,OAAO,GAAE,aAAkB,IAYxC,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UA4BxD"}
@@ -0,0 +1,20 @@
1
+ function S(f = {}) {
2
+ const { noSniff: a = !0, frameguard: o = "DENY", hsts: r = {
3
+ maxAge: 31536e3,
4
+ includeSubDomains: !0
5
+ }, dnsPrefetch: c = !1, hidePoweredBy: d = !0, referrerPolicy: n = "no-referrer", xssFilter: l = !0, contentSecurityPolicy: i = !1 } = f;
6
+ return (m, e, s) => {
7
+ if (d && e.removeHeader("X-Powered-By"), a && e.setHeader("X-Content-Type-Options", "nosniff"), o && e.setHeader("X-Frame-Options", o), l && e.setHeader("X-XSS-Protection", "0"), n && e.setHeader("Referrer-Policy", n), c || e.setHeader("X-DNS-Prefetch-Control", "off"), r) {
8
+ let t = `max-age=${r.maxAge ?? 31536e3}`;
9
+ r.includeSubDomains && (t += "; includeSubDomains"), r.preload && (t += "; preload"), e.setHeader("Strict-Transport-Security", t);
10
+ }
11
+ if (i) {
12
+ const t = typeof i == "object" ? Object.entries(i).map(([u, y]) => `${u} ${y.join(" ")}`).join("; ") : "default-src 'self'";
13
+ e.setHeader("Content-Security-Policy", t);
14
+ }
15
+ s();
16
+ };
17
+ }
18
+ export {
19
+ S as helmet
20
+ };
@@ -0,0 +1,51 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export interface RateLimitStore {
3
+ increment(key: string): Promise<{
4
+ totalHits: number;
5
+ resetTime: Date;
6
+ }>;
7
+ decrement(key: string): Promise<void>;
8
+ reset(key: string): Promise<void>;
9
+ }
10
+ export interface RateLimitOptions {
11
+ /** Maximum number of requests per window (default: 100) */
12
+ max?: number;
13
+ /** Time window in milliseconds (default: 60_000) */
14
+ windowMs?: number;
15
+ /** Response message when rate limit is exceeded (default: 'Too Many Requests') */
16
+ message?: string;
17
+ /** HTTP status code when rate limit is exceeded (default: 429) */
18
+ statusCode?: number;
19
+ /** Function to generate the key for rate limiting (default: req.ip) */
20
+ keyGenerator?: (req: Request) => string;
21
+ /** Whether to send rate limit headers (default: true) */
22
+ headers?: boolean;
23
+ /** Custom store implementation (default: in-memory Map) */
24
+ store?: RateLimitStore;
25
+ /** Function to skip rate limiting for certain requests */
26
+ skip?: (req: Request) => boolean;
27
+ /** Paths to exclude from rate limiting */
28
+ skipPaths?: string[];
29
+ }
30
+ /**
31
+ * Rate limiting middleware.
32
+ *
33
+ * Limits the number of requests a client can make within a time window.
34
+ * Uses an in-memory store by default, but accepts a custom store for
35
+ * distributed deployments (e.g. Redis).
36
+ *
37
+ * @example
38
+ * ```ts
39
+ * import { rateLimit } from '@forinda/kickjs-http'
40
+ *
41
+ * bootstrap({
42
+ * modules,
43
+ * middleware: [
44
+ * rateLimit({ max: 100, windowMs: 60_000 }),
45
+ * // ... other middleware
46
+ * ],
47
+ * })
48
+ * ```
49
+ */
50
+ export declare function rateLimit(options?: RateLimitOptions): (req: Request, res: Response, next: NextFunction) => Promise<void | Response<any, Record<string, any>>>;
51
+ //# sourceMappingURL=rate-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/rate-limit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAA;IACvE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uEAAuE;IACvE,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,CAAA;IACvC,yDAAyD;IACzD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAA;IAChC,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAuDD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,IAWxC,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,wDA2B9D"}
@@ -0,0 +1,46 @@
1
+ var y = class {
2
+ hits = /* @__PURE__ */ new Map();
3
+ cleanupTimer;
4
+ constructor(t) {
5
+ this.windowMs = t, this.cleanupTimer = setInterval(() => this.cleanup(), t), this.cleanupTimer.unref && this.cleanupTimer.unref();
6
+ }
7
+ async increment(t) {
8
+ const e = Date.now(), s = this.hits.get(t);
9
+ if (s && s.resetTime.getTime() > e)
10
+ return s.totalHits++, {
11
+ totalHits: s.totalHits,
12
+ resetTime: s.resetTime
13
+ };
14
+ const n = new Date(e + this.windowMs), r = {
15
+ totalHits: 1,
16
+ resetTime: n
17
+ };
18
+ return this.hits.set(t, r), {
19
+ totalHits: 1,
20
+ resetTime: n
21
+ };
22
+ }
23
+ async decrement(t) {
24
+ const e = this.hits.get(t);
25
+ e && e.totalHits > 0 && e.totalHits--;
26
+ }
27
+ async reset(t) {
28
+ this.hits.delete(t);
29
+ }
30
+ cleanup() {
31
+ const t = Date.now();
32
+ for (const [e, s] of this.hits) s.resetTime.getTime() <= t && this.hits.delete(e);
33
+ }
34
+ };
35
+ function H(t = {}) {
36
+ const e = t.max ?? 100, s = t.windowMs ?? 6e4, n = t.message ?? "Too Many Requests", r = t.statusCode ?? 429, h = t.keyGenerator ?? ((i) => i.ip ?? "127.0.0.1"), u = t.headers ?? !0, l = t.store ?? new y(s), o = t.skip, w = new Set(t.skipPaths ?? []);
37
+ return async (i, a, c) => {
38
+ if (w.has(i.path) || o && o(i)) return c();
39
+ const d = h(i), { totalHits: m, resetTime: T } = await l.increment(d), f = Math.max(0, e - m);
40
+ if (u && (a.setHeader("RateLimit-Limit", e), a.setHeader("RateLimit-Remaining", f), a.setHeader("RateLimit-Reset", Math.ceil(T.getTime() / 1e3))), m > e) return a.status(r).json({ message: n });
41
+ c();
42
+ };
43
+ }
44
+ export {
45
+ H as rateLimit
46
+ };
@@ -0,0 +1,5 @@
1
+ import type { Request, Response, NextFunction } from 'express';
2
+ export declare const REQUEST_ID_HEADER = "x-request-id";
3
+ /** Middleware that generates or propagates a unique request ID */
4
+ export declare function requestId(): (req: Request, res: Response, next: NextFunction) => void;
5
+ //# sourceMappingURL=request-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-id.d.ts","sourceRoot":"","sources":["../../../src/http/middleware/request-id.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE9D,eAAO,MAAM,iBAAiB,iBAAiB,CAAA;AAE/C,kEAAkE;AAClE,wBAAgB,SAAS,KACf,KAAK,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,UAOxD"}