@adonisjs/http-server 8.0.0-next.12 → 8.0.0-next.13

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/build/index.js CHANGED
@@ -1,378 +1,160 @@
1
- import {
2
- CookieClient,
3
- CookieParser,
4
- CookieSerializer,
5
- E_CANNOT_LOOKUP_ROUTE,
6
- E_HTTP_EXCEPTION,
7
- E_HTTP_REQUEST_ABORTED,
8
- E_ROUTE_NOT_FOUND,
9
- HttpContext,
10
- Qs,
11
- Redirect,
12
- Request,
13
- Response,
14
- ResponseStatus,
15
- Router,
16
- Server,
17
- defineConfig,
18
- errors_exports
19
- } from "./chunk-L2UOVWDK.js";
20
- import {
21
- BriskRoute,
22
- Route,
23
- RouteGroup,
24
- RouteResource,
25
- canWriteResponseBody,
26
- parseRange,
27
- tracing_channels_exports
28
- } from "./chunk-QDK57QGB.js";
29
- import "./chunk-77CSRFCU.js";
30
- import "./chunk-2QM3D5BN.js";
31
-
32
- // src/exception_handler.ts
33
- import is from "@sindresorhus/is";
1
+ import { C as canWriteResponseBody, S as tracing_channels_exports, _ as Route, g as BriskRoute, h as RouteResource, m as RouteGroup, u as parseRange } from "./helpers-Dt-25M21.js";
2
+ import { _ as Qs, a as CookieSerializer, c as HttpRequest, d as Redirect, f as E_CANNOT_LOOKUP_ROUTE, g as errors_exports, h as E_ROUTE_NOT_FOUND, i as HttpResponse, l as CookieParser, m as E_HTTP_REQUEST_ABORTED, n as Server, o as ResponseStatus, p as E_HTTP_EXCEPTION, r as HttpContext, s as Router, t as defineConfig, u as CookieClient } from "./define_config-DpDqx7A4.js";
3
+ import "./helpers-C_2HouOe.js";
4
+ import "./url_builder-piNQy-CF.js";
34
5
  import Macroable from "@poppinss/macroable";
