@e-mc/types 0.10.1 → 0.10.2
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/LICENSE +10 -10
- package/README.md +208 -208
- package/constant.d.ts +338 -338
- package/index.d.ts +336 -336
- package/index.js +4 -4
- package/lib/asset.d.ts +76 -76
- package/lib/cloud.d.ts +106 -106
- package/lib/compat-v4.d.ts +120 -120
- package/lib/compress.d.ts +25 -25
- package/lib/core.d.ts +195 -195
- package/lib/db.d.ts +107 -109
- package/lib/document.d.ts +199 -199
- package/lib/dom.d.ts +8 -8
- package/lib/filemanager.d.ts +122 -122
- package/lib/http.d.ts +115 -115
- package/lib/index.d.ts +791 -790
- package/lib/logger.d.ts +113 -113
- package/lib/module.d.ts +129 -127
- package/lib/node.d.ts +21 -21
- package/lib/object.d.ts +29 -29
- package/lib/request.d.ts +140 -138
- package/lib/settings.d.ts +490 -490
- package/lib/squared.d.ts +339 -339
- package/lib/type.d.ts +36 -33
- package/lib/watch.d.ts +77 -77
- package/package.json +28 -28
package/lib/filemanager.d.ts
CHANGED
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
import type { BundleAction, ChecksumOutput, FileInfo, LogStatus } from './squared';
|
|
2
|
-
|
|
3
|
-
import type { IFileManager, IImage, IModule, ImageConstructor, ModuleConstructor } from './index';
|
|
4
|
-
import type { ExternalAsset } from './asset';
|
|
5
|
-
import type { HostInitLog as IHostInitLog } from './core';
|
|
6
|
-
import type { ReadHashOptions } from './module';
|
|
7
|
-
import type { RequestData as IRequestData } from './node';
|
|
8
|
-
import type { RequestInit } from './request';
|
|
9
|
-
|
|
10
|
-
import type { FETCH_TYPE } from '../index.d';
|
|
11
|
-
|
|
12
|
-
export const enum FINALIZE_STATE {
|
|
13
|
-
READY,
|
|
14
|
-
COMMIT,
|
|
15
|
-
END,
|
|
16
|
-
RESTART,
|
|
17
|
-
QUEUED,
|
|
18
|
-
RESTARTED,
|
|
19
|
-
ABORTED
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export const enum INCREMENTAL {
|
|
23
|
-
NONE = 'none',
|
|
24
|
-
STAGING = 'staging',
|
|
25
|
-
ETAG = 'etag',
|
|
26
|
-
EXISTS = 'exists'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends IRequestData<T, U>, RequestInit {
|
|
30
|
-
timeout?: ObjectMap<number | string>;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface InstallData<T extends IModule = IModule, U extends ModuleConstructor = ModuleConstructor> {
|
|
34
|
-
instance: T;
|
|
35
|
-
constructor: U;
|
|
36
|
-
params: unknown[];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface IHttpDiskCache<T extends ExternalAsset = ExternalAsset> {
|
|
40
|
-
limit: number;
|
|
41
|
-
expires: number;
|
|
42
|
-
readonly host: IFileManager<T>;
|
|
43
|
-
has(uri: string | URL): boolean;
|
|
44
|
-
add<U extends HttpDiskCacheAddOptions>(uri: string | URL, etag: string, target: string | Buffer, options?: U): void;
|
|
45
|
-
within(value: T | number): boolean;
|
|
46
|
-
clear(value?: unknown): void;
|
|
47
|
-
set enabled(value);
|
|
48
|
-
get enabled(): boolean;
|
|
49
|
-
set exclude(value);
|
|
50
|
-
get exclude(): string[];
|
|
51
|
-
set include(value);
|
|
52
|
-
get include(): string[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export interface IHttpMemoryCache<T extends ExternalAsset = ExternalAsset> extends IHttpDiskCache<T> {
|
|
56
|
-
toDisk: TupleOf<number>;
|
|
57
|
-
purge(percent?: number, limit?: number): void;
|
|
58
|
-
withinDisk(value: T | number): boolean;
|
|
59
|
-
clear(uri?: string | URL): void;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface HttpDiskCacheAddOptions {
|
|
63
|
-
buffer?: Null<Bufferable>;
|
|
64
|
-
contentLength?: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface HttpMemoryCacheAddOptions extends Omit<HttpDiskCacheAddOptions, "buffer"> {
|
|
68
|
-
toDisk?: string;
|
|
69
|
-
encoding?: BufferEncoding;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ReplaceOptions {
|
|
73
|
-
mimeType?: string;
|
|
74
|
-
rewritePath?: boolean;
|
|
75
|
-
ignoreExt?: boolean;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface AssetContentOptions extends BundleAction {
|
|
79
|
-
localUri: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface FileOutput {
|
|
83
|
-
pathname: string;
|
|
84
|
-
localUri: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export interface FinalizeResult {
|
|
88
|
-
files: FileInfo[];
|
|
89
|
-
errors: string[];
|
|
90
|
-
status?: LogStatus[];
|
|
91
|
-
aborted?: boolean;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface DeleteFileAddendum {
|
|
95
|
-
id?: number;
|
|
96
|
-
all?: boolean;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface HostInitLog extends IHostInitLog {
|
|
100
|
-
useNumeric: boolean;
|
|
101
|
-
showSize?: boolean;
|
|
102
|
-
showDiff?: string[];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
|
106
|
-
instance?: IModule;
|
|
107
|
-
assets?: T[];
|
|
108
|
-
replaced?: boolean;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface ChecksumOptions extends ReadHashOptions, Pick<ChecksumOutput, "include" | "exclude" | "recursive"> {
|
|
112
|
-
dot?: boolean;
|
|
113
|
-
sortBy?: number;
|
|
114
|
-
verbose?: boolean;
|
|
115
|
-
ignore?: string[];
|
|
116
|
-
joinRoot?: boolean;
|
|
117
|
-
outPath?: string;
|
|
118
|
-
throwsEmpty?: boolean;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export type ImageMimeMap = Map<string, InstallData<IImage, ImageConstructor>>;
|
|
122
|
-
export type FetchType = FETCH_TYPE[keyof FETCH_TYPE];
|
|
1
|
+
import type { BundleAction, ChecksumOutput, FileInfo, LogStatus } from './squared';
|
|
2
|
+
|
|
3
|
+
import type { IFileManager, IImage, IModule, ImageConstructor, ModuleConstructor } from './index';
|
|
4
|
+
import type { ExternalAsset } from './asset';
|
|
5
|
+
import type { HostInitLog as IHostInitLog } from './core';
|
|
6
|
+
import type { ReadHashOptions } from './module';
|
|
7
|
+
import type { RequestData as IRequestData } from './node';
|
|
8
|
+
import type { RequestInit } from './request';
|
|
9
|
+
|
|
10
|
+
import type { FETCH_TYPE } from '../index.d';
|
|
11
|
+
|
|
12
|
+
export const enum FINALIZE_STATE {
|
|
13
|
+
READY,
|
|
14
|
+
COMMIT,
|
|
15
|
+
END,
|
|
16
|
+
RESTART,
|
|
17
|
+
QUEUED,
|
|
18
|
+
RESTARTED,
|
|
19
|
+
ABORTED
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const enum INCREMENTAL {
|
|
23
|
+
NONE = 'none',
|
|
24
|
+
STAGING = 'staging',
|
|
25
|
+
ETAG = 'etag',
|
|
26
|
+
EXISTS = 'exists'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface RequestData<T extends ExternalAsset = ExternalAsset, U extends HostInitLog = HostInitLog> extends IRequestData<T, U>, RequestInit {
|
|
30
|
+
timeout?: ObjectMap<number | string>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface InstallData<T extends IModule = IModule, U extends ModuleConstructor = ModuleConstructor> {
|
|
34
|
+
instance: T;
|
|
35
|
+
constructor: U;
|
|
36
|
+
params: unknown[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface IHttpDiskCache<T extends ExternalAsset = ExternalAsset> {
|
|
40
|
+
limit: number;
|
|
41
|
+
expires: number;
|
|
42
|
+
readonly host: IFileManager<T>;
|
|
43
|
+
has(uri: string | URL): boolean;
|
|
44
|
+
add<U extends HttpDiskCacheAddOptions>(uri: string | URL, etag: string, target: string | Buffer, options?: U): void;
|
|
45
|
+
within(value: T | number): boolean;
|
|
46
|
+
clear(value?: unknown): void;
|
|
47
|
+
set enabled(value);
|
|
48
|
+
get enabled(): boolean;
|
|
49
|
+
set exclude(value);
|
|
50
|
+
get exclude(): string[];
|
|
51
|
+
set include(value);
|
|
52
|
+
get include(): string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface IHttpMemoryCache<T extends ExternalAsset = ExternalAsset> extends IHttpDiskCache<T> {
|
|
56
|
+
toDisk: TupleOf<number>;
|
|
57
|
+
purge(percent?: number, limit?: number): void;
|
|
58
|
+
withinDisk(value: T | number): boolean;
|
|
59
|
+
clear(uri?: string | URL): void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface HttpDiskCacheAddOptions {
|
|
63
|
+
buffer?: Null<Bufferable>;
|
|
64
|
+
contentLength?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface HttpMemoryCacheAddOptions extends Omit<HttpDiskCacheAddOptions, "buffer"> {
|
|
68
|
+
toDisk?: string;
|
|
69
|
+
encoding?: BufferEncoding;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ReplaceOptions {
|
|
73
|
+
mimeType?: string;
|
|
74
|
+
rewritePath?: boolean;
|
|
75
|
+
ignoreExt?: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AssetContentOptions extends BundleAction {
|
|
79
|
+
localUri: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface FileOutput {
|
|
83
|
+
pathname: string;
|
|
84
|
+
localUri: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface FinalizeResult {
|
|
88
|
+
files: FileInfo[];
|
|
89
|
+
errors: string[];
|
|
90
|
+
status?: LogStatus[];
|
|
91
|
+
aborted?: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export interface DeleteFileAddendum {
|
|
95
|
+
id?: number;
|
|
96
|
+
all?: boolean;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface HostInitLog extends IHostInitLog {
|
|
100
|
+
useNumeric: boolean;
|
|
101
|
+
showSize?: boolean;
|
|
102
|
+
showDiff?: string[];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface FindAssetOptions<T extends ExternalAsset = ExternalAsset> {
|
|
106
|
+
instance?: IModule;
|
|
107
|
+
assets?: T[];
|
|
108
|
+
replaced?: boolean;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface ChecksumOptions extends ReadHashOptions, Pick<ChecksumOutput, "include" | "exclude" | "recursive"> {
|
|
112
|
+
dot?: boolean;
|
|
113
|
+
sortBy?: number;
|
|
114
|
+
verbose?: boolean;
|
|
115
|
+
ignore?: string[];
|
|
116
|
+
joinRoot?: boolean;
|
|
117
|
+
outPath?: string;
|
|
118
|
+
throwsEmpty?: boolean;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export type ImageMimeMap = Map<string, InstallData<IImage, ImageConstructor>>;
|
|
122
|
+
export type FetchType = FETCH_TYPE[keyof FETCH_TYPE];
|
|
123
123
|
export type PostFinalizeCallback = (files: FileInfo[] | string[], errors: string[], status?: LogStatus[]) => void;
|
package/lib/http.d.ts
CHANGED
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import type { LookupAddress } from 'dns';
|
|
2
|
-
import type { ClientRequest, Agent as HttpAgent, OutgoingHttpHeaders } from 'http';
|
|
3
|
-
import type { Agent as HttpsAgent } from 'https';
|
|
4
|
-
import type { ClientHttp2Stream } from 'http2';
|
|
5
|
-
import type { SecureVersion } from 'tls';
|
|
6
|
-
|
|
7
|
-
export const enum HTTP_STATUS {
|
|
8
|
-
CONTINUE = 100,
|
|
9
|
-
SWITCHING_PROTOCOL = 101,
|
|
10
|
-
PROCESSING = 102,
|
|
11
|
-
EARLY_HINTS = 103,
|
|
12
|
-
OK = 200,
|
|
13
|
-
CREATED = 201,
|
|
14
|
-
ACCEPTED = 202,
|
|
15
|
-
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
16
|
-
NO_CONTENT = 204,
|
|
17
|
-
RESET_CONTENT = 205,
|
|
18
|
-
PARTIAL_CONTENT = 206,
|
|
19
|
-
MULTIPLE_CHOICES = 300,
|
|
20
|
-
MOVED_PERMANENTLY = 301,
|
|
21
|
-
FOUND = 302,
|
|
22
|
-
SEE_OTHER = 303,
|
|
23
|
-
NOT_MODIFIED = 304,
|
|
24
|
-
USE_PROXY = 305,
|
|
25
|
-
TEMPORARY_REDIRECT = 307,
|
|
26
|
-
PERMANENT_REDIRECT = 308,
|
|
27
|
-
BAD_REQUEST = 400,
|
|
28
|
-
UNAUTHORIZED = 401,
|
|
29
|
-
PAYMENT_REQUIRED = 402,
|
|
30
|
-
FORBIDDEN = 403,
|
|
31
|
-
NOT_FOUND = 404,
|
|
32
|
-
METHOD_NOT_ALLOWED = 405,
|
|
33
|
-
NOT_ACCEPTABLE = 406,
|
|
34
|
-
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
35
|
-
REQUEST_TIMEOUT = 408,
|
|
36
|
-
CONFLICT = 409,
|
|
37
|
-
GONE = 410,
|
|
38
|
-
LENGTH_REQUIRED = 411,
|
|
39
|
-
PRECONDITION_FAILED = 412,
|
|
40
|
-
PAYLOAD_TOO_LARGE = 413,
|
|
41
|
-
REQUEST_URI_TOO_LONG = 414,
|
|
42
|
-
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
43
|
-
RANGE_NOT_SATISFIABLE = 416,
|
|
44
|
-
EXPECTATION_FAILED = 417,
|
|
45
|
-
MISDIRECTED_REQUEST = 421,
|
|
46
|
-
UNPROCESSABLE_ENTITY = 422,
|
|
47
|
-
LOCKED = 423,
|
|
48
|
-
FAILED_DEPENDENCY = 424,
|
|
49
|
-
TOO_EARLY = 425,
|
|
50
|
-
UPGRADE_REQUIRED = 426,
|
|
51
|
-
PRECONDITION_REQUIRED = 428,
|
|
52
|
-
TOO_MANY_REQUESTS = 429,
|
|
53
|
-
REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
|
|
54
|
-
UNAVAILABLE_FOR_LEGAL_REASONS = 451,
|
|
55
|
-
SSL_CERTIFICATE_ERROR = 495,
|
|
56
|
-
SSL_CERTIFICATE_REQUIRED = 496,
|
|
57
|
-
CLIENT_CLOSED_REQUEST = 499,
|
|
58
|
-
INTERNAL_SERVER_ERROR = 500,
|
|
59
|
-
NOT_IMPLEMENTED = 501,
|
|
60
|
-
BAD_GATEWAY = 502,
|
|
61
|
-
SERVICE_UNAVAILABLE = 503,
|
|
62
|
-
GATEWAY_TIMEOUT = 504,
|
|
63
|
-
HTTP_VERSION_NOT_SUPPORTED = 505,
|
|
64
|
-
VARIANT_ALSO_NEGOTIATES = 506,
|
|
65
|
-
INSUFFICIENT_STORAGE = 507,
|
|
66
|
-
LOOP_DETECTED = 508,
|
|
67
|
-
BANDWIDTH_LIMIT_EXCEEDED = 509,
|
|
68
|
-
NOT_EXTENDED = 510,
|
|
69
|
-
NETWORK_AUTHENTICATION_REQUIRED = 511,
|
|
70
|
-
WEB_SERVER_IS_DOWN = 521,
|
|
71
|
-
CONNECTION_TIMED_OUT = 522,
|
|
72
|
-
ORIGIN_IS_UNREACHABLE = 523,
|
|
73
|
-
A_TIMEOUT_OCCURRED = 524,
|
|
74
|
-
SSL_HANDSHAKE_FAILED = 525,
|
|
75
|
-
INVALID_SSL_CERTIFICATE = 526
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const enum QUERY_RESULT {
|
|
79
|
-
FAIL,
|
|
80
|
-
OK,
|
|
81
|
-
TIMEOUT
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface HttpAgentSettings {
|
|
85
|
-
http?: HttpAgent;
|
|
86
|
-
https?: HttpsAgent;
|
|
87
|
-
keepAlive?: boolean;
|
|
88
|
-
timeout?: number;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export interface SecureConfig<T = string, U = T> {
|
|
92
|
-
ca?: T;
|
|
93
|
-
key?: U;
|
|
94
|
-
cert?: T;
|
|
95
|
-
passphrase?: U;
|
|
96
|
-
ciphers?: string;
|
|
97
|
-
version?: SecureVersion;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export interface ServerPort<T = number | string> {
|
|
101
|
-
port?: T;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface ServerSecure extends SecureConfig, ServerPort {}
|
|
105
|
-
|
|
106
|
-
export interface AuthValue {
|
|
107
|
-
username?: string;
|
|
108
|
-
password?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export type HttpRequestClient = ClientRequest | ClientHttp2Stream;
|
|
112
|
-
export type HttpOutgoingHeaders = ObjectMap<OutgoingHttpHeaders>;
|
|
113
|
-
export type HttpProtocolVersion = 1 | 2 | 3;
|
|
114
|
-
export type InternetProtocolVersion = 0 | 4 | 6;
|
|
115
|
-
export type LookupCallback = (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family?: number) => void;
|
|
1
|
+
import type { LookupAddress } from 'dns';
|
|
2
|
+
import type { ClientRequest, Agent as HttpAgent, OutgoingHttpHeaders } from 'http';
|
|
3
|
+
import type { Agent as HttpsAgent } from 'https';
|
|
4
|
+
import type { ClientHttp2Stream } from 'http2';
|
|
5
|
+
import type { SecureVersion } from 'tls';
|
|
6
|
+
|
|
7
|
+
export const enum HTTP_STATUS {
|
|
8
|
+
CONTINUE = 100,
|
|
9
|
+
SWITCHING_PROTOCOL = 101,
|
|
10
|
+
PROCESSING = 102,
|
|
11
|
+
EARLY_HINTS = 103,
|
|
12
|
+
OK = 200,
|
|
13
|
+
CREATED = 201,
|
|
14
|
+
ACCEPTED = 202,
|
|
15
|
+
NON_AUTHORITATIVE_INFORMATION = 203,
|
|
16
|
+
NO_CONTENT = 204,
|
|
17
|
+
RESET_CONTENT = 205,
|
|
18
|
+
PARTIAL_CONTENT = 206,
|
|
19
|
+
MULTIPLE_CHOICES = 300,
|
|
20
|
+
MOVED_PERMANENTLY = 301,
|
|
21
|
+
FOUND = 302,
|
|
22
|
+
SEE_OTHER = 303,
|
|
23
|
+
NOT_MODIFIED = 304,
|
|
24
|
+
USE_PROXY = 305,
|
|
25
|
+
TEMPORARY_REDIRECT = 307,
|
|
26
|
+
PERMANENT_REDIRECT = 308,
|
|
27
|
+
BAD_REQUEST = 400,
|
|
28
|
+
UNAUTHORIZED = 401,
|
|
29
|
+
PAYMENT_REQUIRED = 402,
|
|
30
|
+
FORBIDDEN = 403,
|
|
31
|
+
NOT_FOUND = 404,
|
|
32
|
+
METHOD_NOT_ALLOWED = 405,
|
|
33
|
+
NOT_ACCEPTABLE = 406,
|
|
34
|
+
PROXY_AUTHENTICATION_REQUIRED = 407,
|
|
35
|
+
REQUEST_TIMEOUT = 408,
|
|
36
|
+
CONFLICT = 409,
|
|
37
|
+
GONE = 410,
|
|
38
|
+
LENGTH_REQUIRED = 411,
|
|
39
|
+
PRECONDITION_FAILED = 412,
|
|
40
|
+
PAYLOAD_TOO_LARGE = 413,
|
|
41
|
+
REQUEST_URI_TOO_LONG = 414,
|
|
42
|
+
UNSUPPORTED_MEDIA_TYPE = 415,
|
|
43
|
+
RANGE_NOT_SATISFIABLE = 416,
|
|
44
|
+
EXPECTATION_FAILED = 417,
|
|
45
|
+
MISDIRECTED_REQUEST = 421,
|
|
46
|
+
UNPROCESSABLE_ENTITY = 422,
|
|
47
|
+
LOCKED = 423,
|
|
48
|
+
FAILED_DEPENDENCY = 424,
|
|
49
|
+
TOO_EARLY = 425,
|
|
50
|
+
UPGRADE_REQUIRED = 426,
|
|
51
|
+
PRECONDITION_REQUIRED = 428,
|
|
52
|
+
TOO_MANY_REQUESTS = 429,
|
|
53
|
+
REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
|
|
54
|
+
UNAVAILABLE_FOR_LEGAL_REASONS = 451,
|
|
55
|
+
SSL_CERTIFICATE_ERROR = 495,
|
|
56
|
+
SSL_CERTIFICATE_REQUIRED = 496,
|
|
57
|
+
CLIENT_CLOSED_REQUEST = 499,
|
|
58
|
+
INTERNAL_SERVER_ERROR = 500,
|
|
59
|
+
NOT_IMPLEMENTED = 501,
|
|
60
|
+
BAD_GATEWAY = 502,
|
|
61
|
+
SERVICE_UNAVAILABLE = 503,
|
|
62
|
+
GATEWAY_TIMEOUT = 504,
|
|
63
|
+
HTTP_VERSION_NOT_SUPPORTED = 505,
|
|
64
|
+
VARIANT_ALSO_NEGOTIATES = 506,
|
|
65
|
+
INSUFFICIENT_STORAGE = 507,
|
|
66
|
+
LOOP_DETECTED = 508,
|
|
67
|
+
BANDWIDTH_LIMIT_EXCEEDED = 509,
|
|
68
|
+
NOT_EXTENDED = 510,
|
|
69
|
+
NETWORK_AUTHENTICATION_REQUIRED = 511,
|
|
70
|
+
WEB_SERVER_IS_DOWN = 521,
|
|
71
|
+
CONNECTION_TIMED_OUT = 522,
|
|
72
|
+
ORIGIN_IS_UNREACHABLE = 523,
|
|
73
|
+
A_TIMEOUT_OCCURRED = 524,
|
|
74
|
+
SSL_HANDSHAKE_FAILED = 525,
|
|
75
|
+
INVALID_SSL_CERTIFICATE = 526
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const enum QUERY_RESULT {
|
|
79
|
+
FAIL,
|
|
80
|
+
OK,
|
|
81
|
+
TIMEOUT
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface HttpAgentSettings {
|
|
85
|
+
http?: HttpAgent;
|
|
86
|
+
https?: HttpsAgent;
|
|
87
|
+
keepAlive?: boolean;
|
|
88
|
+
timeout?: number;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface SecureConfig<T = string, U = T> {
|
|
92
|
+
ca?: T;
|
|
93
|
+
key?: U;
|
|
94
|
+
cert?: T;
|
|
95
|
+
passphrase?: U;
|
|
96
|
+
ciphers?: string;
|
|
97
|
+
version?: SecureVersion;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface ServerPort<T = number | string> {
|
|
101
|
+
port?: T;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface ServerSecure extends SecureConfig, ServerPort {}
|
|
105
|
+
|
|
106
|
+
export interface AuthValue {
|
|
107
|
+
username?: string;
|
|
108
|
+
password?: string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type HttpRequestClient = ClientRequest | ClientHttp2Stream;
|
|
112
|
+
export type HttpOutgoingHeaders = ObjectMap<OutgoingHttpHeaders>;
|
|
113
|
+
export type HttpProtocolVersion = 1 | 2 | 3;
|
|
114
|
+
export type InternetProtocolVersion = 0 | 4 | 6;
|
|
115
|
+
export type LookupCallback = (err: NodeJS.ErrnoException | null, address: string | LookupAddress[], family?: number) => void;
|