@emulsify/cli 1.10.1 → 1.11.0
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/README.md +16 -7
- package/dist/node_modules/.package-lock.json +48 -17
- package/dist/node_modules/@types/node/README.md +1 -1
- package/dist/node_modules/@types/node/buffer.d.ts +12 -0
- package/dist/node_modules/@types/node/inspector.d.ts +1061 -111
- package/dist/node_modules/@types/node/package.json +3 -3
- package/dist/node_modules/@types/node/perf_hooks.d.ts +30 -1
- package/dist/node_modules/@types/node/process.d.ts +142 -17
- package/dist/node_modules/@types/node/test.d.ts +232 -86
- package/dist/node_modules/@types/node/util.d.ts +6 -0
- package/dist/node_modules/@types/node/zlib.d.ts +9 -0
- package/dist/node_modules/undici-types/LICENSE +21 -0
- package/dist/node_modules/undici-types/balanced-pool.d.ts +11 -0
- package/dist/node_modules/undici-types/client.d.ts +12 -1
- package/dist/node_modules/undici-types/diagnostics-channel.d.ts +1 -2
- package/dist/node_modules/undici-types/dispatcher.d.ts +18 -4
- package/dist/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/dist/node_modules/undici-types/errors.d.ts +21 -0
- package/dist/node_modules/undici-types/eventsource.d.ts +63 -0
- package/dist/node_modules/undici-types/fetch.d.ts +25 -25
- package/dist/node_modules/undici-types/formdata.d.ts +1 -1
- package/dist/node_modules/undici-types/handlers.d.ts +10 -4
- package/dist/node_modules/undici-types/index.d.ts +10 -2
- package/dist/node_modules/undici-types/interceptors.d.ts +12 -2
- package/dist/node_modules/undici-types/mock-interceptor.d.ts +4 -4
- package/dist/node_modules/undici-types/package.json +1 -1
- package/dist/node_modules/undici-types/pool.d.ts +11 -0
- package/dist/node_modules/undici-types/proxy-agent.d.ts +0 -2
- package/dist/node_modules/undici-types/readable.d.ts +2 -3
- package/dist/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/dist/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/dist/node_modules/undici-types/util.d.ts +18 -0
- package/dist/node_modules/undici-types/webidl.d.ts +10 -8
- package/dist/node_modules/undici-types/websocket.d.ts +22 -1
- package/dist/package-lock.json +1219 -347
- package/dist/package.json +1 -1
- package/dist/util/system/getAvailableSystems.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import Dispatcher from "./dispatcher";
|
|
2
|
+
|
|
3
|
+
export default RetryHandler;
|
|
4
|
+
|
|
5
|
+
declare class RetryHandler implements Dispatcher.DispatchHandlers {
|
|
6
|
+
constructor(
|
|
7
|
+
options: Dispatcher.DispatchOptions & {
|
|
8
|
+
retryOptions?: RetryHandler.RetryOptions;
|
|
9
|
+
},
|
|
10
|
+
retryHandlers: RetryHandler.RetryHandlers
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare namespace RetryHandler {
|
|
15
|
+
export type RetryState = { counter: number; };
|
|
16
|
+
|
|
17
|
+
export type RetryContext = {
|
|
18
|
+
state: RetryState;
|
|
19
|
+
opts: Dispatcher.DispatchOptions & {
|
|
20
|
+
retryOptions?: RetryHandler.RetryOptions;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type OnRetryCallback = (result?: Error | null) => void;
|
|
25
|
+
|
|
26
|
+
export type RetryCallback = (
|
|
27
|
+
err: Error,
|
|
28
|
+
context: {
|
|
29
|
+
state: RetryState;
|
|
30
|
+
opts: Dispatcher.DispatchOptions & {
|
|
31
|
+
retryOptions?: RetryHandler.RetryOptions;
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
callback: OnRetryCallback
|
|
35
|
+
) => number | null;
|
|
36
|
+
|
|
37
|
+
export interface RetryOptions {
|
|
38
|
+
/**
|
|
39
|
+
* Callback to be invoked on every retry iteration.
|
|
40
|
+
* It receives the error, current state of the retry object and the options object
|
|
41
|
+
* passed when instantiating the retry handler.
|
|
42
|
+
*
|
|
43
|
+
* @type {RetryCallback}
|
|
44
|
+
* @memberof RetryOptions
|
|
45
|
+
*/
|
|
46
|
+
retry?: RetryCallback;
|
|
47
|
+
/**
|
|
48
|
+
* Maximum number of retries to allow.
|
|
49
|
+
*
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof RetryOptions
|
|
52
|
+
* @default 5
|
|
53
|
+
*/
|
|
54
|
+
maxRetries?: number;
|
|
55
|
+
/**
|
|
56
|
+
* Max number of milliseconds allow between retries
|
|
57
|
+
*
|
|
58
|
+
* @type {number}
|
|
59
|
+
* @memberof RetryOptions
|
|
60
|
+
* @default 30000
|
|
61
|
+
*/
|
|
62
|
+
maxTimeout?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Initial number of milliseconds to wait before retrying for the first time.
|
|
65
|
+
*
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @memberof RetryOptions
|
|
68
|
+
* @default 500
|
|
69
|
+
*/
|
|
70
|
+
minTimeout?: number;
|
|
71
|
+
/**
|
|
72
|
+
* Factior to multiply the timeout factor between retries.
|
|
73
|
+
*
|
|
74
|
+
* @type {number}
|
|
75
|
+
* @memberof RetryOptions
|
|
76
|
+
* @default 2
|
|
77
|
+
*/
|
|
78
|
+
timeoutFactor?: number;
|
|
79
|
+
/**
|
|
80
|
+
* It enables to automatically infer timeout between retries based on the `Retry-After` header.
|
|
81
|
+
*
|
|
82
|
+
* @type {boolean}
|
|
83
|
+
* @memberof RetryOptions
|
|
84
|
+
* @default true
|
|
85
|
+
*/
|
|
86
|
+
retryAfter?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* HTTP methods to retry.
|
|
89
|
+
*
|
|
90
|
+
* @type {Dispatcher.HttpMethod[]}
|
|
91
|
+
* @memberof RetryOptions
|
|
92
|
+
* @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
|
|
93
|
+
*/
|
|
94
|
+
methods?: Dispatcher.HttpMethod[];
|
|
95
|
+
/**
|
|
96
|
+
* Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
|
|
97
|
+
*
|
|
98
|
+
* @type {string[]}
|
|
99
|
+
* @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
|
|
100
|
+
*/
|
|
101
|
+
errorCodes?: string[];
|
|
102
|
+
/**
|
|
103
|
+
* HTTP status codes to be retried.
|
|
104
|
+
*
|
|
105
|
+
* @type {number[]}
|
|
106
|
+
* @memberof RetryOptions
|
|
107
|
+
* @default [500, 502, 503, 504, 429],
|
|
108
|
+
*/
|
|
109
|
+
statusCodes?: number[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface RetryHandlers {
|
|
113
|
+
dispatch: Dispatcher["dispatch"];
|
|
114
|
+
handler: Dispatcher.DispatchHandlers;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export namespace util {
|
|
2
|
+
/**
|
|
3
|
+
* Retrieves a header name and returns its lowercase value.
|
|
4
|
+
* @param value Header name
|
|
5
|
+
*/
|
|
6
|
+
export function headerNameToString(value: string | Buffer): string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Receives a header object and returns the parsed value.
|
|
10
|
+
* @param headers Header object
|
|
11
|
+
* @param obj Object to specify a proxy object. Used to assign parsed values.
|
|
12
|
+
* @returns If `obj` is specified, it is equivalent to `obj`.
|
|
13
|
+
*/
|
|
14
|
+
export function parseHeaders(
|
|
15
|
+
headers: (Buffer | string | (Buffer | string)[])[],
|
|
16
|
+
obj?: Record<string, string | string[]>
|
|
17
|
+
): Record<string, string | string[]>;
|
|
18
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
type Converter<T> = (object: unknown) => T
|
|
7
7
|
|
|
8
|
-
type SequenceConverter<T> = (object: unknown) => T[]
|
|
8
|
+
type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
|
|
9
9
|
|
|
10
10
|
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
|
|
11
11
|
|
|
@@ -62,20 +62,25 @@ interface WebidlUtil {
|
|
|
62
62
|
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
|
|
63
63
|
*/
|
|
64
64
|
IntegerPart (N: number): number
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Stringifies {@param V}
|
|
68
|
+
*/
|
|
69
|
+
Stringify (V: any): string
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
interface WebidlConverters {
|
|
68
73
|
/**
|
|
69
74
|
* @see https://webidl.spec.whatwg.org/#es-DOMString
|
|
70
75
|
*/
|
|
71
|
-
DOMString (V: unknown, opts?: {
|
|
76
|
+
DOMString (V: unknown, prefix: string, argument: string, opts?: {
|
|
72
77
|
legacyNullToEmptyString: boolean
|
|
73
78
|
}): string
|
|
74
79
|
|
|
75
80
|
/**
|
|
76
81
|
* @see https://webidl.spec.whatwg.org/#es-ByteString
|
|
77
82
|
*/
|
|
78
|
-
ByteString (V: unknown): string
|
|
83
|
+
ByteString (V: unknown, prefix: string, argument: string): string
|
|
79
84
|
|
|
80
85
|
/**
|
|
81
86
|
* @see https://webidl.spec.whatwg.org/#es-USVString
|
|
@@ -199,7 +204,7 @@ export interface Webidl {
|
|
|
199
204
|
*/
|
|
200
205
|
dictionaryConverter (converters: {
|
|
201
206
|
key: string,
|
|
202
|
-
defaultValue?: unknown,
|
|
207
|
+
defaultValue?: () => unknown,
|
|
203
208
|
required?: boolean,
|
|
204
209
|
converter: (...args: unknown[]) => unknown,
|
|
205
210
|
allowedValues?: unknown[]
|
|
@@ -213,8 +218,5 @@ export interface Webidl {
|
|
|
213
218
|
converter: Converter<T>
|
|
214
219
|
): (V: unknown) => ReturnType<typeof converter> | null
|
|
215
220
|
|
|
216
|
-
argumentLengthCheck (args: { length: number }, min: number, context:
|
|
217
|
-
header: string
|
|
218
|
-
message?: string
|
|
219
|
-
}): void
|
|
221
|
+
argumentLengthCheck (args: { length: number }, min: number, context: string): void
|
|
220
222
|
}
|
|
@@ -17,7 +17,7 @@ export type BinaryType = 'blob' | 'arraybuffer'
|
|
|
17
17
|
|
|
18
18
|
interface WebSocketEventMap {
|
|
19
19
|
close: CloseEvent
|
|
20
|
-
error:
|
|
20
|
+
error: ErrorEvent
|
|
21
21
|
message: MessageEvent
|
|
22
22
|
open: Event
|
|
23
23
|
}
|
|
@@ -124,6 +124,27 @@ export declare const MessageEvent: {
|
|
|
124
124
|
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
interface ErrorEventInit extends EventInit {
|
|
128
|
+
message?: string
|
|
129
|
+
filename?: string
|
|
130
|
+
lineno?: number
|
|
131
|
+
colno?: number
|
|
132
|
+
error?: any
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
interface ErrorEvent extends Event {
|
|
136
|
+
readonly message: string
|
|
137
|
+
readonly filename: string
|
|
138
|
+
readonly lineno: number
|
|
139
|
+
readonly colno: number
|
|
140
|
+
readonly error: any
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export declare const ErrorEvent: {
|
|
144
|
+
prototype: ErrorEvent
|
|
145
|
+
new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
|
|
146
|
+
}
|
|
147
|
+
|
|
127
148
|
interface WebSocketInit {
|
|
128
149
|
protocols?: string | string[],
|
|
129
150
|
dispatcher?: Dispatcher,
|