6
+ import is from "@sindresorhus/is";
35
7
  var ExceptionHandler = class extends Macroable {
36
- /**
37
- * Cached expanded status pages mapping individual status codes to their renderers
38
- * Computed from the statusPages property when first accessed
39
- */
40
- #expandedStatusPages;
41
- /**
42
- * Controls whether to include debug information in error responses
43
- * When enabled, errors include complete stack traces and detailed debugging info
44
- * Defaults to true in non-production environments
45
- */
46
- debug = process.env.NODE_ENV !== "production";
47
- /**
48
- * Controls whether to render custom status pages for unhandled errors
49
- * When enabled, errors with matching status codes use configured status page renderers
50
- * Defaults to true in production environments
51
- */
52
- renderStatusPages = process.env.NODE_ENV === "production";
53
- /**
54
- * Mapping of HTTP status code ranges to their corresponding page renderers
55
- * Supports ranges like '400-499' or individual codes like '404'
56
- */
57
- statusPages = {};
58
- /**
59
- * Controls whether errors should be reported to logging systems
60
- * When disabled, errors are handled but not logged or reported
61
- */
62
- reportErrors = true;
63
- /**
64
- * Array of exception class constructors to exclude from error reporting
65
- * These exceptions are handled but not logged or reported to external systems
66
- */
67
- ignoreExceptions = [
68
- E_HTTP_EXCEPTION,
69
- E_ROUTE_NOT_FOUND,
70
- E_CANNOT_LOOKUP_ROUTE,
71
- E_HTTP_REQUEST_ABORTED
72
- ];
73
- /**
74
- * Array of HTTP status codes to exclude from error reporting
75
- * Errors with these status codes are handled but not logged
76
- */
77
- ignoreStatuses = [400, 422, 401];
78
- /**
79
- * Array of custom error codes to exclude from error reporting
80
- * Errors with these codes are handled but not logged
81
- */
82
- ignoreCodes = [];
83
- /**
84
- * Expands status page ranges into individual status code mappings
85
- * Creates a cached lookup table for faster status page resolution
86
- * @returns Mapping of status codes to renderers
87
- */
88
- #expandStatusPages() {
89
- if (!this.#expandedStatusPages) {
90
- this.#expandedStatusPages = Object.keys(this.statusPages).reduce(
91
- (result, range) => {
92
- const renderer = this.statusPages[range];
93
- result = Object.assign(result, parseRange(range, renderer));
94
- return result;
95
- },
96
- {}
97
- );
98
- }
99
- return this.#expandedStatusPages;
100
- }
101
- /**
102
- * Normalizes any thrown value into a standardized HttpError object
103
- * Ensures the error has required properties like message and status
104
- * @param error - Any thrown value (Error, string, object, etc.)
105
- * @returns {HttpError} Normalized error object with status and message
106
- */
107
- #toHttpError(error) {
108
- const httpError = is.object(error) ? error : new Error(String(error));
109
- if (!httpError.message) {
110
- httpError.message = "Internal server error";
111
- }
112
- if (!httpError.status) {
113
- httpError.status = 500;
114
- }
115
- return httpError;
116
- }
117
- /**
118
- * Provides additional context information for error reporting
119
- * Includes request ID when available for correlation across logs
120
- * @param ctx - HTTP context containing request information
121
- * @returns Additional context data for error reporting
122
- */
123
- context(ctx) {
124
- const requestId = ctx.request.id();
125
- return requestId ? {
126
- "x-request-id": requestId
127
- } : {};
128
- }
129
- /**
130
- * Determines the appropriate log level based on HTTP status code
131
- * 5xx errors are logged as 'error', 4xx as 'warn', others as 'info'
132
- * @param error - HTTP error object with status code
133
- * @returns {Level} Appropriate logging level for the error
134
- */
135
- getErrorLogLevel(error) {
136
- if (error.status >= 500) {
137
- return "error";
138
- }
139
- if (error.status >= 400) {
140
- return "warn";
141
- }
142
- return "info";
143
- }
144
- /**
145
- * Determines whether debug information should be included in error responses
146
- * Override this method to implement context-specific debug control
147
- * @param _ - HTTP context (unused in base implementation)
148
- * @returns {boolean} True if debugging should be enabled
149
- */
150
- isDebuggingEnabled(_) {
151
- return this.debug;
152
- }
153
- /**
154
- * Determines whether an error should be reported to logging systems
155
- * Checks against ignore lists for exceptions, status codes, and error codes
156
- * @param error - HTTP error to evaluate for reporting
157
- * @returns {boolean} True if the error should be reported
158
- */
159
- shouldReport(error) {
160
- if (this.reportErrors === false) {
161
- return false;
162
- }
163
- if (this.ignoreStatuses.includes(error.status)) {
164
- return false;
165
- }
166
- if (error.code && this.ignoreCodes.includes(error.code)) {
167
- return false;
168
- }
169
- if (this.ignoreExceptions.find((exception) => error instanceof exception)) {
170
- return false;
171
- }
172
- return true;
173
- }
174
- /**
175
- * Renders an error as a JSON response
176
- * In debug mode, includes full stack trace using Youch
177
- * @param error - HTTP error to render
178
- * @param ctx - HTTP context for the request
179
- */
180
- async renderErrorAsJSON(error, ctx) {
181
- if (this.isDebuggingEnabled(ctx)) {
182
- const { Youch } = await import("youch");
183
- const json = await new Youch().toJSON(error);
184
- ctx.response.status(error.status).send(json);
185
- return;
186
- }
187
- ctx.response.status(error.status).send({ message: error.message });
188
- }
189
- /**
190
- * Renders an error as a JSON API compliant response
191
- * Follows JSON API specification for error objects
192
- * @param error - HTTP error to render
193
- * @param ctx - HTTP context for the request
194
- */
195
- async renderErrorAsJSONAPI(error, ctx) {
196
- if (this.isDebuggingEnabled(ctx)) {
197
- const { Youch } = await import("youch");
198
- const json = await new Youch().toJSON(error);
199
- ctx.response.status(error.status).send(json);
200
- return;
201
- }
202
- ctx.response.status(error.status).send({
203
- errors: [
204
- {
205
- title: error.message,
206
- code: error.code,
207
- status: error.status
208
- }
209
- ]
210
- });
211
- }
212
- /**
213
- * Renders an error as an HTML response
214
- * Uses status pages if configured, otherwise shows debug info or simple message
215
- * @param error - HTTP error to render
216
- * @param ctx - HTTP context for the request
217
- */
218
- async renderErrorAsHTML(error, ctx) {
219
- const statusPages = this.#expandStatusPages();
220
- if (this.renderStatusPages && statusPages[error.status]) {
221
- const statusPageResponse = await statusPages[error.status](error, ctx);
222
- if (canWriteResponseBody(statusPageResponse, ctx)) {
223
- return ctx.response.safeStatus(error.status).send(statusPageResponse);
224
- }
225
- return statusPageResponse;
226
- }
227
- if (this.isDebuggingEnabled(ctx)) {
228
- const { Youch } = await import("youch");
229
- const html = await new Youch().toHTML(error, {
230
- request: ctx.request.request,
231
- cspNonce: "nonce" in ctx.response ? ctx.response.nonce : void 0
232
- });
233
- ctx.response.status(error.status).send(html);
234
- return;
235
- }
236
- ctx.response.status(error.status).send(`<p> ${error.message} </p>`);
237
- }
238
- /**
239
- * Renders validation error messages as a JSON response
240
- * Returns errors in a simple format with field-specific messages
241
- * @param error - Validation error containing messages array
242
- * @param ctx - HTTP context for the request
243
- */
244
- async renderValidationErrorAsJSON(error, ctx) {
245
- ctx.response.status(error.status).send({
246
- errors: error.messages
247
- });
248
- }
249
- /**
250
- * Renders validation error messages as JSON API compliant response
251
- * Transforms validation messages to JSON API error object format
252
- * @param error - Validation error containing messages array
253
- * @param ctx - HTTP context for the request
254
- */
255
- async renderValidationErrorAsJSONAPI(error, ctx) {
256
- ctx.response.status(error.status).send({
257
- errors: error.messages.map((message) => {
258
- return {
259
- title: message.message,
260
- code: message.rule,
261
- source: {
262
- pointer: message.field
263
- },
264
- meta: message.meta
265
- };
266
- })
267
- });
268
- }
269
- /**
270
- * Renders validation error messages as an HTML response
271
- * Creates simple HTML list of field errors separated by line breaks
272
- * @param error - Validation error containing messages array
273
- * @param ctx - HTTP context for the request
274
- */
275
- async renderValidationErrorAsHTML(error, ctx) {
276
- ctx.response.status(error.status).type("html").send(
277
- error.messages.map((message) => {
278
- return `${message.field} - ${message.message}`;
279
- }).join("<br />")
280
- );
281
- }
282
- /**
283
- * Renders an error to the appropriate response format based on content negotiation
284
- * Supports HTML, JSON API, and JSON formats based on Accept headers
285
- * @param error - HTTP error to render
286
- * @param ctx - HTTP context for the request
287
- */
288
- renderError(error, ctx) {
289
- switch (ctx.request.accepts(["html", "application/vnd.api+json", "json"])) {
290
- case "application/vnd.api+json":
291
- return this.renderErrorAsJSONAPI(error, ctx);
292
- case "json":
293
- return this.renderErrorAsJSON(error, ctx);
294
- case "html":
295
- default:
296
- return this.renderErrorAsHTML(error, ctx);
297
- }
298
- }
299
- /**
300
- * Renders validation errors to the appropriate response format based on content negotiation
301
- * Supports HTML, JSON API, and JSON formats for validation error messages
302
- * @param error - Validation error to render
303
- * @param ctx - HTTP context for the request
304
- */
305
- renderValidationError(error, ctx) {
306
- switch (ctx.request.accepts(["html", "application/vnd.api+json", "json"])) {
307
- case "application/vnd.api+json":
308
- return this.renderValidationErrorAsJSONAPI(error, ctx);
309
- case "json":
310
- return this.renderValidationErrorAsJSON(error, ctx);
311
- case "html":
312
- default:
313
- return this.renderValidationErrorAsHTML(error, ctx);
314
- }
315
- }
316
- /**
317
- * Reports an error to logging systems if reporting is enabled
318
- * Allows errors to self-report via their own report method if available
319
- * @param error - Any error object to report
320
- * @param ctx - HTTP context for additional reporting context
321
- */
322
- async report(error, ctx) {
323
- const httpError = this.#toHttpError(error);
324
- if (!this.shouldReport(httpError)) {
325
- return;
326
- }
327
- if (typeof httpError.report === "function") {
328
- httpError.report(httpError, ctx);
329
- return;
330
- }
331
- const level = this.getErrorLogLevel(httpError);
332
- ctx.logger.log(
333
- level,
334
- {
335
- ...level === "error" || level === "fatal" ? { err: httpError } : {},
336
- ...this.context(ctx)
337
- },
338
- httpError.message
339
- );
340
- }
341
- /**
342
- * Handles errors during HTTP request processing
343
- * Delegates to error's own handle method if available, otherwise renders response
344
- * @param error - Any error object to handle
345
- * @param ctx - HTTP context for error handling
346
- */
347
- async handle(error, ctx) {
348
- const httpError = this.#toHttpError(error);
349
- if (typeof httpError.handle === "function") {
350
- return httpError.handle(httpError, ctx);
351
- }
352
- if (httpError.code === "E_VALIDATION_ERROR" && "messages" in httpError) {
353
- return this.renderValidationError(httpError, ctx);
354
- }
355
- return this.renderError(httpError, ctx);
356
- }
357
- };
358
- export {
359
- BriskRoute,
360
- CookieClient,
361
- CookieParser,
362
- CookieSerializer,
363
- ExceptionHandler,
364
- HttpContext,
365
- Qs,
366
- Redirect,
367
- Request,
368
- Response,
369
- ResponseStatus,
370
- Route,
371
- RouteGroup,
372
- RouteResource,
373
- Router,
374
- Server,
375
- defineConfig,
376
- errors_exports as errors,
377
- tracing_channels_exports as tracingChannels
8
+ #expandedStatusPages;
9
+ debug = process.env.NODE_ENV !== "production";
10
+ renderStatusPages = process.env.NODE_ENV === "production";
11
+ statusPages = {};
12
+ reportErrors = true;
13
+ ignoreExceptions = [
14
+ E_HTTP_EXCEPTION,
15
+ E_ROUTE_NOT_FOUND,
16
+ E_CANNOT_LOOKUP_ROUTE,
17
+ E_HTTP_REQUEST_ABORTED
18
+ ];
19
+ ignoreStatuses = [
20
+ 400,
21
+ 422,
22
+ 401
23
+ ];
24
+ ignoreCodes = [];
25
+ #expandStatusPages() {
26
+ if (!this.#expandedStatusPages) this.#expandedStatusPages = Object.keys(this.statusPages).reduce((result, range) => {
27
+ const renderer = this.statusPages[range];
28
+ result = Object.assign(result, parseRange(range, renderer));
29
+ return result;
30
+ }, {});
31
+ return this.#expandedStatusPages;
32
+ }
33
+ toHttpError(error) {
34
+ const httpError = is.object(error) ? error : new Error(String(error));
35
+ if (!httpError.message) httpError.message = "Internal server error";
36
+ if (!httpError.status) httpError.status = 500;
37
+ return httpError;
38
+ }
39
+ context(ctx) {
40
+ const requestId = ctx.request.id();
41
+ return requestId ? { "x-request-id": requestId } : {};
42
+ }
43
+ getErrorLogLevel(error) {
44
+ if (error.status >= 500) return "error";
45
+ if (error.status >= 400) return "warn";
46
+ return "info";
47
+ }
48
+ isDebuggingEnabled(_) {
49
+ return this.debug;
50
+ }
51
+ shouldReport(error) {
52
+ if (this.reportErrors === false) return false;
53
+ if (this.ignoreStatuses.includes(error.status)) return false;
54
+ if (error.code && this.ignoreCodes.includes(error.code)) return false;
55
+ if (this.ignoreExceptions.find((exception) => error instanceof exception)) return false;
56
+ return true;
57
+ }
58
+ async renderErrorAsJSON(error, ctx) {
59
+ if (this.isDebuggingEnabled(ctx)) {
60
+ const { Youch } = await import("youch");
61
+ const json = await new Youch().toJSON(error);
62
+ ctx.response.status(error.status).send(json);
63
+ return;
64
+ }
65
+ ctx.response.status(error.status).send({ message: error.message });
66
+ }
67
+ async renderErrorAsJSONAPI(error, ctx) {
68
+ if (this.isDebuggingEnabled(ctx)) {
69
+ const { Youch } = await import("youch");
70
+ const json = await new Youch().toJSON(error);
71
+ ctx.response.status(error.status).send(json);
72
+ return;
73
+ }
74
+ ctx.response.status(error.status).send({ errors: [{
75
+ title: error.message,
76
+ code: error.code,
77
+ status: error.status
78
+ }] });
79
+ }
80
+ async renderErrorAsHTML(error, ctx) {
81
+ const statusPages = this.#expandStatusPages();
82
+ if (this.renderStatusPages && statusPages[error.status]) {
83
+ const statusPageResponse = await statusPages[error.status](error, ctx);
84
+ if (canWriteResponseBody(statusPageResponse, ctx)) return ctx.response.safeStatus(error.status).send(statusPageResponse);
85
+ return statusPageResponse;
86
+ }
87
+ if (this.isDebuggingEnabled(ctx)) {
88
+ const { Youch } = await import("youch");
89
+ const html = await new Youch().toHTML(error, {
90
+ request: ctx.request.request,
91
+ cspNonce: "nonce" in ctx.response ? ctx.response.nonce : void 0
92
+ });
93
+ ctx.response.status(error.status).send(html);
94
+ return;
95
+ }
96
+ ctx.response.status(error.status).send(`<p> ${error.message} </p>`);
97
+ }
98
+ async renderValidationErrorAsJSON(error, ctx) {
99
+ ctx.response.status(error.status).send({ errors: error.messages });
100
+ }
101
+ async renderValidationErrorAsJSONAPI(error, ctx) {
102
+ ctx.response.status(error.status).send({ errors: error.messages.map((message) => {
103
+ return {
104
+ title: message.message,
105
+ code: message.rule,
106
+ source: { pointer: message.field },
107
+ meta: message.meta
108
+ };
109
+ }) });
110
+ }
111
+ async renderValidationErrorAsHTML(error, ctx) {
112
+ ctx.response.status(error.status).type("html").send(error.messages.map((message) => {
113
+ return `${message.field} - ${message.message}`;
114
+ }).join("<br />"));
115
+ }
116
+ renderError(error, ctx) {
117
+ switch (ctx.request.accepts([
118
+ "html",
119
+ "application/vnd.api+json",
120
+ "json"
121
+ ])) {
122
+ case "application/vnd.api+json": return this.renderErrorAsJSONAPI(error, ctx);
123
+ case "json": return this.renderErrorAsJSON(error, ctx);
124
+ case "html":
125
+ default: return this.renderErrorAsHTML(error, ctx);
126
+ }
127
+ }
128
+ renderValidationError(error, ctx) {
129
+ switch (ctx.request.accepts([
130
+ "html",
131
+ "application/vnd.api+json",
132
+ "json"
133
+ ])) {
134
+ case "application/vnd.api+json": return this.renderValidationErrorAsJSONAPI(error, ctx);
135
+ case "json": return this.renderValidationErrorAsJSON(error, ctx);
136
+ case "html":
137
+ default: return this.renderValidationErrorAsHTML(error, ctx);
138
+ }
139
+ }
140
+ async report(error, ctx) {
141
+ const httpError = this.toHttpError(error);
142
+ if (!this.shouldReport(httpError)) return;
143
+ if (typeof httpError.report === "function") {
144
+ httpError.report(httpError, ctx);
145
+ return;
146
+ }
147
+ const level = this.getErrorLogLevel(httpError);
148
+ ctx.logger.log(level, {
149
+ ...level === "error" || level === "fatal" ? { err: httpError } : {},
150
+ ...this.context(ctx)
151
+ }, httpError.message);
152
+ }
153
+ async handle(error, ctx) {
154
+ const httpError = this.toHttpError(error);
155
+ if (typeof httpError.handle === "function") return httpError.handle(httpError, ctx);
156
+ if (httpError.code === "E_VALIDATION_ERROR" && "messages" in httpError) return this.renderValidationError(httpError, ctx);
157
+ return this.renderError(httpError, ctx);
158
+ }
378
159
  };
