aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/node_modules/undici/types
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-02-28 21:59:12 +0100
committerEgor Tensin <egor@tensin.name>2026-02-28 22:19:57 +0100
commit9611c248995ad3bacda1d0a93d0b5e1e6605d162 (patch)
treeeb3ae35b426e9d72e7cb34e8e9cc0453745a8e17 /node_modules/undici/types
parentDEVELOPMENT.md: expand on sources (diff)
downloadcleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.tar.gz
cleanup-path-9611c248995ad3bacda1d0a93d0b5e1e6605d162.zip
upgrade actions/core to version 2
Diffstat (limited to 'node_modules/undici/types')
-rw-r--r--node_modules/undici/types/balanced-pool.d.ts11
-rw-r--r--node_modules/undici/types/client.d.ts11
-rw-r--r--node_modules/undici/types/diagnostics-channel.d.ts3
-rw-r--r--node_modules/undici/types/dispatcher.d.ts23
-rw-r--r--node_modules/undici/types/env-http-proxy-agent.d.ts21
-rw-r--r--node_modules/undici/types/errors.d.ts21
-rw-r--r--node_modules/undici/types/eventsource.d.ts61
-rw-r--r--node_modules/undici/types/fetch.d.ts48
-rw-r--r--node_modules/undici/types/filereader.d.ts2
-rw-r--r--node_modules/undici/types/formdata.d.ts2
-rw-r--r--node_modules/undici/types/handlers.d.ts14
-rw-r--r--node_modules/undici/types/index.d.ts10
-rw-r--r--node_modules/undici/types/interceptors.d.ts31
-rw-r--r--node_modules/undici/types/mock-interceptor.d.ts8
-rw-r--r--node_modules/undici/types/patch.d.ts38
-rw-r--r--node_modules/undici/types/pool.d.ts11
-rw-r--r--node_modules/undici/types/proxy-agent.d.ts3
-rw-r--r--node_modules/undici/types/readable.d.ts10
-rw-r--r--node_modules/undici/types/retry-agent.d.ts8
-rw-r--r--node_modules/undici/types/retry-handler.d.ts4
-rw-r--r--node_modules/undici/types/util.d.ts18
-rw-r--r--node_modules/undici/types/webidl.d.ts24
-rw-r--r--node_modules/undici/types/websocket.d.ts25
23 files changed, 307 insertions, 100 deletions
diff --git a/node_modules/undici/types/balanced-pool.d.ts b/node_modules/undici/types/balanced-pool.d.ts
index d1e9375..7f930f4 100644
--- a/node_modules/undici/types/balanced-pool.d.ts
+++ b/node_modules/undici/types/balanced-pool.d.ts
@@ -4,6 +4,8 @@ import { URL } from 'url'
export default BalancedPool
+type BalancedPoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
+
declare class BalancedPool extends Dispatcher {
constructor(url: string | string[] | URL | URL[], options?: Pool.Options);
@@ -15,4 +17,13 @@ declare class BalancedPool extends Dispatcher {
closed: boolean;
/** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
destroyed: boolean;
+
+ // Override dispatcher APIs.
+ override connect(
+ options: BalancedPoolConnectOptions
+ ): Promise<Dispatcher.ConnectData>;
+ override connect(
+ options: BalancedPoolConnectOptions,
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
+ ): void;
}
diff --git a/node_modules/undici/types/client.d.ts b/node_modules/undici/types/client.d.ts
index 56e78cc..d0a5379 100644
--- a/node_modules/undici/types/client.d.ts
+++ b/node_modules/undici/types/client.d.ts
@@ -3,6 +3,8 @@ import { TlsOptions } from 'tls'
import Dispatcher from './dispatcher'
import buildConnector from "./connector";
+type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
+
/**
* A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
*/
@@ -14,6 +16,15 @@ export class Client extends Dispatcher {
closed: boolean;
/** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
destroyed: boolean;
+
+ // Override dispatcher APIs.
+ override connect(
+ options: ClientConnectOptions
+ ): Promise<Dispatcher.ConnectData>;
+ override connect(
+ options: ClientConnectOptions,
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
+ ): void;
}
export declare namespace Client {
diff --git a/node_modules/undici/types/diagnostics-channel.d.ts b/node_modules/undici/types/diagnostics-channel.d.ts
index 85d4482..a037d1e 100644
--- a/node_modules/undici/types/diagnostics-channel.d.ts
+++ b/node_modules/undici/types/diagnostics-channel.d.ts
@@ -9,8 +9,7 @@ declare namespace DiagnosticsChannel {
completed: boolean;
method?: Dispatcher.HttpMethod;
path: string;
- headers: string;
- addHeader(key: string, value: string): Request;
+ headers: any;
}
interface Response {
statusCode: number;
diff --git a/node_modules/undici/types/dispatcher.d.ts b/node_modules/undici/types/dispatcher.d.ts
index efc53ee..1b4c9c7 100644
--- a/node_modules/undici/types/dispatcher.d.ts
+++ b/node_modules/undici/types/dispatcher.d.ts
@@ -18,6 +18,9 @@ declare class Dispatcher extends EventEmitter {
/** Starts two-way communications with the requested resource. */
connect(options: Dispatcher.ConnectOptions): Promise<Dispatcher.ConnectData>;
connect(options: Dispatcher.ConnectOptions, callback: (err: Error | null, data: Dispatcher.ConnectData) => void): void;
+ /** Compose a chain of dispatchers */
+ compose(dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
+ compose(...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher;
/** Performs an HTTP request. */
request(options: Dispatcher.RequestOptions): Promise<Dispatcher.ResponseData>;
request(options: Dispatcher.RequestOptions, callback: (err: Error | null, data: Dispatcher.ResponseData) => void): void;
@@ -93,6 +96,8 @@ declare class Dispatcher extends EventEmitter {
}
declare namespace Dispatcher {
+ export interface ComposedDispatcher extends Dispatcher {}
+ export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch'];
export interface DispatchOptions {
origin?: string | URL;
path: string;
@@ -100,7 +105,7 @@ declare namespace Dispatcher {
/** Default: `null` */
body?: string | Buffer | Uint8Array | Readable | null | FormData;
/** Default: `null` */
- headers?: IncomingHttpHeaders | string[] | null;
+ headers?: IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null;
/** Query string params to be embedded in the request URL. Default: `null` */
query?: Record<string, any>;
/** 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`. */
@@ -121,6 +126,7 @@ declare namespace Dispatcher {
expectContinue?: boolean;
}
export interface ConnectOptions {
+ origin: string | URL;
path: string;
/** Default: `null` */
headers?: IncomingHttpHeaders | string[] | null;
@@ -130,6 +136,8 @@ declare namespace Dispatcher {
opaque?: unknown;
/** Default: 0 */
maxRedirections?: number;
+ /** Default: false */
+ redirectionLimitReached?: boolean;
/** Default: `null` */
responseHeader?: 'raw' | null;
}
@@ -140,6 +148,8 @@ declare namespace Dispatcher {
signal?: AbortSignal | EventEmitter | null;
/** Default: 0 */
maxRedirections?: number;
+ /** Default: false */
+ redirectionLimitReached?: boolean;
/** Default: `null` */
onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
/** Default: `null` */
@@ -163,6 +173,8 @@ declare namespace Dispatcher {
signal?: AbortSignal | EventEmitter | null;
/** Default: 0 */
maxRedirections?: number;
+ /** Default: false */
+ redirectionLimitReached?: boolean;
/** Default: `null` */
responseHeader?: 'raw' | null;
}
@@ -205,13 +217,15 @@ declare namespace Dispatcher {
export type StreamFactory = (data: StreamFactoryData) => Writable;
export interface DispatchHandlers {
/** 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. */
- onConnect?(abort: () => void): void;
+ onConnect?(abort: (err?: Error) => void): void;
/** Invoked when an error has occurred. */
onError?(err: Error): void;
/** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
+ /** Invoked when response is received, before headers have been read. **/
+ onResponseStarted?(): void;
/** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
- onHeaders?(statusCode: number, headers: Buffer[] | string[] | null, resume: () => void, statusText: string): boolean;
+ onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
/** Invoked when response payload data is received. */
onData?(chunk: Buffer): boolean;
/** Invoked when response payload and trailers have been received and the request has completed. */
@@ -226,10 +240,11 @@ declare namespace Dispatcher {
* @link https://fetch.spec.whatwg.org/#body-mixin
*/
interface BodyMixin {
- readonly body?: never; // throws on node v16.6.0
+ readonly body?: never;
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
+ bytes(): Promise<Uint8Array>;
formData(): Promise<never>;
json(): Promise<unknown>;
text(): Promise<string>;
diff --git a/node_modules/undici/types/env-http-proxy-agent.d.ts b/node_modules/undici/types/env-http-proxy-agent.d.ts
new file mode 100644
index 0000000..d6509dc
--- /dev/null
+++ b/node_modules/undici/types/env-http-proxy-agent.d.ts
@@ -0,0 +1,21 @@
+import Agent from './agent'
+import Dispatcher from './dispatcher'
+
+export default EnvHttpProxyAgent
+
+declare class EnvHttpProxyAgent extends Dispatcher {
+ constructor(opts?: EnvHttpProxyAgent.Options)
+
+ dispatch(options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandlers): boolean;
+}
+
+declare namespace EnvHttpProxyAgent {
+ export interface Options extends Agent.Options {
+ /** Overrides the value of the HTTP_PROXY environment variable */
+ httpProxy?: string;
+ /** Overrides the value of the HTTPS_PROXY environment variable */
+ httpsProxy?: string;
+ /** Overrides the value of the NO_PROXY environment variable */
+ noProxy?: string;
+ }
+}
diff --git a/node_modules/undici/types/errors.d.ts b/node_modules/undici/types/errors.d.ts
index 7923ddd..f6fb73b 100644
--- a/node_modules/undici/types/errors.d.ts
+++ b/node_modules/undici/types/errors.d.ts
@@ -125,4 +125,25 @@ declare namespace Errors {
name: 'ResponseExceededMaxSizeError';
code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE';
}
+
+ export class RequestRetryError extends UndiciError {
+ constructor (
+ message: string,
+ statusCode: number,
+ headers?: IncomingHttpHeaders | string[] | null,
+ body?: null | Record<string, any> | string
+ );
+ name: 'RequestRetryError';
+ code: 'UND_ERR_REQ_RETRY';
+ statusCode: number;
+ data: {
+ count: number;
+ };
+ headers: Record<string, string | string[]>;
+ }
+
+ export class SecureProxyConnectionError extends UndiciError {
+ name: 'SecureProxyConnectionError';
+ code: 'UND_ERR_PRX_TLS';
+ }
}
diff --git a/node_modules/undici/types/eventsource.d.ts b/node_modules/undici/types/eventsource.d.ts
new file mode 100644
index 0000000..deccd73
--- /dev/null
+++ b/node_modules/undici/types/eventsource.d.ts
@@ -0,0 +1,61 @@
+import { MessageEvent, ErrorEvent } from './websocket'
+import Dispatcher from './dispatcher'
+
+import {
+ EventListenerOptions,
+ AddEventListenerOptions,
+ EventListenerOrEventListenerObject
+} from './patch'
+
+interface EventSourceEventMap {
+ error: ErrorEvent
+ message: MessageEvent
+ open: Event
+}
+
+interface EventSource extends EventTarget {
+ close(): void
+ readonly CLOSED: 2
+ readonly CONNECTING: 0
+ readonly OPEN: 1
+ onerror: (this: EventSource, ev: ErrorEvent) => any
+ onmessage: (this: EventSource, ev: MessageEvent) => any
+ onopen: (this: EventSource, ev: Event) => any
+ readonly readyState: 0 | 1 | 2
+ readonly url: string
+ readonly withCredentials: boolean
+
+ addEventListener<K extends keyof EventSourceEventMap>(
+ type: K,
+ listener: (this: EventSource, ev: EventSourceEventMap[K]) => any,
+ options?: boolean | AddEventListenerOptions
+ ): void
+ addEventListener(
+ type: string,
+ listener: EventListenerOrEventListenerObject,
+ options?: boolean | AddEventListenerOptions
+ ): void
+ removeEventListener<K extends keyof EventSourceEventMap>(
+ type: K,
+ listener: (this: EventSource, ev: EventSourceEventMap[K]) => any,
+ options?: boolean | EventListenerOptions
+ ): void
+ removeEventListener(
+ type: string,
+ listener: EventListenerOrEventListenerObject,
+ options?: boolean | EventListenerOptions
+ ): void
+}
+
+export declare const EventSource: {
+ prototype: EventSource
+ new (url: string | URL, init?: EventSourceInit): EventSource
+ readonly CLOSED: 2
+ readonly CONNECTING: 0
+ readonly OPEN: 1
+}
+
+interface EventSourceInit {
+ withCredentials?: boolean,
+ dispatcher?: Dispatcher
+}
diff --git a/node_modules/undici/types/fetch.d.ts b/node_modules/undici/types/fetch.d.ts
index 440f2b0..7e94375 100644
--- a/node_modules/undici/types/fetch.d.ts
+++ b/node_modules/undici/types/fetch.d.ts
@@ -27,12 +27,29 @@ export type BodyInit =
| null
| string
-export interface BodyMixin {
+export class BodyMixin {
readonly body: ReadableStream | null
readonly bodyUsed: boolean
readonly arrayBuffer: () => Promise<ArrayBuffer>
readonly blob: () => Promise<Blob>
+ /**
+ * @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments.
+ * It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows:
+ *
+ * @example
+ * ```js
+ * import { Busboy } from '@fastify/busboy'
+ * import { Readable } from 'node:stream'
+ *
+ * const response = await fetch('...')
+ * const busboy = new Busboy({ headers: { 'content-type': response.headers.get('content-type') } })
+ *
+ * // handle events emitted from `busboy`
+ *
+ * Readable.fromWeb(response.body).pipe(busboy)
+ * ```
+ */
readonly formData: () => Promise<FormData>
readonly json: () => Promise<unknown>
readonly text: () => Promise<string>
@@ -68,7 +85,7 @@ export declare class Headers implements SpecIterable<[string, string]> {
readonly keys: () => SpecIterableIterator<string>
readonly values: () => SpecIterableIterator<string>
readonly entries: () => SpecIterableIterator<[string, string]>
- readonly [Symbol.iterator]: () => SpecIterator<[string, string]>
+ readonly [Symbol.iterator]: () => SpecIterableIterator<[string, string]>
}
export type RequestCache =
@@ -105,7 +122,7 @@ export interface RequestInit {
method?: string
keepalive?: boolean
headers?: HeadersInit
- body?: BodyInit
+ body?: BodyInit | null
redirect?: RequestRedirect
integrity?: string
signal?: AbortSignal | null
@@ -135,7 +152,7 @@ export type RequestRedirect = 'error' | 'follow' | 'manual'
export type RequestDuplex = 'half'
-export declare class Request implements BodyMixin {
+export declare class Request extends BodyMixin {
constructor (input: RequestInfo, init?: RequestInit)
readonly cache: RequestCache
@@ -146,22 +163,14 @@ export declare class Request implements BodyMixin {
readonly method: string
readonly mode: RequestMode
readonly redirect: RequestRedirect
- readonly referrerPolicy: string
+ readonly referrer: string
+ readonly referrerPolicy: ReferrerPolicy
readonly url: string
readonly keepalive: boolean
readonly signal: AbortSignal
readonly duplex: RequestDuplex
- readonly body: ReadableStream | null
- readonly bodyUsed: boolean
-
- readonly arrayBuffer: () => Promise<ArrayBuffer>
- readonly blob: () => Promise<Blob>
- readonly formData: () => Promise<FormData>
- readonly json: () => Promise<unknown>
- readonly text: () => Promise<string>
-
readonly clone: () => Request
}
@@ -181,7 +190,7 @@ export type ResponseType =
export type ResponseRedirectStatus = 301 | 302 | 303 | 307 | 308
-export declare class Response implements BodyMixin {
+export declare class Response extends BodyMixin {
constructor (body?: BodyInit, init?: ResponseInit)
readonly headers: Headers
@@ -192,15 +201,6 @@ export declare class Response implements BodyMixin {
readonly url: string
readonly redirected: boolean
- readonly body: ReadableStream | null
- readonly bodyUsed: boolean
-
- readonly arrayBuffer: () => Promise<ArrayBuffer>
- readonly blob: () => Promise<Blob>
- readonly formData: () => Promise<FormData>
- readonly json: () => Promise<unknown>
- readonly text: () => Promise<string>
-
readonly clone: () => Response
static error (): Response
diff --git a/node_modules/undici/types/filereader.d.ts b/node_modules/undici/types/filereader.d.ts
index f05d231..d1c0f9e 100644
--- a/node_modules/undici/types/filereader.d.ts
+++ b/node_modules/undici/types/filereader.d.ts
@@ -1,7 +1,7 @@
/// <reference types="node" />
import { Blob } from 'buffer'
-import { DOMException, Event, EventInit, EventTarget } from './patch'
+import { DOMException, EventInit } from './patch'
export declare class FileReader {
__proto__: EventTarget & FileReader
diff --git a/node_modules/undici/types/formdata.d.ts b/node_modules/undici/types/formdata.d.ts
index df29a57..e676b11 100644
--- a/node_modules/undici/types/formdata.d.ts
+++ b/node_modules/undici/types/formdata.d.ts
@@ -2,7 +2,7 @@
/// <reference types="node" />
import { File } from './file'
-import { SpecIterator, SpecIterableIterator } from './fetch'
+import { SpecIterableIterator } from './fetch'
/**
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
diff --git a/node_modules/undici/types/handlers.d.ts b/node_modules/undici/types/handlers.d.ts
index eb4f5a9..afcda9a 100644
--- a/node_modules/undici/types/handlers.d.ts
+++ b/node_modules/undici/types/handlers.d.ts
@@ -1,9 +1,15 @@
import Dispatcher from "./dispatcher";
-export declare class RedirectHandler implements Dispatcher.DispatchHandlers{
- constructor (dispatch: Dispatcher, maxRedirections: number, opts: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandlers)
+export declare class RedirectHandler implements Dispatcher.DispatchHandlers {
+ constructor(
+ dispatch: Dispatcher,
+ maxRedirections: number,
+ opts: Dispatcher.DispatchOptions,
+ handler: Dispatcher.DispatchHandlers,
+ redirectionLimitReached: boolean
+ );
}
-export declare class DecoratorHandler implements Dispatcher.DispatchHandlers{
- constructor (handler: Dispatcher.DispatchHandlers)
+export declare class DecoratorHandler implements Dispatcher.DispatchHandlers {
+ constructor(handler: Dispatcher.DispatchHandlers);
}
diff --git a/node_modules/undici/types/index.d.ts b/node_modules/undici/types/index.d.ts
index 0ea8bdc..f6be35c 100644
--- a/node_modules/undici/types/index.d.ts
+++ b/node_modules/undici/types/index.d.ts
@@ -14,10 +14,15 @@ import MockPool from'./mock-pool'
import MockAgent from'./mock-agent'
import mockErrors from'./mock-errors'
import ProxyAgent from'./proxy-agent'
+import EnvHttpProxyAgent from './env-http-proxy-agent'
import RetryHandler from'./retry-handler'
+import RetryAgent from'./retry-agent'
import { request, pipeline, stream, connect, upgrade } from './api'
+import interceptors from './interceptors'
+export * from './util'
export * from './cookies'
+export * from './eventsource'
export * from './fetch'
export * from './file'
export * from './filereader'
@@ -28,7 +33,7 @@ export * from './content-type'
export * from './cache'
export { Interceptable } from './mock-interceptor'
-export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler }
+export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent }
export default Undici
declare namespace Undici {
@@ -37,7 +42,7 @@ declare namespace Undici {
var RedirectHandler: typeof import ('./handlers').RedirectHandler
var DecoratorHandler: typeof import ('./handlers').DecoratorHandler
var RetryHandler: typeof import ('./retry-handler').default
- var createRedirectInterceptor: typeof import ('./interceptors').createRedirectInterceptor
+ var createRedirectInterceptor: typeof import ('./interceptors').default.createRedirectInterceptor
var BalancedPool: typeof import('./balanced-pool').default;
var Client: typeof import('./client').default;
var buildConnector: typeof import('./connector').default;
@@ -62,4 +67,5 @@ declare namespace Undici {
var File: typeof import('./file').File;
var FileReader: typeof import('./filereader').FileReader;
var caches: typeof import('./cache').caches;
+ var interceptors: typeof import('./interceptors').default;
}
diff --git a/node_modules/undici/types/interceptors.d.ts b/node_modules/undici/types/interceptors.d.ts
index 047ac17..9f6af12 100644
--- a/node_modules/undici/types/interceptors.d.ts
+++ b/node_modules/undici/types/interceptors.d.ts
@@ -1,5 +1,32 @@
+import { LookupOptions } from 'node:dns'
+
import Dispatcher from "./dispatcher";
+import RetryHandler from "./retry-handler";
+
+export default Interceptors;
+
+declare namespace Interceptors {
+ export type DumpInterceptorOpts = { maxSize?: number }
+ export type RetryInterceptorOpts = RetryHandler.RetryOptions
+ export type RedirectInterceptorOpts = { maxRedirections?: number }
+ export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
-type RedirectInterceptorOpts = { maxRedirections?: number }
+ // DNS interceptor
+ export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
+ export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
+ export type DNSInterceptorOpts = {
+ maxTTL?: number
+ maxItems?: number
+ lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
+ pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
+ dualStack?: boolean
+ affinity?: 4 | 6
+ }
-export declare function createRedirectInterceptor (opts: RedirectInterceptorOpts): Dispatcher.DispatchInterceptor
+ export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+ export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
+}
diff --git a/node_modules/undici/types/mock-interceptor.d.ts b/node_modules/undici/types/mock-interceptor.d.ts
index 6b3961c..33f3f14 100644
--- a/node_modules/undici/types/mock-interceptor.d.ts
+++ b/node_modules/undici/types/mock-interceptor.d.ts
@@ -71,11 +71,11 @@ declare namespace MockInterceptor {
export interface MockResponseCallbackOptions {
path: string;
- origin: string;
method: string;
- body?: BodyInit | Dispatcher.DispatchOptions['body'];
- headers: Headers | Record<string, string>;
- maxRedirections: number;
+ headers?: Headers | Record<string, string>;
+ origin?: string;
+ body?: BodyInit | Dispatcher.DispatchOptions['body'] | null;
+ maxRedirections?: number;
}
export type MockResponseDataHandler<TData extends object = object> = (
diff --git a/node_modules/undici/types/patch.d.ts b/node_modules/undici/types/patch.d.ts
index 3871acf..4ac3845 100644
--- a/node_modules/undici/types/patch.d.ts
+++ b/node_modules/undici/types/patch.d.ts
@@ -6,44 +6,6 @@ export type DOMException = typeof globalThis extends { DOMException: infer T }
? T
: any
-export type EventTarget = typeof globalThis extends { EventTarget: infer T }
- ? T
- : {
- addEventListener(
- type: string,
- listener: any,
- options?: any,
- ): void
- dispatchEvent(event: Event): boolean
- removeEventListener(
- type: string,
- listener: any,
- options?: any | boolean,
- ): void
- }
-
-export type Event = typeof globalThis extends { Event: infer T }
- ? T
- : {
- readonly bubbles: boolean
- cancelBubble: () => void
- readonly cancelable: boolean
- readonly composed: boolean
- composedPath(): [EventTarget?]
- readonly currentTarget: EventTarget | null
- readonly defaultPrevented: boolean
- readonly eventPhase: 0 | 2
- readonly isTrusted: boolean
- preventDefault(): void
- returnValue: boolean
- readonly srcElement: EventTarget | null
- stopImmediatePropagation(): void
- stopPropagation(): void
- readonly target: EventTarget | null
- readonly timeStamp: number
- readonly type: string
- }
-
export interface EventInit {
bubbles?: boolean
cancelable?: boolean
diff --git a/node_modules/undici/types/pool.d.ts b/node_modules/undici/types/pool.d.ts
index 7747d48..bad5ba0 100644
--- a/node_modules/undici/types/pool.d.ts
+++ b/node_modules/undici/types/pool.d.ts
@@ -5,6 +5,8 @@ import Dispatcher from "./dispatcher";
export default Pool
+type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, "origin">;
+
declare class Pool extends Dispatcher {
constructor(url: string | URL, options?: Pool.Options)
/** `true` after `pool.close()` has been called. */
@@ -13,6 +15,15 @@ declare class Pool extends Dispatcher {
destroyed: boolean;
/** Aggregate stats for a Pool. */
readonly stats: TPoolStats;
+
+ // Override dispatcher APIs.
+ override connect(
+ options: PoolConnectOptions
+ ): Promise<Dispatcher.ConnectData>;
+ override connect(
+ options: PoolConnectOptions,
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
+ ): void;
}
declare namespace Pool {
diff --git a/node_modules/undici/types/proxy-agent.d.ts b/node_modules/undici/types/proxy-agent.d.ts
index 96b2638..27e237c 100644
--- a/node_modules/undici/types/proxy-agent.d.ts
+++ b/node_modules/undici/types/proxy-agent.d.ts
@@ -1,9 +1,7 @@
import Agent from './agent'
import buildConnector from './connector';
-import Client from './client'
import Dispatcher from './dispatcher'
import { IncomingHttpHeaders } from './header'
-import Pool from './pool'
export default ProxyAgent
@@ -26,5 +24,6 @@ declare namespace ProxyAgent {
requestTls?: buildConnector.BuildOptions;
proxyTls?: buildConnector.BuildOptions;
clientFactory?(origin: URL, opts: object): Dispatcher;
+ proxyTunnel?: boolean;
}
}
diff --git a/node_modules/undici/types/readable.d.ts b/node_modules/undici/types/readable.d.ts
index 4549a8c..c4f052a 100644
--- a/node_modules/undici/types/readable.d.ts
+++ b/node_modules/undici/types/readable.d.ts
@@ -25,6 +25,11 @@ declare class BodyReadable extends Readable {
*/
blob(): Promise<Blob>
+ /** Consumes and returns the body as an Uint8Array
+ * https://fetch.spec.whatwg.org/#dom-body-bytes
+ */
+ bytes(): Promise<Uint8Array>
+
/** Consumes and returns the body as an ArrayBuffer
* https://fetch.spec.whatwg.org/#dom-body-arraybuffer
*/
@@ -44,9 +49,8 @@ declare class BodyReadable extends Readable {
*/
readonly bodyUsed: boolean
- /** Throws on node 16.6.0
- *
- * If body is null, it should return null as the body
+ /**
+ * If body is null, it should return null as the body
*
* If body is not null, should return the body as a ReadableStream
*
diff --git a/node_modules/undici/types/retry-agent.d.ts b/node_modules/undici/types/retry-agent.d.ts
new file mode 100644
index 0000000..963cea9
--- /dev/null
+++ b/node_modules/undici/types/retry-agent.d.ts
@@ -0,0 +1,8 @@
+import Dispatcher from './dispatcher'
+import RetryHandler from './retry-handler'
+
+export default RetryAgent
+
+declare class RetryAgent extends Dispatcher {
+ constructor(dispatcher: Dispatcher, options?: RetryHandler.RetryOptions)
+}
diff --git a/node_modules/undici/types/retry-handler.d.ts b/node_modules/undici/types/retry-handler.d.ts
index 0528eb4..6cb34c1 100644
--- a/node_modules/undici/types/retry-handler.d.ts
+++ b/node_modules/undici/types/retry-handler.d.ts
@@ -12,7 +12,7 @@ declare class RetryHandler implements Dispatcher.DispatchHandlers {
}
declare namespace RetryHandler {
- export type RetryState = { counter: number; currentTimeout: number };
+ export type RetryState = { counter: number; };
export type RetryContext = {
state: RetryState;
@@ -32,7 +32,7 @@ declare namespace RetryHandler {
};
},
callback: OnRetryCallback
- ) => number | null;
+ ) => void
export interface RetryOptions {
/**
diff --git a/node_modules/undici/types/util.d.ts b/node_modules/undici/types/util.d.ts
new file mode 100644
index 0000000..77cf147
--- /dev/null
+++ b/node_modules/undici/types/util.d.ts
@@ -0,0 +1,18 @@
+export namespace util {
+ /**
+ * Retrieves a header name and returns its lowercase value.
+ * @param value Header name
+ */
+ export function headerNameToString(value: string | Buffer): string;
+
+ /**
+ * Receives a header object and returns the parsed value.
+ * @param headers Header object
+ * @param obj Object to specify a proxy object. Used to assign parsed values.
+ * @returns If `obj` is specified, it is equivalent to `obj`.
+ */
+ export function parseHeaders(
+ headers: (Buffer | string | (Buffer | string)[])[],
+ obj?: Record<string, string | string[]>
+ ): Record<string, string | string[]>;
+}
diff --git a/node_modules/undici/types/webidl.d.ts b/node_modules/undici/types/webidl.d.ts
index 40cfe06..fd83b68 100644
--- a/node_modules/undici/types/webidl.d.ts
+++ b/node_modules/undici/types/webidl.d.ts
@@ -5,7 +5,7 @@
*/
type Converter<T> = (object: unknown) => T
-type SequenceConverter<T> = (object: unknown) => T[]
+type SequenceConverter<T> = (object: unknown, iterable?: IterableIterator<T>) => T[]
type RecordConverter<K extends string, V> = (object: unknown) => Record<K, V>
@@ -62,20 +62,31 @@ interface WebidlUtil {
* @see https://webidl.spec.whatwg.org/#abstract-opdef-converttoint
*/
IntegerPart (N: number): number
+
+ /**
+ * Stringifies {@param V}
+ */
+ Stringify (V: any): string
+
+ /**
+ * Mark a value as uncloneable for Node.js.
+ * This is only effective in some newer Node.js versions.
+ */
+ markAsUncloneable (V: any): void
}
interface WebidlConverters {
/**
* @see https://webidl.spec.whatwg.org/#es-DOMString
*/
- DOMString (V: unknown, opts?: {
+ DOMString (V: unknown, prefix: string, argument: string, opts?: {
legacyNullToEmptyString: boolean
}): string
/**
* @see https://webidl.spec.whatwg.org/#es-ByteString
*/
- ByteString (V: unknown): string
+ ByteString (V: unknown, prefix: string, argument: string): string
/**
* @see https://webidl.spec.whatwg.org/#es-USVString
@@ -199,7 +210,7 @@ export interface Webidl {
*/
dictionaryConverter (converters: {
key: string,
- defaultValue?: unknown,
+ defaultValue?: () => unknown,
required?: boolean,
converter: (...args: unknown[]) => unknown,
allowedValues?: unknown[]
@@ -213,8 +224,5 @@ export interface Webidl {
converter: Converter<T>
): (V: unknown) => ReturnType<typeof converter> | null
- argumentLengthCheck (args: { length: number }, min: number, context: {
- header: string
- message?: string
- }): void
+ argumentLengthCheck (args: { length: number }, min: number, context: string): void
}
diff --git a/node_modules/undici/types/websocket.d.ts b/node_modules/undici/types/websocket.d.ts
index 15a357d..dfdd815 100644
--- a/node_modules/undici/types/websocket.d.ts
+++ b/node_modules/undici/types/websocket.d.ts
@@ -3,8 +3,6 @@
import type { Blob } from 'buffer'
import type { MessagePort } from 'worker_threads'
import {
- EventTarget,
- Event,
EventInit,
EventListenerOptions,
AddEventListenerOptions,
@@ -17,7 +15,7 @@ export type BinaryType = 'blob' | 'arraybuffer'
interface WebSocketEventMap {
close: CloseEvent
- error: Event
+ error: ErrorEvent
message: MessageEvent
open: Event
}
@@ -124,6 +122,27 @@ export declare const MessageEvent: {
new<T>(type: string, eventInitDict?: MessageEventInit<T>): MessageEvent<T>
}
+interface ErrorEventInit extends EventInit {
+ message?: string
+ filename?: string
+ lineno?: number
+ colno?: number
+ error?: any
+}
+
+interface ErrorEvent extends Event {
+ readonly message: string
+ readonly filename: string
+ readonly lineno: number
+ readonly colno: number
+ readonly error: any
+}
+
+export declare const ErrorEvent: {
+ prototype: ErrorEvent
+ new (type: string, eventInitDict?: ErrorEventInit): ErrorEvent
+}
+
interface WebSocketInit {
protocols?: string | string[],
dispatcher?: Dispatcher,