@nuxt/webpack-builder 3.20.2 → 3.21.1
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 +5 -3
- package/dist/THIRD-PARTY-LICENSES.md +3847 -0
- package/dist/_chunks/libs/@babel/parser.d.mts +1536 -0
- package/dist/_chunks/libs/@jridgewell/trace-mapping.d.mts +82 -0
- package/dist/_chunks/libs/@types/estree.d.mts +525 -0
- package/dist/_chunks/libs/@types/pug.d.mts +123 -0
- package/dist/_chunks/libs/@unhead/vue.d.mts +1096 -0
- package/dist/_chunks/libs/@vitejs/plugin-vue-jsx.d.mts +5297 -0
- package/dist/_chunks/libs/@vitejs/plugin-vue.d.mts +83 -0
- package/dist/_chunks/libs/@volar/language-core.d.mts +56 -0
- package/dist/_chunks/libs/@volar/source-map.d.mts +10 -0
- package/dist/_chunks/libs/@vue/compiler-core.d.mts +1213 -0
- package/dist/_chunks/libs/@vue/compiler-dom.d.mts +45 -0
- package/dist/_chunks/libs/@vue/language-core.d.mts +11387 -0
- package/dist/_chunks/libs/c12.d.mts +147 -0
- package/dist/_chunks/libs/compatx.d.mts +47 -0
- package/dist/_chunks/libs/h3.d.mts +45 -0
- package/dist/_chunks/libs/ofetch.d.mts +870 -0
- package/dist/_chunks/libs/open.d.mts +1 -0
- package/dist/_chunks/libs/oxc-transform.d.mts +422 -0
- package/dist/_chunks/libs/pkg-types.d.mts +23 -0
- package/dist/_chunks/libs/rollup-plugin-visualizer.d.mts +90 -0
- package/dist/_chunks/libs/scule.d.mts +15 -0
- package/dist/_chunks/libs/unctx.d.mts +28 -0
- package/dist/_chunks/libs/unimport.d.mts +386 -0
- package/dist/_chunks/libs/untyped.d.mts +44 -0
- package/dist/_chunks/libs/vue-router.d.mts +1413 -0
- package/dist/_chunks/rolldown-runtime.mjs +12 -0
- package/dist/index.d.mts +3150 -4
- package/dist/index.mjs +1310 -1155
- package/dist/loaders/vue-module-identifier.mjs +11 -0
- package/package.json +31 -27
- package/dist/index.d.ts +0 -5
|
@@ -0,0 +1,870 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { URL as URL$1, URLSearchParams } from "node:url";
|
|
3
|
+
import { EventEmitter } from "node:events";
|
|
4
|
+
import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from "node:net";
|
|
5
|
+
import { Duplex, Readable, Writable } from "node:stream";
|
|
6
|
+
import { ConnectionOptions, TLSSocket } from "node:tls";
|
|
7
|
+
import { Blob as Blob$1, File } from "node:buffer";
|
|
8
|
+
import "node:stream/web";
|
|
9
|
+
import "node:dns";
|
|
10
|
+
import "node:worker_threads";
|
|
11
|
+
|
|
12
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/utility.d.ts
|
|
13
|
+
type AutocompletePrimitiveBaseType<T> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : never;
|
|
14
|
+
type Autocomplete<T> = T | (AutocompletePrimitiveBaseType<T> & Record<never, never>);
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/header.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* The header type declaration of `undici`.
|
|
19
|
+
*/
|
|
20
|
+
type IncomingHttpHeaders = Record<string, string | string[] | undefined>;
|
|
21
|
+
type HeaderNames = Autocomplete<'Accept' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Encoding' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Age' | 'Allow' | 'Alt-Svc' | 'Alt-Used' | 'Authorization' | 'Cache-Control' | 'Clear-Site-Data' | 'Connection' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'Device-Memory' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Forwarded' | 'From' | 'Host' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Unmodified-Since' | 'Keep-Alive' | 'Last-Modified' | 'Link' | 'Location' | 'Max-Forwards' | 'Origin' | 'Permissions-Policy' | 'Priority' | 'Proxy-Authenticate' | 'Proxy-Authorization' | 'Range' | 'Referer' | 'Referrer-Policy' | 'Retry-After' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-Purpose' | 'Sec-WebSocket-Accept' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'SourceMap' | 'Strict-Transport-Security' | 'TE' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Upgrade-Insecure-Requests' | 'User-Agent' | 'Vary' | 'Via' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options'>;
|
|
22
|
+
type IANARegisteredMimeType = Autocomplete<'audio/aac' | 'video/x-msvideo' | 'image/avif' | 'video/av1' | 'application/octet-stream' | 'image/bmp' | 'text/css' | 'text/csv' | 'application/vnd.ms-fontobject' | 'application/epub+zip' | 'image/gif' | 'application/gzip' | 'text/html' | 'image/x-icon' | 'text/calendar' | 'image/jpeg' | 'text/javascript' | 'application/json' | 'application/ld+json' | 'audio/x-midi' | 'audio/mpeg' | 'video/mp4' | 'video/mpeg' | 'audio/ogg' | 'video/ogg' | 'application/ogg' | 'audio/opus' | 'font/otf' | 'application/pdf' | 'image/png' | 'application/rtf' | 'image/svg+xml' | 'image/tiff' | 'video/mp2t' | 'font/ttf' | 'text/plain' | 'application/wasm' | 'video/webm' | 'audio/webm' | 'image/webp' | 'font/woff' | 'font/woff2' | 'application/xhtml+xml' | 'application/xml' | 'application/zip' | 'video/3gpp' | 'video/3gpp2' | 'model/gltf+json' | 'model/gltf-binary'>;
|
|
23
|
+
type KnownHeaderValues = {
|
|
24
|
+
'content-type': IANARegisteredMimeType;
|
|
25
|
+
};
|
|
26
|
+
type HeaderRecord = { [K in HeaderNames | Lowercase<HeaderNames>]?: Lowercase<K> extends keyof KnownHeaderValues ? KnownHeaderValues[Lowercase<K>] : string };
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/readable.d.ts
|
|
29
|
+
declare class BodyReadable extends Readable {
|
|
30
|
+
constructor(opts: {
|
|
31
|
+
resume: (this: Readable, size: number) => void | null;
|
|
32
|
+
abort: () => void | null;
|
|
33
|
+
contentType?: string;
|
|
34
|
+
contentLength?: number;
|
|
35
|
+
highWaterMark?: number;
|
|
36
|
+
});
|
|
37
|
+
/** Consumes and returns the body as a string
|
|
38
|
+
* https://fetch.spec.whatwg.org/#dom-body-text
|
|
39
|
+
*/
|
|
40
|
+
text(): Promise<string>;
|
|
41
|
+
/** Consumes and returns the body as a JavaScript Object
|
|
42
|
+
* https://fetch.spec.whatwg.org/#dom-body-json
|
|
43
|
+
*/
|
|
44
|
+
json(): Promise<unknown>;
|
|
45
|
+
/** Consumes and returns the body as a Blob
|
|
46
|
+
* https://fetch.spec.whatwg.org/#dom-body-blob
|
|
47
|
+
*/
|
|
48
|
+
blob(): Promise<Blob$1>;
|
|
49
|
+
/** Consumes and returns the body as an Uint8Array
|
|
50
|
+
* https://fetch.spec.whatwg.org/#dom-body-bytes
|
|
51
|
+
*/
|
|
52
|
+
bytes(): Promise<Uint8Array>;
|
|
53
|
+
/** Consumes and returns the body as an ArrayBuffer
|
|
54
|
+
* https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
|
55
|
+
*/
|
|
56
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
57
|
+
/** Not implemented
|
|
58
|
+
*
|
|
59
|
+
* https://fetch.spec.whatwg.org/#dom-body-formdata
|
|
60
|
+
*/
|
|
61
|
+
formData(): Promise<never>;
|
|
62
|
+
/** Returns true if the body is not null and the body has been consumed
|
|
63
|
+
*
|
|
64
|
+
* Otherwise, returns false
|
|
65
|
+
*
|
|
66
|
+
* https://fetch.spec.whatwg.org/#dom-body-bodyused
|
|
67
|
+
*/
|
|
68
|
+
readonly bodyUsed: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* If body is null, it should return null as the body
|
|
71
|
+
*
|
|
72
|
+
* If body is not null, should return the body as a ReadableStream
|
|
73
|
+
*
|
|
74
|
+
* https://fetch.spec.whatwg.org/#dom-body-body
|
|
75
|
+
*/
|
|
76
|
+
readonly body: never | undefined;
|
|
77
|
+
/** Dumps the response body by reading `limit` number of bytes.
|
|
78
|
+
* @param opts.limit Number of bytes to read (optional) - Default: 131072
|
|
79
|
+
* @param opts.signal AbortSignal to cancel the operation (optional)
|
|
80
|
+
*/
|
|
81
|
+
dump(opts?: {
|
|
82
|
+
limit: number;
|
|
83
|
+
signal?: AbortSignal;
|
|
84
|
+
}): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/fetch.d.ts
|
|
88
|
+
type BodyInit = ArrayBuffer | AsyncIterable<Uint8Array> | Blob$1 | FormData | Iterable<Uint8Array> | NodeJS.ArrayBufferView | URLSearchParams | null | string;
|
|
89
|
+
interface SpecIterator<T, TReturn = any, TNext = undefined> {
|
|
90
|
+
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
|
91
|
+
}
|
|
92
|
+
interface SpecIterableIterator<T> extends SpecIterator<T> {
|
|
93
|
+
[Symbol.iterator](): SpecIterableIterator<T>;
|
|
94
|
+
}
|
|
95
|
+
interface SpecIterable<T> {
|
|
96
|
+
[Symbol.iterator](): SpecIterator<T>;
|
|
97
|
+
}
|
|
98
|
+
type HeadersInit$1 = [string, string][] | HeaderRecord | Headers$1;
|
|
99
|
+
declare class Headers$1 implements SpecIterable<[string, string]> {
|
|
100
|
+
constructor(init?: HeadersInit$1);
|
|
101
|
+
readonly append: (name: string, value: string) => void;
|
|
102
|
+
readonly delete: (name: string) => void;
|
|
103
|
+
readonly get: (name: string) => string | null;
|
|
104
|
+
readonly has: (name: string) => boolean;
|
|
105
|
+
readonly set: (name: string, value: string) => void;
|
|
106
|
+
readonly getSetCookie: () => string[];
|
|
107
|
+
readonly forEach: (callbackfn: (value: string, key: string, iterable: Headers$1) => void, thisArg?: unknown) => void;
|
|
108
|
+
readonly keys: () => SpecIterableIterator<string>;
|
|
109
|
+
readonly values: () => SpecIterableIterator<string>;
|
|
110
|
+
readonly entries: () => SpecIterableIterator<[string, string]>;
|
|
111
|
+
readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/formdata.d.ts
|
|
115
|
+
/**
|
|
116
|
+
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
|
117
|
+
*/
|
|
118
|
+
declare type FormDataEntryValue = string | File;
|
|
119
|
+
/**
|
|
120
|
+
* Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using fetch().
|
|
121
|
+
*/
|
|
122
|
+
declare class FormData {
|
|
123
|
+
/**
|
|
124
|
+
* Appends a new value onto an existing key inside a FormData object,
|
|
125
|
+
* or adds the key if it does not already exist.
|
|
126
|
+
*
|
|
127
|
+
* The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
|
|
128
|
+
*
|
|
129
|
+
* @param name The name of the field whose data is contained in `value`.
|
|
130
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
|
131
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
|
132
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
|
133
|
+
*/
|
|
134
|
+
append(name: string, value: unknown, fileName?: string): void;
|
|
135
|
+
/**
|
|
136
|
+
* Set a new value for an existing key inside FormData,
|
|
137
|
+
* or add the new field if it does not already exist.
|
|
138
|
+
*
|
|
139
|
+
* @param name The name of the field whose data is contained in `value`.
|
|
140
|
+
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
|
141
|
+
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
|
142
|
+
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
|
143
|
+
*
|
|
144
|
+
*/
|
|
145
|
+
set(name: string, value: unknown, fileName?: string): void;
|
|
146
|
+
/**
|
|
147
|
+
* Returns the first value associated with a given key from within a `FormData` object.
|
|
148
|
+
* If you expect multiple values and want all of them, use the `getAll()` method instead.
|
|
149
|
+
*
|
|
150
|
+
* @param {string} name A name of the value you want to retrieve.
|
|
151
|
+
*
|
|
152
|
+
* @returns A `FormDataEntryValue` containing the value. If the key doesn't exist, the method returns null.
|
|
153
|
+
*/
|
|
154
|
+
get(name: string): FormDataEntryValue | null;
|
|
155
|
+
/**
|
|
156
|
+
* Returns all the values associated with a given key from within a `FormData` object.
|
|
157
|
+
*
|
|
158
|
+
* @param {string} name A name of the value you want to retrieve.
|
|
159
|
+
*
|
|
160
|
+
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
|
|
161
|
+
*/
|
|
162
|
+
getAll(name: string): FormDataEntryValue[];
|
|
163
|
+
/**
|
|
164
|
+
* Returns a boolean stating whether a `FormData` object contains a certain key.
|
|
165
|
+
*
|
|
166
|
+
* @param name A string representing the name of the key you want to test for.
|
|
167
|
+
*
|
|
168
|
+
* @return A boolean value.
|
|
169
|
+
*/
|
|
170
|
+
has(name: string): boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Deletes a key and its value(s) from a `FormData` object.
|
|
173
|
+
*
|
|
174
|
+
* @param name The name of the key you want to delete.
|
|
175
|
+
*/
|
|
176
|
+
delete(name: string): void;
|
|
177
|
+
/**
|
|
178
|
+
* Executes given callback function for each field of the FormData instance
|
|
179
|
+
*/
|
|
180
|
+
forEach: (callbackfn: (value: FormDataEntryValue, key: string, iterable: FormData) => void, thisArg?: unknown) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all keys contained in this `FormData` object.
|
|
183
|
+
* Each key is a `string`.
|
|
184
|
+
*/
|
|
185
|
+
keys: () => SpecIterableIterator<string>;
|
|
186
|
+
/**
|
|
187
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through all values contained in this object `FormData` object.
|
|
188
|
+
* Each value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
|
189
|
+
*/
|
|
190
|
+
values: () => SpecIterableIterator<FormDataEntryValue>;
|
|
191
|
+
/**
|
|
192
|
+
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
|
|
193
|
+
* The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
|
194
|
+
*/
|
|
195
|
+
entries: () => SpecIterableIterator<[string, FormDataEntryValue]>;
|
|
196
|
+
/**
|
|
197
|
+
* An alias for FormData#entries()
|
|
198
|
+
*/
|
|
199
|
+
[Symbol.iterator]: () => SpecIterableIterator<[string, FormDataEntryValue]>;
|
|
200
|
+
readonly [Symbol.toStringTag]: string;
|
|
201
|
+
}
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/connector.d.ts
|
|
204
|
+
declare function buildConnector(options?: buildConnector.BuildOptions): buildConnector.connector;
|
|
205
|
+
declare namespace buildConnector {
|
|
206
|
+
export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
|
|
207
|
+
allowH2?: boolean;
|
|
208
|
+
maxCachedSessions?: number | null;
|
|
209
|
+
socketPath?: string | null;
|
|
210
|
+
timeout?: number | null;
|
|
211
|
+
port?: number;
|
|
212
|
+
keepAlive?: boolean | null;
|
|
213
|
+
keepAliveInitialDelay?: number | null;
|
|
214
|
+
};
|
|
215
|
+
export interface Options {
|
|
216
|
+
hostname: string;
|
|
217
|
+
host?: string;
|
|
218
|
+
protocol: string;
|
|
219
|
+
port: string;
|
|
220
|
+
servername?: string;
|
|
221
|
+
localAddress?: string | null;
|
|
222
|
+
httpSocket?: Socket;
|
|
223
|
+
}
|
|
224
|
+
export type Callback = (...args: CallbackArgs) => void;
|
|
225
|
+
type CallbackArgs = [null, Socket | TLSSocket] | [Error, null];
|
|
226
|
+
export interface connector {
|
|
227
|
+
(options: buildConnector.Options, callback: buildConnector.Callback): void;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/client-stats.d.ts
|
|
232
|
+
declare class ClientStats {
|
|
233
|
+
constructor(pool: Client);
|
|
234
|
+
/** If socket has open connection. */
|
|
235
|
+
connected: boolean;
|
|
236
|
+
/** Number of open socket connections in this client that do not have an active request. */
|
|
237
|
+
pending: number;
|
|
238
|
+
/** Number of currently active requests of this client. */
|
|
239
|
+
running: number;
|
|
240
|
+
/** Number of active, pending, or queued requests of this client. */
|
|
241
|
+
size: number;
|
|
242
|
+
}
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/client.d.ts
|
|
245
|
+
type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>;
|
|
246
|
+
/**
|
|
247
|
+
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
|
|
248
|
+
*/
|
|
249
|
+
declare class Client extends Dispatcher {
|
|
250
|
+
constructor(url: string | URL$1, options?: Client.Options);
|
|
251
|
+
/** Property to get and set the pipelining factor. */
|
|
252
|
+
pipelining: number;
|
|
253
|
+
/** `true` after `client.close()` has been called. */
|
|
254
|
+
closed: boolean;
|
|
255
|
+
/** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
|
|
256
|
+
destroyed: boolean;
|
|
257
|
+
/** Aggregate stats for a Client. */
|
|
258
|
+
readonly stats: ClientStats; // Override dispatcher APIs.
|
|
259
|
+
override connect(options: ClientConnectOptions): Promise<Dispatcher.ConnectData>;
|
|
260
|
+
override connect(options: ClientConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
|
|
261
|
+
}
|
|
262
|
+
declare namespace Client {
|
|
263
|
+
export interface OptionsInterceptors {
|
|
264
|
+
Client: readonly Dispatcher.DispatchInterceptor[];
|
|
265
|
+
}
|
|
266
|
+
export interface Options {
|
|
267
|
+
/** TODO */
|
|
268
|
+
interceptors?: OptionsInterceptors;
|
|
269
|
+
/** The maximum length of request headers in bytes. Default: Node.js' `--max-http-header-size` or `16384` (16KiB). */
|
|
270
|
+
maxHeaderSize?: number;
|
|
271
|
+
/** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers (Node 14 and above only). Default: `300e3` milliseconds (300s). */
|
|
272
|
+
headersTimeout?: number;
|
|
273
|
+
/** @deprecated unsupported socketTimeout, use headersTimeout & bodyTimeout instead */
|
|
274
|
+
socketTimeout?: never;
|
|
275
|
+
/** @deprecated unsupported requestTimeout, use headersTimeout & bodyTimeout instead */
|
|
276
|
+
requestTimeout?: never;
|
|
277
|
+
/** TODO */
|
|
278
|
+
connectTimeout?: number;
|
|
279
|
+
/** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Default: `300e3` milliseconds (300s). */
|
|
280
|
+
bodyTimeout?: number;
|
|
281
|
+
/** @deprecated unsupported idleTimeout, use keepAliveTimeout instead */
|
|
282
|
+
idleTimeout?: never;
|
|
283
|
+
/** @deprecated unsupported keepAlive, use pipelining=0 instead */
|
|
284
|
+
keepAlive?: never;
|
|
285
|
+
/** the timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. Default: `4e3` milliseconds (4s). */
|
|
286
|
+
keepAliveTimeout?: number;
|
|
287
|
+
/** @deprecated unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead */
|
|
288
|
+
maxKeepAliveTimeout?: never;
|
|
289
|
+
/** the maximum allowed `idleTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Default: `600e3` milliseconds (10min). */
|
|
290
|
+
keepAliveMaxTimeout?: number;
|
|
291
|
+
/** A number of milliseconds subtracted from server *keep-alive* hints when overriding `idleTimeout` to account for timing inaccuracies caused by e.g. transport latency. Default: `1e3` milliseconds (1s). */
|
|
292
|
+
keepAliveTimeoutThreshold?: number;
|
|
293
|
+
/** TODO */
|
|
294
|
+
socketPath?: string;
|
|
295
|
+
/** The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Default: `1`. */
|
|
296
|
+
pipelining?: number;
|
|
297
|
+
/** @deprecated use the connect option instead */
|
|
298
|
+
tls?: never;
|
|
299
|
+
/** If `true`, an error is thrown when the request content-length header doesn't match the length of the request body. Default: `true`. */
|
|
300
|
+
strictContentLength?: boolean;
|
|
301
|
+
/** TODO */
|
|
302
|
+
maxCachedSessions?: number;
|
|
303
|
+
/** TODO */
|
|
304
|
+
connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
|
|
305
|
+
/** TODO */
|
|
306
|
+
maxRequestsPerClient?: number;
|
|
307
|
+
/** TODO */
|
|
308
|
+
localAddress?: string;
|
|
309
|
+
/** Max response body size in bytes, -1 is disabled */
|
|
310
|
+
maxResponseSize?: number;
|
|
311
|
+
/** Enables a family autodetection algorithm that loosely implements section 5 of RFC 8305. */
|
|
312
|
+
autoSelectFamily?: boolean;
|
|
313
|
+
/** The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. */
|
|
314
|
+
autoSelectFamilyAttemptTimeout?: number;
|
|
315
|
+
/**
|
|
316
|
+
* @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
|
|
317
|
+
* @default false
|
|
318
|
+
*/
|
|
319
|
+
allowH2?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
|
|
322
|
+
* @default 100
|
|
323
|
+
*/
|
|
324
|
+
maxConcurrentStreams?: number;
|
|
325
|
+
/**
|
|
326
|
+
* @description Sets the HTTP/2 stream-level flow-control window size (SETTINGS_INITIAL_WINDOW_SIZE).
|
|
327
|
+
* @default 262144
|
|
328
|
+
*/
|
|
329
|
+
initialWindowSize?: number;
|
|
330
|
+
/**
|
|
331
|
+
* @description Sets the HTTP/2 connection-level flow-control window size (ClientHttp2Session.setLocalWindowSize).
|
|
332
|
+
* @default 524288
|
|
333
|
+
*/
|
|
334
|
+
connectionWindowSize?: number;
|
|
335
|
+
/**
|
|
336
|
+
* @description Time interval between PING frames dispatch
|
|
337
|
+
* @default 60000
|
|
338
|
+
*/
|
|
339
|
+
pingInterval?: number;
|
|
340
|
+
}
|
|
341
|
+
export interface SocketInfo {
|
|
342
|
+
localAddress?: string;
|
|
343
|
+
localPort?: number;
|
|
344
|
+
remoteAddress?: string;
|
|
345
|
+
remotePort?: number;
|
|
346
|
+
remoteFamily?: string;
|
|
347
|
+
timeout?: number;
|
|
348
|
+
bytesWritten?: number;
|
|
349
|
+
bytesRead?: number;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/errors.d.ts
|
|
354
|
+
declare namespace Errors {
|
|
355
|
+
export class UndiciError extends Error {
|
|
356
|
+
name: string;
|
|
357
|
+
code: string;
|
|
358
|
+
}
|
|
359
|
+
/** Connect timeout error. */
|
|
360
|
+
export class ConnectTimeoutError extends UndiciError {
|
|
361
|
+
name: 'ConnectTimeoutError';
|
|
362
|
+
code: 'UND_ERR_CONNECT_TIMEOUT';
|
|
363
|
+
}
|
|
364
|
+
/** A header exceeds the `headersTimeout` option. */
|
|
365
|
+
export class HeadersTimeoutError extends UndiciError {
|
|
366
|
+
name: 'HeadersTimeoutError';
|
|
367
|
+
code: 'UND_ERR_HEADERS_TIMEOUT';
|
|
368
|
+
}
|
|
369
|
+
/** Headers overflow error. */
|
|
370
|
+
export class HeadersOverflowError extends UndiciError {
|
|
371
|
+
name: 'HeadersOverflowError';
|
|
372
|
+
code: 'UND_ERR_HEADERS_OVERFLOW';
|
|
373
|
+
}
|
|
374
|
+
/** A body exceeds the `bodyTimeout` option. */
|
|
375
|
+
export class BodyTimeoutError extends UndiciError {
|
|
376
|
+
name: 'BodyTimeoutError';
|
|
377
|
+
code: 'UND_ERR_BODY_TIMEOUT';
|
|
378
|
+
}
|
|
379
|
+
export class ResponseError extends UndiciError {
|
|
380
|
+
constructor(message: string, code: number, options: {
|
|
381
|
+
headers?: IncomingHttpHeaders | string[] | null;
|
|
382
|
+
body?: null | Record<string, any> | string;
|
|
383
|
+
});
|
|
384
|
+
name: 'ResponseError';
|
|
385
|
+
code: 'UND_ERR_RESPONSE';
|
|
386
|
+
statusCode: number;
|
|
387
|
+
body: null | Record<string, any> | string;
|
|
388
|
+
headers: IncomingHttpHeaders | string[] | null;
|
|
389
|
+
}
|
|
390
|
+
/** Passed an invalid argument. */
|
|
391
|
+
export class InvalidArgumentError extends UndiciError {
|
|
392
|
+
name: 'InvalidArgumentError';
|
|
393
|
+
code: 'UND_ERR_INVALID_ARG';
|
|
394
|
+
}
|
|
395
|
+
/** Returned an invalid value. */
|
|
396
|
+
export class InvalidReturnValueError extends UndiciError {
|
|
397
|
+
name: 'InvalidReturnValueError';
|
|
398
|
+
code: 'UND_ERR_INVALID_RETURN_VALUE';
|
|
399
|
+
}
|
|
400
|
+
/** The request has been aborted by the user. */
|
|
401
|
+
export class RequestAbortedError extends UndiciError {
|
|
402
|
+
name: 'AbortError';
|
|
403
|
+
code: 'UND_ERR_ABORTED';
|
|
404
|
+
}
|
|
405
|
+
/** Expected error with reason. */
|
|
406
|
+
export class InformationalError extends UndiciError {
|
|
407
|
+
name: 'InformationalError';
|
|
408
|
+
code: 'UND_ERR_INFO';
|
|
409
|
+
}
|
|
410
|
+
/** Request body length does not match content-length header. */
|
|
411
|
+
export class RequestContentLengthMismatchError extends UndiciError {
|
|
412
|
+
name: 'RequestContentLengthMismatchError';
|
|
413
|
+
code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH';
|
|
414
|
+
}
|
|
415
|
+
/** Response body length does not match content-length header. */
|
|
416
|
+
export class ResponseContentLengthMismatchError extends UndiciError {
|
|
417
|
+
name: 'ResponseContentLengthMismatchError';
|
|
418
|
+
code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH';
|
|
419
|
+
}
|
|
420
|
+
/** Trying to use a destroyed client. */
|
|
421
|
+
export class ClientDestroyedError extends UndiciError {
|
|
422
|
+
name: 'ClientDestroyedError';
|
|
423
|
+
code: 'UND_ERR_DESTROYED';
|
|
424
|
+
}
|
|
425
|
+
/** Trying to use a closed client. */
|
|
426
|
+
export class ClientClosedError extends UndiciError {
|
|
427
|
+
name: 'ClientClosedError';
|
|
428
|
+
code: 'UND_ERR_CLOSED';
|
|
429
|
+
}
|
|
430
|
+
/** There is an error with the socket. */
|
|
431
|
+
export class SocketError extends UndiciError {
|
|
432
|
+
name: 'SocketError';
|
|
433
|
+
code: 'UND_ERR_SOCKET';
|
|
434
|
+
socket: Client.SocketInfo | null;
|
|
435
|
+
}
|
|
436
|
+
/** Encountered unsupported functionality. */
|
|
437
|
+
export class NotSupportedError extends UndiciError {
|
|
438
|
+
name: 'NotSupportedError';
|
|
439
|
+
code: 'UND_ERR_NOT_SUPPORTED';
|
|
440
|
+
}
|
|
441
|
+
/** No upstream has been added to the BalancedPool. */
|
|
442
|
+
export class BalancedPoolMissingUpstreamError extends UndiciError {
|
|
443
|
+
name: 'MissingUpstreamError';
|
|
444
|
+
code: 'UND_ERR_BPL_MISSING_UPSTREAM';
|
|
445
|
+
}
|
|
446
|
+
export class HTTPParserError extends UndiciError {
|
|
447
|
+
name: 'HTTPParserError';
|
|
448
|
+
code: string;
|
|
449
|
+
}
|
|
450
|
+
/** The response exceed the length allowed. */
|
|
451
|
+
export class ResponseExceededMaxSizeError extends UndiciError {
|
|
452
|
+
name: 'ResponseExceededMaxSizeError';
|
|
453
|
+
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
|
|
454
|
+
}
|
|
455
|
+
export class RequestRetryError extends UndiciError {
|
|
456
|
+
constructor(message: string, statusCode: number, headers?: IncomingHttpHeaders | string[] | null, body?: null | Record<string, any> | string);
|
|
457
|
+
name: 'RequestRetryError';
|
|
458
|
+
code: 'UND_ERR_REQ_RETRY';
|
|
459
|
+
statusCode: number;
|
|
460
|
+
data: {
|
|
461
|
+
count: number;
|
|
462
|
+
};
|
|
463
|
+
headers: Record<string, string | string[]>;
|
|
464
|
+
}
|
|
465
|
+
export class SecureProxyConnectionError extends UndiciError {
|
|
466
|
+
constructor(cause?: Error, message?: string, options?: Record<any, any>);
|
|
467
|
+
name: 'SecureProxyConnectionError';
|
|
468
|
+
code: 'UND_ERR_PRX_TLS';
|
|
469
|
+
}
|
|
470
|
+
class MaxOriginsReachedError extends UndiciError {
|
|
471
|
+
name: 'MaxOriginsReachedError';
|
|
472
|
+
code: 'UND_ERR_MAX_ORIGINS_REACHED';
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/dispatcher.d.ts
|
|
477
|
+
type AbortSignal$1 = unknown;
|
|
478
|
+
type UndiciHeaders = Record<string, string | string[]> | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null;
|
|
479
|
+
/** Dispatcher is the core API used to dispatch requests. */
|
|
480
|
+
declare class Dispatcher extends EventEmitter {
|
|
481
|
+
/** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */
|
|
482
|
+
dispatch(options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean;
|
|
483
|
+
/** Starts two-way communications with the requested resource. */
|
|
484
|
+
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void;
|
|
485
|
+
connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>;
|
|
486
|
+
/** Compose a chain of dispatchers */
|
|
487
|
+
compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
|
|
488
|
+
compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
|
|
489
|
+
/** Performs an HTTP request. */
|
|
490
|
+
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void;
|
|
491
|
+
request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>;
|
|
492
|
+
/** For easy use with `stream.pipeline`. */
|
|
493
|
+
pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex;
|
|
494
|
+
/** A faster version of `Dispatcher.request`. */
|
|
495
|
+
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void;
|
|
496
|
+
stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>;
|
|
497
|
+
/** Upgrade to a different protocol. */
|
|
498
|
+
upgrade(options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void;
|
|
499
|
+
upgrade(options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>;
|
|
500
|
+
/** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
|
|
501
|
+
close(callback: () => void): void;
|
|
502
|
+
close(): Promise<void>;
|
|
503
|
+
/** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */
|
|
504
|
+
destroy(err: Error | null, callback: () => void): void;
|
|
505
|
+
destroy(callback: () => void): void;
|
|
506
|
+
destroy(err: Error | null): Promise<void>;
|
|
507
|
+
destroy(): Promise<void>;
|
|
508
|
+
on(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
509
|
+
on(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
510
|
+
on(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
511
|
+
on(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
512
|
+
once(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
513
|
+
once(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
514
|
+
once(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
515
|
+
once(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
516
|
+
off(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
517
|
+
off(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
518
|
+
off(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
519
|
+
off(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
520
|
+
addListener(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
521
|
+
addListener(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
522
|
+
addListener(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
523
|
+
addListener(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
524
|
+
removeListener(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
525
|
+
removeListener(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
526
|
+
removeListener(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
527
|
+
removeListener(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
528
|
+
prependListener(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
529
|
+
prependListener(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
530
|
+
prependListener(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
531
|
+
prependListener(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
532
|
+
prependOnceListener(eventName: 'connect', callback: (origin: URL$1, targets: readonly Dispatcher[]) => void): this;
|
|
533
|
+
prependOnceListener(eventName: 'disconnect', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
534
|
+
prependOnceListener(eventName: 'connectionError', callback: (origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this;
|
|
535
|
+
prependOnceListener(eventName: 'drain', callback: (origin: URL$1) => void): this;
|
|
536
|
+
listeners(eventName: 'connect'): ((origin: URL$1, targets: readonly Dispatcher[]) => void)[];
|
|
537
|
+
listeners(eventName: 'disconnect'): ((origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
538
|
+
listeners(eventName: 'connectionError'): ((origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
539
|
+
listeners(eventName: 'drain'): ((origin: URL$1) => void)[];
|
|
540
|
+
rawListeners(eventName: 'connect'): ((origin: URL$1, targets: readonly Dispatcher[]) => void)[];
|
|
541
|
+
rawListeners(eventName: 'disconnect'): ((origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
542
|
+
rawListeners(eventName: 'connectionError'): ((origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[];
|
|
543
|
+
rawListeners(eventName: 'drain'): ((origin: URL$1) => void)[];
|
|
544
|
+
emit(eventName: 'connect', origin: URL$1, targets: readonly Dispatcher[]): boolean;
|
|
545
|
+
emit(eventName: 'disconnect', origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
|
546
|
+
emit(eventName: 'connectionError', origin: URL$1, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean;
|
|
547
|
+
emit(eventName: 'drain', origin: URL$1): boolean;
|
|
548
|
+
}
|
|
549
|
+
declare namespace Dispatcher {
|
|
550
|
+
export interface ComposedDispatcher extends Dispatcher {}
|
|
551
|
+
export type Dispatch = Dispatcher['dispatch'];
|
|
552
|
+
export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch;
|
|
553
|
+
export interface DispatchOptions {
|
|
554
|
+
origin?: string | URL$1;
|
|
555
|
+
path: string;
|
|
556
|
+
method: HttpMethod;
|
|
557
|
+
/** Default: `null` */
|
|
558
|
+
body?: string | Buffer | Uint8Array | Readable | null | FormData;
|
|
559
|
+
/** Default: `null` */
|
|
560
|
+
headers?: UndiciHeaders;
|
|
561
|
+
/** Query string params to be embedded in the request URL. Default: `null` */
|
|
562
|
+
query?: Record<string, any>;
|
|
563
|
+
/** Whether the requests can be safely retried or not. If `false` the request won't be sent until all preceding requests in the pipeline have completed. Default: `true` if `method` is `HEAD` or `GET`. */
|
|
564
|
+
idempotent?: boolean;
|
|
565
|
+
/** Whether the response is expected to take a long time and would end up blocking the pipeline. When this is set to `true` further pipelining will be avoided on the same connection until headers have been received. Defaults to `method !== 'HEAD'`. */
|
|
566
|
+
blocking?: boolean;
|
|
567
|
+
/** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
|
|
568
|
+
upgrade?: boolean | string | null;
|
|
569
|
+
/** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
|
|
570
|
+
headersTimeout?: number | null;
|
|
571
|
+
/** The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use 0 to disable it entirely. Defaults to 300 seconds. */
|
|
572
|
+
bodyTimeout?: number | null;
|
|
573
|
+
/** Whether the request should stablish a keep-alive or not. Default `false` */
|
|
574
|
+
reset?: boolean;
|
|
575
|
+
/** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
|
|
576
|
+
throwOnError?: boolean;
|
|
577
|
+
/** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */
|
|
578
|
+
expectContinue?: boolean;
|
|
579
|
+
}
|
|
580
|
+
export interface ConnectOptions<TOpaque = null> {
|
|
581
|
+
origin: string | URL$1;
|
|
582
|
+
path: string;
|
|
583
|
+
/** Default: `null` */
|
|
584
|
+
headers?: UndiciHeaders;
|
|
585
|
+
/** Default: `null` */
|
|
586
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
587
|
+
/** This argument parameter is passed through to `ConnectData` */
|
|
588
|
+
opaque?: TOpaque;
|
|
589
|
+
/** Default: false */
|
|
590
|
+
redirectionLimitReached?: boolean;
|
|
591
|
+
/** Default: `null` */
|
|
592
|
+
responseHeaders?: 'raw' | null;
|
|
593
|
+
}
|
|
594
|
+
export interface RequestOptions<TOpaque = null> extends DispatchOptions {
|
|
595
|
+
/** Default: `null` */
|
|
596
|
+
opaque?: TOpaque;
|
|
597
|
+
/** Default: `null` */
|
|
598
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
599
|
+
/** Default: false */
|
|
600
|
+
redirectionLimitReached?: boolean;
|
|
601
|
+
/** Default: `null` */
|
|
602
|
+
onInfo?: (info: {
|
|
603
|
+
statusCode: number;
|
|
604
|
+
headers: Record<string, string | string[]>;
|
|
605
|
+
}) => void;
|
|
606
|
+
/** Default: `null` */
|
|
607
|
+
responseHeaders?: 'raw' | null;
|
|
608
|
+
/** Default: `64 KiB` */
|
|
609
|
+
highWaterMark?: number;
|
|
610
|
+
}
|
|
611
|
+
export interface PipelineOptions<TOpaque = null> extends RequestOptions<TOpaque> {
|
|
612
|
+
/** `true` if the `handler` will return an object stream. Default: `false` */
|
|
613
|
+
objectMode?: boolean;
|
|
614
|
+
}
|
|
615
|
+
export interface UpgradeOptions {
|
|
616
|
+
path: string;
|
|
617
|
+
/** Default: `'GET'` */
|
|
618
|
+
method?: string;
|
|
619
|
+
/** Default: `null` */
|
|
620
|
+
headers?: UndiciHeaders;
|
|
621
|
+
/** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
|
|
622
|
+
protocol?: string;
|
|
623
|
+
/** Default: `null` */
|
|
624
|
+
signal?: AbortSignal$1 | EventEmitter | null;
|
|
625
|
+
/** Default: false */
|
|
626
|
+
redirectionLimitReached?: boolean;
|
|
627
|
+
/** Default: `null` */
|
|
628
|
+
responseHeaders?: 'raw' | null;
|
|
629
|
+
}
|
|
630
|
+
export interface ConnectData<TOpaque = null> {
|
|
631
|
+
statusCode: number;
|
|
632
|
+
headers: IncomingHttpHeaders;
|
|
633
|
+
socket: Duplex;
|
|
634
|
+
opaque: TOpaque;
|
|
635
|
+
}
|
|
636
|
+
export interface ResponseData<TOpaque = null> {
|
|
637
|
+
statusCode: number;
|
|
638
|
+
statusText: string;
|
|
639
|
+
headers: IncomingHttpHeaders;
|
|
640
|
+
body: BodyReadable & BodyMixin;
|
|
641
|
+
trailers: Record<string, string>;
|
|
642
|
+
opaque: TOpaque;
|
|
643
|
+
context: object;
|
|
644
|
+
}
|
|
645
|
+
export interface PipelineHandlerData<TOpaque = null> {
|
|
646
|
+
statusCode: number;
|
|
647
|
+
headers: IncomingHttpHeaders;
|
|
648
|
+
opaque: TOpaque;
|
|
649
|
+
body: BodyReadable;
|
|
650
|
+
context: object;
|
|
651
|
+
}
|
|
652
|
+
export interface StreamData<TOpaque = null> {
|
|
653
|
+
opaque: TOpaque;
|
|
654
|
+
trailers: Record<string, string>;
|
|
655
|
+
}
|
|
656
|
+
export interface UpgradeData<TOpaque = null> {
|
|
657
|
+
headers: IncomingHttpHeaders;
|
|
658
|
+
socket: Duplex;
|
|
659
|
+
opaque: TOpaque;
|
|
660
|
+
}
|
|
661
|
+
export interface StreamFactoryData<TOpaque = null> {
|
|
662
|
+
statusCode: number;
|
|
663
|
+
headers: IncomingHttpHeaders;
|
|
664
|
+
opaque: TOpaque;
|
|
665
|
+
context: object;
|
|
666
|
+
}
|
|
667
|
+
export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable;
|
|
668
|
+
export interface DispatchController {
|
|
669
|
+
get aborted(): boolean;
|
|
670
|
+
get paused(): boolean;
|
|
671
|
+
get reason(): Error | null;
|
|
672
|
+
abort(reason: Error): void;
|
|
673
|
+
pause(): void;
|
|
674
|
+
resume(): void;
|
|
675
|
+
}
|
|
676
|
+
export interface DispatchHandler {
|
|
677
|
+
onRequestStart?(controller: DispatchController, context: any): void;
|
|
678
|
+
onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void;
|
|
679
|
+
onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void;
|
|
680
|
+
onResponseData?(controller: DispatchController, chunk: Buffer): void;
|
|
681
|
+
onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
|
|
682
|
+
onResponseError?(controller: DispatchController, error: Error): void;
|
|
683
|
+
/** Invoked before request is dispatched on socket. May be invoked multiple times when a request is retried when the request at the head of the pipeline fails. */
|
|
684
|
+
/** @deprecated */
|
|
685
|
+
onConnect?(abort: (err?: Error) => void): void;
|
|
686
|
+
/** Invoked when an error has occurred. */
|
|
687
|
+
/** @deprecated */
|
|
688
|
+
onError?(err: Error): void;
|
|
689
|
+
/** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
|
|
690
|
+
/** @deprecated */
|
|
691
|
+
onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
|
|
692
|
+
/** Invoked when response is received, before headers have been read. **/
|
|
693
|
+
/** @deprecated */
|
|
694
|
+
onResponseStarted?(): void;
|
|
695
|
+
/** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
|
|
696
|
+
/** @deprecated */
|
|
697
|
+
onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
|
|
698
|
+
/** Invoked when response payload data is received. */
|
|
699
|
+
/** @deprecated */
|
|
700
|
+
onData?(chunk: Buffer): boolean;
|
|
701
|
+
/** Invoked when response payload and trailers have been received and the request has completed. */
|
|
702
|
+
/** @deprecated */
|
|
703
|
+
onComplete?(trailers: string[] | null): void;
|
|
704
|
+
/** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
|
|
705
|
+
/** @deprecated */
|
|
706
|
+
onBodySent?(chunkSize: number, totalBytesSent: number): void;
|
|
707
|
+
}
|
|
708
|
+
export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable;
|
|
709
|
+
export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>;
|
|
710
|
+
/**
|
|
711
|
+
* @link https://fetch.spec.whatwg.org/#body-mixin
|
|
712
|
+
*/
|
|
713
|
+
interface BodyMixin {
|
|
714
|
+
readonly body?: never;
|
|
715
|
+
readonly bodyUsed: boolean;
|
|
716
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
717
|
+
blob(): Promise<Blob$1>;
|
|
718
|
+
bytes(): Promise<Uint8Array>;
|
|
719
|
+
formData(): Promise<never>;
|
|
720
|
+
json(): Promise<unknown>;
|
|
721
|
+
text(): Promise<string>;
|
|
722
|
+
}
|
|
723
|
+
export interface DispatchInterceptor {
|
|
724
|
+
(dispatch: Dispatch): Dispatch;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region ../../node_modules/.pnpm/undici@7.21.0/node_modules/undici/types/mock-interceptor.d.ts
|
|
729
|
+
/** The scope associated with a mock dispatch. */
|
|
730
|
+
declare class MockScope<TData extends object = object> {
|
|
731
|
+
constructor(mockDispatch: MockInterceptor.MockDispatch<TData>);
|
|
732
|
+
/** Delay a reply by a set amount of time in ms. */
|
|
733
|
+
delay(waitInMs: number): MockScope<TData>;
|
|
734
|
+
/** Persist the defined mock data for the associated reply. It will return the defined mock data indefinitely. */
|
|
735
|
+
persist(): MockScope<TData>;
|
|
736
|
+
/** Define a reply for a set amount of matching requests. */
|
|
737
|
+
times(repeatTimes: number): MockScope<TData>;
|
|
738
|
+
}
|
|
739
|
+
/** The interceptor for a Mock. */
|
|
740
|
+
declare class MockInterceptor {
|
|
741
|
+
constructor(options: MockInterceptor.Options, mockDispatches: MockInterceptor.MockDispatch[]);
|
|
742
|
+
/** Mock an undici request with the defined reply. */
|
|
743
|
+
reply<TData extends object = object>(replyOptionsCallback: MockInterceptor.MockReplyOptionsCallback<TData>): MockScope<TData>;
|
|
744
|
+
reply<TData extends object = object>(statusCode: number, data?: TData | Buffer | string | MockInterceptor.MockResponseDataHandler<TData>, responseOptions?: MockInterceptor.MockResponseOptions): MockScope<TData>;
|
|
745
|
+
/** Mock an undici request by throwing the defined reply error. */
|
|
746
|
+
replyWithError<TError extends Error = Error>(error: TError): MockScope;
|
|
747
|
+
/** Set default reply headers on the interceptor for subsequent mocked replies. */
|
|
748
|
+
defaultReplyHeaders(headers: IncomingHttpHeaders): MockInterceptor;
|
|
749
|
+
/** Set default reply trailers on the interceptor for subsequent mocked replies. */
|
|
750
|
+
defaultReplyTrailers(trailers: Record<string, string>): MockInterceptor;
|
|
751
|
+
/** Set automatically calculated content-length header on subsequent mocked replies. */
|
|
752
|
+
replyContentLength(): MockInterceptor;
|
|
753
|
+
}
|
|
754
|
+
declare namespace MockInterceptor {
|
|
755
|
+
/** MockInterceptor options. */
|
|
756
|
+
export interface Options {
|
|
757
|
+
/** Path to intercept on. */
|
|
758
|
+
path: string | RegExp | ((path: string) => boolean);
|
|
759
|
+
/** Method to intercept on. Defaults to GET. */
|
|
760
|
+
method?: string | RegExp | ((method: string) => boolean);
|
|
761
|
+
/** Body to intercept on. */
|
|
762
|
+
body?: string | RegExp | ((body: string) => boolean);
|
|
763
|
+
/** Headers to intercept on. */
|
|
764
|
+
headers?: Record<string, string | RegExp | ((body: string) => boolean)> | ((headers: Record<string, string>) => boolean);
|
|
765
|
+
/** Query params to intercept on */
|
|
766
|
+
query?: Record<string, any>;
|
|
767
|
+
}
|
|
768
|
+
export interface MockDispatch<TData extends object = object, TError extends Error = Error> extends Options {
|
|
769
|
+
times: number | null;
|
|
770
|
+
persist: boolean;
|
|
771
|
+
consumed: boolean;
|
|
772
|
+
data: MockDispatchData<TData, TError>;
|
|
773
|
+
}
|
|
774
|
+
export interface MockDispatchData<TData extends object = object, TError extends Error = Error> extends MockResponseOptions {
|
|
775
|
+
error: TError | null;
|
|
776
|
+
statusCode?: number;
|
|
777
|
+
data?: TData | string;
|
|
778
|
+
}
|
|
779
|
+
export interface MockResponseOptions {
|
|
780
|
+
headers?: IncomingHttpHeaders;
|
|
781
|
+
trailers?: Record<string, string>;
|
|
782
|
+
}
|
|
783
|
+
export interface MockResponseCallbackOptions {
|
|
784
|
+
path: string;
|
|
785
|
+
method: string;
|
|
786
|
+
headers?: Headers$1 | Record<string, string>;
|
|
787
|
+
origin?: string;
|
|
788
|
+
body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
|
|
789
|
+
}
|
|
790
|
+
export type MockResponseDataHandler<TData extends object = object> = (opts: MockResponseCallbackOptions) => TData | Buffer | string;
|
|
791
|
+
export type MockReplyOptionsCallback<TData extends object = object> = (opts: MockResponseCallbackOptions) => {
|
|
792
|
+
statusCode: number;
|
|
793
|
+
data?: TData | Buffer | string;
|
|
794
|
+
responseOptions?: MockResponseOptions;
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
//#endregion
|
|
798
|
+
//#region ../../node_modules/.pnpm/ofetch@1.5.1/node_modules/ofetch/dist/shared/ofetch.BbrTaNPp.d.mts
|
|
799
|
+
interface FetchOptions<R extends ResponseType = ResponseType, T = any> extends Omit<RequestInit, "body">, FetchHooks<T, R> {
|
|
800
|
+
baseURL?: string;
|
|
801
|
+
body?: RequestInit["body"] | Record<string, any>;
|
|
802
|
+
ignoreResponseError?: boolean;
|
|
803
|
+
/**
|
|
804
|
+
* @deprecated use query instead.
|
|
805
|
+
*/
|
|
806
|
+
params?: Record<string, any>;
|
|
807
|
+
query?: Record<string, any>;
|
|
808
|
+
parseResponse?: (responseText: string) => any;
|
|
809
|
+
responseType?: R;
|
|
810
|
+
/**
|
|
811
|
+
* @experimental Set to "half" to enable duplex streaming.
|
|
812
|
+
* Will be automatically set to "half" when using a ReadableStream as body.
|
|
813
|
+
* @see https://fetch.spec.whatwg.org/#enumdef-requestduplex
|
|
814
|
+
*/
|
|
815
|
+
duplex?: "half" | undefined;
|
|
816
|
+
/**
|
|
817
|
+
* Only supported in Node.js >= 18 using undici
|
|
818
|
+
*
|
|
819
|
+
* @see https://undici.nodejs.org/#/docs/api/Dispatcher
|
|
820
|
+
*/
|
|
821
|
+
dispatcher?: InstanceType<typeof Dispatcher>;
|
|
822
|
+
/**
|
|
823
|
+
* Only supported older Node.js versions using node-fetch-native polyfill.
|
|
824
|
+
*/
|
|
825
|
+
agent?: unknown;
|
|
826
|
+
/** timeout in milliseconds */
|
|
827
|
+
timeout?: number;
|
|
828
|
+
retry?: number | false;
|
|
829
|
+
/** Delay between retries in milliseconds. */
|
|
830
|
+
retryDelay?: number | ((context: FetchContext<T, R>) => number);
|
|
831
|
+
/** Default is [408, 409, 425, 429, 500, 502, 503, 504] */
|
|
832
|
+
retryStatusCodes?: number[];
|
|
833
|
+
}
|
|
834
|
+
interface ResolvedFetchOptions<R extends ResponseType = ResponseType, T = any> extends FetchOptions<R, T> {
|
|
835
|
+
headers: Headers;
|
|
836
|
+
}
|
|
837
|
+
interface FetchContext<T = any, R extends ResponseType = ResponseType> {
|
|
838
|
+
request: FetchRequest;
|
|
839
|
+
options: ResolvedFetchOptions<R>;
|
|
840
|
+
response?: FetchResponse<T>;
|
|
841
|
+
error?: Error;
|
|
842
|
+
}
|
|
843
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
844
|
+
type MaybeArray<T> = T | T[];
|
|
845
|
+
type FetchHook<C extends FetchContext = FetchContext> = (context: C) => MaybePromise<void>;
|
|
846
|
+
interface FetchHooks<T = any, R extends ResponseType = ResponseType> {
|
|
847
|
+
onRequest?: MaybeArray<FetchHook<FetchContext<T, R>>>;
|
|
848
|
+
onRequestError?: MaybeArray<FetchHook<FetchContext<T, R> & {
|
|
849
|
+
error: Error;
|
|
850
|
+
}>>;
|
|
851
|
+
onResponse?: MaybeArray<FetchHook<FetchContext<T, R> & {
|
|
852
|
+
response: FetchResponse<T>;
|
|
853
|
+
}>>;
|
|
854
|
+
onResponseError?: MaybeArray<FetchHook<FetchContext<T, R> & {
|
|
855
|
+
response: FetchResponse<T>;
|
|
856
|
+
}>>;
|
|
857
|
+
}
|
|
858
|
+
interface ResponseMap {
|
|
859
|
+
blob: Blob;
|
|
860
|
+
text: string;
|
|
861
|
+
arrayBuffer: ArrayBuffer;
|
|
862
|
+
stream: ReadableStream<Uint8Array>;
|
|
863
|
+
}
|
|
864
|
+
type ResponseType = keyof ResponseMap | "json";
|
|
865
|
+
interface FetchResponse<T> extends Response {
|
|
866
|
+
_data?: T;
|
|
867
|
+
}
|
|
868
|
+
type FetchRequest = RequestInfo;
|
|
869
|
+
//#endregion
|
|
870
|
+
export { FetchOptions as t };
|