undici-types 7.22.0 → 7.23.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/connector.d.ts CHANGED
@@ -13,6 +13,7 @@ declare namespace buildConnector {
13
13
  port?: number;
14
14
  keepAlive?: boolean | null;
15
15
  keepAliveInitialDelay?: number | null;
16
+ typeOfService?: number | null;
16
17
  }
17
18
 
18
19
  export interface Options {
@@ -22,6 +23,7 @@ declare namespace buildConnector {
22
23
  port: string
23
24
  servername?: string
24
25
  localAddress?: string | null
26
+ socketPath?: string | null
25
27
  httpSocket?: Socket
26
28
  }
27
29
 
package/dispatcher.d.ts CHANGED
@@ -96,7 +96,7 @@ declare class Dispatcher extends EventEmitter {
96
96
  }
97
97
 
98
98
  declare namespace Dispatcher {
99
- export interface ComposedDispatcher extends Dispatcher {}
99
+ export interface ComposedDispatcher extends Dispatcher { }
100
100
  export type Dispatch = Dispatcher['dispatch']
101
101
  export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch
102
102
  export interface DispatchOptions {
@@ -113,6 +113,8 @@ declare namespace Dispatcher {
113
113
  idempotent?: boolean;
114
114
  /** 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'`. */
115
115
  blocking?: boolean;
116
+ /** The IP Type of Service (ToS) value for the request socket. Must be an integer between 0 and 255. Default: `0` */
117
+ typeOfService?: number | null;
116
118
  /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
117
119
  upgrade?: boolean | string | null;
118
120
  /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
@@ -213,10 +215,10 @@ declare namespace Dispatcher {
213
215
  export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable
214
216
 
215
217
  export interface DispatchController {
216
- get aborted () : boolean
217
- get paused () : boolean
218
- get reason () : Error | null
219
- abort (reason: Error): void
218
+ get aborted(): boolean
219
+ get paused(): boolean
220
+ get reason(): Error | null
221
+ abort(reason: Error): void
220
222
  pause(): void
221
223
  resume(): void
222
224
  }
package/errors.d.ts CHANGED
@@ -154,8 +154,18 @@ declare namespace Errors {
154
154
  code: 'UND_ERR_PRX_TLS'
155
155
  }
156
156
 
157
- class MaxOriginsReachedError extends UndiciError {
157
+ export class MaxOriginsReachedError extends UndiciError {
158
158
  name: 'MaxOriginsReachedError'
159
159
  code: 'UND_ERR_MAX_ORIGINS_REACHED'
160
160
  }
161
+
162
+ /** SOCKS5 proxy related error. */
163
+ export class Socks5ProxyError extends UndiciError {
164
+ constructor (
165
+ message?: string,
166
+ code?: string
167
+ )
168
+ name: 'Socks5ProxyError'
169
+ code: string
170
+ }
161
171
  }
package/index.d.ts CHANGED
@@ -18,6 +18,7 @@ import { SnapshotAgent } from './snapshot-agent'
18
18
  import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
19
19
  import mockErrors from './mock-errors'
20
20
  import ProxyAgent from './proxy-agent'
21
+ import Socks5ProxyAgent from './socks5-proxy-agent'
21
22
  import EnvHttpProxyAgent from './env-http-proxy-agent'
22
23
  import RetryHandler from './retry-handler'
23
24
  import RetryAgent from './retry-agent'
@@ -43,7 +44,7 @@ export { Interceptable } from './mock-interceptor'
43
44
 
44
45
  declare function globalThisInstall (): void
45
46
 
46
- export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
47
+ export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, Socks5ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
47
48
  export default Undici
48
49
 
49
50
  declare namespace Undici {
@@ -73,6 +74,8 @@ declare namespace Undici {
73
74
  const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
74
75
  const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
75
76
  const mockErrors: typeof import('./mock-errors').default
77
+ const ProxyAgent: typeof import('./proxy-agent').default
78
+ const Socks5ProxyAgent: typeof import('./socks5-proxy-agent').default
76
79
  const fetch: typeof import('./fetch').fetch
77
80
  const Headers: typeof import('./fetch').Headers
78
81
  const Response: typeof import('./fetch').Response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "7.22.0",
3
+ "version": "7.23.0",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -0,0 +1,25 @@
1
+ import Dispatcher from './dispatcher'
2
+ import buildConnector from './connector'
3
+ import { IncomingHttpHeaders } from './header'
4
+ import Pool from './pool'
5
+
6
+ export default Socks5ProxyAgent
7
+
8
+ declare class Socks5ProxyAgent extends Dispatcher {
9
+ constructor (proxyUrl: string | URL, options?: Socks5ProxyAgent.Options)
10
+ }
11
+
12
+ declare namespace Socks5ProxyAgent {
13
+ export interface Options extends Pool.Options {
14
+ /** Additional headers to send with the proxy connection */
15
+ headers?: IncomingHttpHeaders;
16
+ /** SOCKS5 proxy username for authentication */
17
+ username?: string;
18
+ /** SOCKS5 proxy password for authentication */
19
+ password?: string;
20
+ /** Custom connector function for proxy connection */
21
+ connect?: buildConnector.connector;
22
+ /** TLS options for the proxy connection (for SOCKS5 over TLS) */
23
+ proxyTls?: buildConnector.BuildOptions;
24
+ }
25
+ }