@adonisjs/http-server 7.0.0-3 → 7.0.0-4

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.
@@ -6,7 +6,7 @@ import {
6
6
  Router,
7
7
  Server,
8
8
  defineConfig
9
- } from "../chunk-NC6OWANS.js";
9
+ } from "../chunk-5PZNIOSV.js";
10
10
 
11
11
  // factories/http_context.ts
12
12
  import { Container } from "@adonisjs/fold";
package/build/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  defineConfig,
18
18
  exceptions_exports,
19
19
  parseRange
20
- } from "./chunk-NC6OWANS.js";
20
+ } from "./chunk-5PZNIOSV.js";
21
21
 
22
22
  // src/exception_handler.ts
23
23
  import is from "@sindresorhus/is";
@@ -1,15 +1,15 @@
1
1
  /// <reference types="node" resolution-mode="require"/>
2
2
  /// <reference types="node" resolution-mode="require"/>
3
3
  import type { Logger } from '@adonisjs/logger';
4
- import type { Emitter } from '@adonisjs/events';
5
4
  import type { Encryption } from '@adonisjs/encryption';
6
5
  import type { Server as HttpsServer } from 'node:https';
7
6
  import type { Application } from '@adonisjs/application';
7
+ import type { EmitterLike } from '@adonisjs/events/types';
8
8
  import { ContainerResolver } from '@adonisjs/fold';
9
9
  import type { ServerResponse, IncomingMessage, Server as HttpServer } from 'node:http';
10
10
  import type { LazyImport } from '../types/base.js';
11
11
  import type { MiddlewareAsClass } from '../types/middleware.js';
12
- import type { ServerConfig, ErrorHandlerAsAClass, TestingMiddlewarePipeline } from '../types/server.js';
12
+ import type { ServerConfig, HttpServerEvents, ErrorHandlerAsAClass, TestingMiddlewarePipeline } from '../types/server.js';
13
13
  import { Request } from '../request.js';
14
14
  import { Response } from '../response.js';
15
15
  import { Router } from '../router/main.js';
@@ -24,7 +24,7 @@ export declare class Server {
24
24
  * Know if async local storage is enabled or not.
25
25
  */
26
26
  get usingAsyncLocalStorage(): boolean;
27
- constructor(app: Application<any>, encryption: Encryption, emitter: Emitter<any>, logger: Logger, config: ServerConfig);
27
+ constructor(app: Application<any>, encryption: Encryption, emitter: EmitterLike<HttpServerEvents>, logger: Logger, config: ServerConfig);
28
28
  /**
29
29
  * Creates a pipeline of middleware.
30
30
  */
@@ -37,12 +37,18 @@ export type StatusPageRange = `${number}..${number}` | `${number}` | number;
37
37
  */
38
38
  export type StatusPageRenderer = (error: HttpError, ctx: HttpContext) => any | Promise<any>;
39
39
  /**
40
- * Data type for the "http:request_finished" event
40
+ * Data type for the "http:request_completed" event
41
41
  */
42
42
  export type HttpRequestFinishedPayload = {
43
43
  ctx: HttpContext;
44
44
  duration: [number, number];
45
45
  };
46
+ /**
47
+ * Events emitted by the HttpServer
48
+ */
49
+ export type HttpServerEvents = {
50
+ 'http:request_completed': HttpRequestFinishedPayload;
51
+ };
46
52
  /**
47
53
  * Error handler to handle HTTP errors
48
54
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonisjs/http-server",
3
- "version": "7.0.0-3",
3
+ "version": "7.0.0-4",
4
4
  "description": "AdonisJS HTTP server with support packed with Routing and Cookies",
5
5
  "main": "build/index.js",
6
6
  "type": "module",