undici-types 6.21.0 → 6.24.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/errors.d.ts CHANGED
@@ -146,4 +146,10 @@ declare namespace Errors {
146
146
  name: 'SecureProxyConnectionError';
147
147
  code: 'UND_ERR_PRX_TLS';
148
148
  }
149
+
150
+ /** WebSocket decompressed message exceeded maximum size. */
151
+ export class MessageSizeExceededError extends UndiciError {
152
+ name: 'MessageSizeExceededError'
153
+ code: 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'
154
+ }
149
155
  }
package/interceptors.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { LookupOptions } from 'node:dns'
2
+
1
3
  import Dispatcher from "./dispatcher";
2
4
  import RetryHandler from "./retry-handler";
3
5
 
@@ -9,9 +11,22 @@ declare namespace Interceptors {
9
11
  export type RedirectInterceptorOpts = { maxRedirections?: number }
10
12
  export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
11
13
 
14
+ // DNS interceptor
15
+ export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
16
+ export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
17
+ export type DNSInterceptorOpts = {
18
+ maxTTL?: number
19
+ maxItems?: number
20
+ lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
21
+ pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
22
+ dualStack?: boolean
23
+ affinity?: 4 | 6
24
+ }
25
+
12
26
  export function createRedirectInterceptor(opts: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
13
27
  export function dump(opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
14
28
  export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
15
29
  export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
16
30
  export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
31
+ export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
17
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "6.21.0",
3
+ "version": "6.24.0",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
package/proxy-agent.d.ts CHANGED
@@ -24,5 +24,6 @@ declare namespace ProxyAgent {
24
24
  requestTls?: buildConnector.BuildOptions;
25
25
  proxyTls?: buildConnector.BuildOptions;
26
26
  clientFactory?(origin: URL, opts: object): Dispatcher;
27
+ proxyTunnel?: boolean;
27
28
  }
28
29
  }
@@ -32,7 +32,7 @@ declare namespace RetryHandler {
32
32
  };
33
33
  },
34
34
  callback: OnRetryCallback
35
- ) => number | null;
35
+ ) => void
36
36
 
37
37
  export interface RetryOptions {
38
38
  /**
package/websocket.d.ts CHANGED
@@ -146,5 +146,12 @@ export declare const ErrorEvent: {
146
146
  interface WebSocketInit {
147
147
  protocols?: string | string[],
148
148
  dispatcher?: Dispatcher,
149
- headers?: HeadersInit
149
+ headers?: HeadersInit,
150
+ /**
151
+ * Maximum size in bytes for decompressed WebSocket messages.
152
+ * When a message exceeds this limit during decompression, the connection
153
+ * will be closed with status code 1009 (Message Too Big).
154
+ * @default 4194304 (4 MB)
155
+ */
156
+ maxDecompressedMessageSize?: number
150
157
  }