160
+ export { BriskRoute, CookieClient, CookieParser, CookieSerializer, ExceptionHandler, HttpContext, HttpRequest, HttpResponse, Qs, Redirect, ResponseStatus, Route, RouteGroup, RouteResource, Router, Server, defineConfig, errors_exports as errors, tracing_channels_exports as tracingChannels };
@@ -1,12 +1,3 @@
1
- import {
2
- createUrlBuilder
3
- } from "../../chunk-77CSRFCU.js";
4
- import {
5
- createURL,
6
- findRoute
7
- } from "../../chunk-2QM3D5BN.js";
8
- export {
9
- createURL,
10
- createUrlBuilder,
11
- findRoute
12
- };
1
+ import { n as findRoute, t as createURL } from "../../helpers-C_2HouOe.js";
2
+ import { t as createUrlBuilder } from "../../url_builder-piNQy-CF.js";
3
+ export { createURL, createUrlBuilder, findRoute };
@@ -66,6 +66,13 @@ export declare class ExceptionHandler extends Macroable {
66
66
  * Errors with these codes are handled but not logged
67
67
  */
68
68
  protected ignoreCodes: string[];
69
+ /**
70
+ * Normalizes any thrown value into a standardized HttpError object
71
+ * Ensures the error has required properties like message and status
72
+ * @param error - Any thrown value (Error, string, object, etc.)
73
+ * @returns {HttpError} Normalized error object with status and message
74
+ */
75
+ protected toHttpError(error: unknown): HttpError;
69
76
  /**
70
77
  * Provides additional context information for error reporting
71
78
  * Includes request ID when available for correlation across logs
@@ -1,26 +1,3 @@
1
- import {
2
- appendQueryString,
3
- createSignedURL,
4
- default as default2,
5
- default2 as default3,
6
- matchRoute,
7
- middlewareInfo,
8
- parseRoute,
9
- routeInfo,
10
- serializeCookie
11
- } from "../chunk-QDK57QGB.js";
12
- import {
13
- createURL
14
- } from "../chunk-2QM3D5BN.js";
15
- export {
16
- appendQueryString,
17
- createSignedURL,
18
- createURL,
19
- default2 as encodeUrl,
20
- matchRoute,
21
- middlewareInfo,
22
- default3 as mime,
23
- parseRoute,
24
- routeInfo,
25
- serializeCookie
26
- };
1
+ import { a as middlewareInfo, c as routeInfo, i as matchRoute, l as serializeCookie, n as createSignedURL, o as mime, r as encodeUrl, s as parseRoute, t as appendQueryString } from "../helpers-Dt-25M21.js";
2
+ import { t as createURL } from "../helpers-C_2HouOe.js";
3
+ export { appendQueryString, createSignedURL, createURL, encodeUrl, matchRoute, middlewareInfo, mime, parseRoute, routeInfo, serializeCookie };
@@ -1,8 +1,8 @@
1
1
  import Macroable from '@poppinss/macroable';
2
2
  import type { Logger } from '@adonisjs/logger';
3
3
  import { type ContainerResolver } from '@adonisjs/fold';
4
- import type { Request } from '../request.ts';
5
- import type { Response } from '../response.ts';
4
+ import type { HttpRequest } from '../request.ts';
5
+ import type { HttpResponse } from '../response.ts';
6
6
  import type { RouteJSON } from '../types/route.ts';
7
7
  /**
8
8
  * HTTP context encapsulates all properties and services for a given HTTP request.
@@ -23,8 +23,8 @@ import type { RouteJSON } from '../types/route.ts';
23
23
  * ```
24
24
  */
25
25
  export declare class HttpContext extends Macroable {
26
- request: Request;
27
- response: Response;
26
+ request: HttpRequest;
27
+ response: HttpResponse;
28
28
  logger: Logger;
29
29
  containerResolver: ContainerResolver<any>;
30
30
  /**
@@ -103,12 +103,12 @@ export declare class HttpContext extends Macroable {
103
103
  /**
104
104
  * Creates a new HttpContext instance
105
105
  *
106
- * @param {Request} request - The HTTP request instance
107
- * @param {Response} response - The HTTP response instance
106
+ * @param {HttpRequest} request - The HTTP request instance
107
+ * @param {HttpResponse} response - The HTTP response instance
108
108
  * @param {Logger} logger - The logger instance
109
109
  * @param {ContainerResolver<any>} containerResolver - The IoC container resolver
110
110
  */
111
- constructor(request: Request, response: Response, logger: Logger, containerResolver: ContainerResolver<any>);
111
+ constructor(request: HttpRequest, response: HttpResponse, logger: Logger, containerResolver: ContainerResolver<any>);
112
112
  /**
113
113
  * A helper to see top level properties on the context object
114
114
  */
@@ -1,7 +1,7 @@
1
1
  import type { IncomingMessage } from 'node:http';
2
2
  import type { Qs } from './qs.ts';
3
- import type { Response } from './response.ts';
4
3
  import type { Router } from './router/main.ts';
4
+ import type { HttpResponse } from './response.ts';
5
5
  import type { RoutesList, LookupList, URLOptions, GetRoutesForMethod, RouteBuilderArguments } from './types/url_builder.ts';
6
6
  /**
7
7
  * Provides a fluent API for constructing HTTP redirect responses.
@@ -34,7 +34,7 @@ export declare class Redirect {
34
34
  * @param router - AdonisJS router instance
35
35
  * @param qs - Query string parser instance
36
36
  */
37
- constructor(request: IncomingMessage, response: Response, router: Router, qs: Qs);
37
+ constructor(request: IncomingMessage, response: HttpResponse, router: Router, qs: Qs);
38
38
  /**
39
39
  * Sets a custom HTTP status code for the redirect response
40
40
  * @param statusCode - HTTP status code to use (e.g., 301, 302, 307)
@@ -13,7 +13,7 @@ import type { HttpContext } from './http_context/main.ts';
13
13
  * You can access the original [IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage)
14
14
  * using `request.request` property.
15
15
  */
16
- export declare class Request extends Macroable {
16
+ export declare class HttpRequest extends Macroable {
17
17
  #private;
18
18
  /** Native Node.js incoming message instance */
19
19
  request: IncomingMessage;