1 | import * as Boom from "@hapi/boom";
|
2 | import * as http from "http";
|
3 | import * as https from "https";
|
4 |
|
5 | export interface Host {
|
6 | name: string;
|
7 | port: number;
|
8 | }
|
9 |
|
10 | export interface CustomRequest {
|
11 | authorization: string;
|
12 | contentType: string;
|
13 | host: string;
|
14 | method: string;
|
15 | port: number;
|
16 | url: string;
|
17 | }
|
18 |
|
19 | export interface ParseRequestOptions {
|
20 | host?: string | undefined;
|
21 | hostHeaderName?: string | undefined;
|
22 | name?: string | undefined;
|
23 | port?: number | undefined;
|
24 | }
|
25 |
|
26 | export const version: string;
|
27 |
|
28 | export const limits: {
|
29 |
|
30 | maxMatchLength: number;
|
31 | };
|
32 |
|
33 | export function setTimeFunction(fn: () => number): void;
|
34 |
|
35 | export function now(localtimeOffsetMsec: number): number;
|
36 |
|
37 | export function nowSecs(localtimeOffsetMsec: number): number;
|
38 |
|
39 | export function parseAuthorizationHeader(header: string, keys?: string[]): Record<string, string>;
|
40 |
|
41 | export function parseContentType(header?: string): string;
|
42 |
|
43 | export function parseHost(req: http.RequestOptions | https.RequestOptions, hostHeaderName?: string): Host | null;
|
44 |
|
45 | export function parseRequest(
|
46 | req: http.RequestOptions | https.RequestOptions,
|
47 | options?: ParseRequestOptions,
|
48 | ): CustomRequest;
|
49 |
|
50 | export function unauthorized(
|
51 | message?: string,
|
52 | attributes?: string | Boom.unauthorized.Attributes,
|
53 | ): Boom.Boom & Boom.unauthorized.MissingAuth;
|