@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.
- package/build/{chunk-NC6OWANS.js → chunk-5PZNIOSV.js} +3 -3
- package/build/{chunk-NC6OWANS.js.map → chunk-5PZNIOSV.js.map} +1 -1
- package/build/factories/main.js +1 -1
- package/build/index.js +1 -1
- package/build/src/server/main.d.ts +3 -3
- package/build/src/types/server.d.ts +7 -1
- package/package.json +1 -1
package/build/factories/main.js
CHANGED
package/build/index.js
CHANGED
|
@@ -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:
|
|
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:
|
|
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
|
*/
|