@idlebox/stripe-node-types 24.0.14-patch.0 → 24.0.14

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.
Files changed (111) hide show
  1. package/assert/strict.d.ts +15 -0
  2. package/assert.d.ts +15 -0
  3. package/async_hooks.d.ts +15 -0
  4. package/buffer.buffer.d.ts +15 -0
  5. package/buffer.d.ts +15 -0
  6. package/child_process.d.ts +15 -0
  7. package/cluster.d.ts +15 -0
  8. package/compatibility/iterators.d.ts +15 -0
  9. package/console.d.ts +15 -0
  10. package/constants.d.ts +15 -0
  11. package/crypto.d.ts +15 -0
  12. package/dgram.d.ts +15 -0
  13. package/diagnostics_channel.d.ts +15 -0
  14. package/dns/promises.d.ts +15 -0
  15. package/dns.d.ts +15 -0
  16. package/dom-events.d.ts +15 -0
  17. package/domain.d.ts +15 -0
  18. package/events.d.ts +15 -0
  19. package/fs/promises.d.ts +15 -0
  20. package/fs.d.ts +15 -0
  21. package/globals.d.ts +15 -0
  22. package/globals.typedarray.d.ts +15 -0
  23. package/http.d.ts +15 -0
  24. package/http2.d.ts +15 -0
  25. package/https.d.ts +15 -0
  26. package/index.d.ts +15 -0
  27. package/inspector.d.ts +15 -0
  28. package/module.d.ts +15 -0
  29. package/my-shim.d.ts +15 -0
  30. package/net.d.ts +15 -0
  31. package/os.d.ts +15 -0
  32. package/package.json +1 -1
  33. package/path.d.ts +15 -0
  34. package/perf_hooks.d.ts +15 -0
  35. package/process.d.ts +15 -0
  36. package/punycode.d.ts +15 -0
  37. package/querystring.d.ts +15 -0
  38. package/readline/promises.d.ts +15 -0
  39. package/readline.d.ts +15 -0
  40. package/repl.d.ts +15 -0
  41. package/sea.d.ts +15 -0
  42. package/sqlite.d.ts +15 -0
  43. package/stream/consumers.d.ts +15 -0
  44. package/stream/promises.d.ts +15 -0
  45. package/stream/web.d.ts +15 -0
  46. package/stream.d.ts +15 -0
  47. package/string_decoder.d.ts +15 -0
  48. package/test.d.ts +15 -0
  49. package/timers/promises.d.ts +15 -0
  50. package/timers.d.ts +15 -0
  51. package/tls.d.ts +15 -0
  52. package/trace_events.d.ts +15 -0
  53. package/ts5.1/compatibility/disposable.d.ts +15 -0
  54. package/ts5.1/index.d.ts +15 -0
  55. package/ts5.6/buffer.buffer.d.ts +15 -0
  56. package/ts5.6/compatibility/float16array.d.ts +15 -0
  57. package/ts5.6/globals.typedarray.d.ts +15 -0
  58. package/ts5.6/index.d.ts +15 -0
  59. package/ts5.7/compatibility/float16array.d.ts +15 -0
  60. package/ts5.7/index.d.ts +15 -0
  61. package/tty.d.ts +15 -0
  62. package/undici-types/agent.d.ts +20 -4
  63. package/undici-types/api.d.ts +15 -0
  64. package/undici-types/balanced-pool.d.ts +15 -0
  65. package/undici-types/cache-interceptor.d.ts +15 -0
  66. package/undici-types/cache.d.ts +15 -0
  67. package/undici-types/client-stats.d.ts +31 -0
  68. package/undici-types/client.d.ts +21 -5
  69. package/undici-types/connector.d.ts +15 -0
  70. package/undici-types/content-type.d.ts +15 -0
  71. package/undici-types/cookies.d.ts +15 -0
  72. package/undici-types/diagnostics-channel.d.ts +24 -1
  73. package/undici-types/dispatcher.d.ts +18 -8
  74. package/undici-types/env-http-proxy-agent.d.ts +17 -1
  75. package/undici-types/errors.d.ts +20 -15
  76. package/undici-types/eventsource.d.ts +24 -4
  77. package/undici-types/fetch.d.ts +16 -0
  78. package/undici-types/formdata.d.ts +15 -0
  79. package/undici-types/global-dispatcher.d.ts +15 -0
  80. package/undici-types/global-origin.d.ts +15 -0
  81. package/undici-types/h2c-client.d.ts +15 -2
  82. package/undici-types/handlers.d.ts +16 -1
  83. package/undici-types/header.d.ts +15 -0
  84. package/undici-types/index.d.ts +21 -1
  85. package/undici-types/interceptors.d.ts +20 -0
  86. package/undici-types/mock-agent.d.ts +18 -0
  87. package/undici-types/mock-call-history.d.ts +15 -0
  88. package/undici-types/mock-client.d.ts +17 -0
  89. package/undici-types/mock-errors.d.ts +15 -0
  90. package/undici-types/mock-interceptor.d.ts +17 -1
  91. package/undici-types/mock-pool.d.ts +17 -0
  92. package/undici-types/package.json +1 -1
  93. package/undici-types/patch.d.ts +15 -0
  94. package/undici-types/pool-stats.d.ts +15 -0
  95. package/undici-types/pool.d.ts +17 -0
  96. package/undici-types/proxy-agent.d.ts +16 -0
  97. package/undici-types/readable.d.ts +15 -0
  98. package/undici-types/retry-agent.d.ts +15 -0
  99. package/undici-types/retry-handler.d.ts +24 -0
  100. package/undici-types/snapshot-agent.d.ts +125 -0
  101. package/undici-types/util.d.ts +15 -0
  102. package/undici-types/utility.d.ts +15 -0
  103. package/undici-types/webidl.d.ts +126 -36
  104. package/undici-types/websocket.d.ts +18 -1
  105. package/url.d.ts +15 -0
  106. package/util.d.ts +15 -0
  107. package/v8.d.ts +15 -0
  108. package/vm.d.ts +15 -0
  109. package/wasi.d.ts +15 -0
  110. package/worker_threads.d.ts +15 -0
  111. package/zlib.d.ts +15 -0
@@ -0,0 +1,31 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
16
+ import Client from './client'
17
+
18
+ export default ClientStats
19
+
20
+ declare class ClientStats {
21
+ constructor (pool: Client)
22
+ /** If socket has open connection. */
23
+ connected: boolean
24
+ /** Number of open socket connections in this client that do not have an active request. */
25
+ pending: number
26
+ /** Number of currently active requests of this client. */
27
+ running: number
28
+ /** Number of active, pending, or queued requests of this client. */
29
+ size: number
30
+ }
31
+
@@ -1,6 +1,22 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { URL } from 'node:url'
2
17
  import Dispatcher from './dispatcher'
3
18
  import buildConnector from './connector'
19
+ import TClientStats from './client-stats'
4
20
 
5
21
  type ClientConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
6
22
 
@@ -15,6 +31,8 @@ export class Client extends Dispatcher {
15
31
  closed: boolean
16
32
  /** `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed. */
17
33
  destroyed: boolean
34
+ /** Aggregate stats for a Client. */
35
+ readonly stats: TClientStats
18
36
 
19
37
  // Override dispatcher APIs.
20
38
  override connect (
@@ -68,8 +86,6 @@ export declare namespace Client {
68
86
  /** TODO */
69
87
  maxCachedSessions?: number;
70
88
  /** TODO */
71
- maxRedirections?: number;
72
- /** TODO */
73
89
  connect?: Partial<buildConnector.BuildOptions> | buildConnector.connector;
74
90
  /** TODO */
75
91
  maxRequestsPerClient?: number;
@@ -84,13 +100,13 @@ export declare namespace Client {
84
100
  /**
85
101
  * @description Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
86
102
  * @default false
87
- */
103
+ */
88
104
  allowH2?: boolean;
89
105
  /**
90
106
  * @description Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
91
107
  * @default 100
92
- */
93
- maxConcurrentStreams?: number
108
+ */
109
+ maxConcurrentStreams?: number;
94
110
  }
95
111
  export interface SocketInfo {
96
112
  localAddress?: string
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { TLSSocket, ConnectionOptions } from 'node:tls'
2
17
  import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'node:net'
3
18
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  /// <reference types="node" />
2
17
 
3
18
  interface MIMEType {
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  /// <reference types="node" />
2
17
 
3
18
  import type { Headers } from './fetch'
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { Socket } from 'node:net'
2
17
  import { URL } from 'node:url'
3
18
  import buildConnector from './connector'
@@ -16,7 +31,6 @@ declare namespace DiagnosticsChannel {
16
31
  statusText: string;
17
32
  headers: Array<Buffer>;
18
33
  }
19
- type Error = unknown
20
34
  interface ConnectParams {
21
35
  host: URL['host'];
22
36
  hostname: URL['hostname'];
@@ -31,6 +45,15 @@ declare namespace DiagnosticsChannel {
31
45
  export interface RequestBodySentMessage {
32
46
  request: Request;
33
47
  }
48
+
49
+ export interface RequestBodyChunkSentMessage {
50
+ request: Request;
51
+ chunk: Uint8Array | string;
52
+ }
53
+ export interface RequestBodyChunkReceivedMessage {
54
+ request: Request;
55
+ chunk: Buffer;
56
+ }
34
57
  export interface RequestHeadersMessage {
35
58
  request: Request;
36
59
  response: Response;
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { URL } from 'node:url'
2
17
  import { Duplex, Readable, Writable } from 'node:stream'
3
18
  import { EventEmitter } from 'node:events'
@@ -97,7 +112,8 @@ declare class Dispatcher extends EventEmitter {
97
112
 
98
113
  declare namespace Dispatcher {
99
114
  export interface ComposedDispatcher extends Dispatcher {}
100
- export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch']
115
+ export type Dispatch = Dispatcher['dispatch']
116
+ export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch
101
117
  export interface DispatchOptions {
102
118
  origin?: string | URL;
103
119
  path: string;
@@ -134,8 +150,6 @@ declare namespace Dispatcher {
134
150
  signal?: AbortSignal | EventEmitter | null;
135
151
  /** This argument parameter is passed through to `ConnectData` */
136
152
  opaque?: TOpaque;
137
- /** Default: 0 */
138
- maxRedirections?: number;
139
153
  /** Default: false */
140
154
  redirectionLimitReached?: boolean;
141
155
  /** Default: `null` */
@@ -146,8 +160,6 @@ declare namespace Dispatcher {
146
160
  opaque?: TOpaque;
147
161
  /** Default: `null` */
148
162
  signal?: AbortSignal | EventEmitter | null;
149
- /** Default: 0 */
150
- maxRedirections?: number;
151
163
  /** Default: false */
152
164
  redirectionLimitReached?: boolean;
153
165
  /** Default: `null` */
@@ -171,8 +183,6 @@ declare namespace Dispatcher {
171
183
  protocol?: string;
172
184
  /** Default: `null` */
173
185
  signal?: AbortSignal | EventEmitter | null;
174
- /** Default: 0 */
175
- maxRedirections?: number;
176
186
  /** Default: false */
177
187
  redirectionLimitReached?: boolean;
178
188
  /** Default: `null` */
@@ -276,7 +286,7 @@ declare namespace Dispatcher {
276
286
  }
277
287
 
278
288
  export interface DispatchInterceptor {
279
- (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch']
289
+ (dispatch: Dispatch): Dispatch
280
290
  }
281
291
  }
282
292
 
@@ -1,4 +1,20 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import Agent from './agent'
17
+ import ProxyAgent from './proxy-agent'
2
18
  import Dispatcher from './dispatcher'
3
19
 
4
20
  export default EnvHttpProxyAgent
@@ -10,7 +26,7 @@ declare class EnvHttpProxyAgent extends Dispatcher {
10
26
  }
11
27
 
12
28
  declare namespace EnvHttpProxyAgent {
13
- export interface Options extends Agent.Options {
29
+ export interface Options extends Omit<ProxyAgent.Options, 'uri'> {
14
30
  /** Overrides the value of the HTTP_PROXY environment variable */
15
31
  httpProxy?: string;
16
32
  /** Overrides the value of the HTTPS_PROXY environment variable */
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { IncomingHttpHeaders } from './header'
2
17
  import Client from './client'
3
18
 
@@ -49,21 +64,6 @@ declare namespace Errors {
49
64
  headers: IncomingHttpHeaders | string[] | null
50
65
  }
51
66
 
52
- export class ResponseStatusCodeError extends UndiciError {
53
- constructor (
54
- message?: string,
55
- statusCode?: number,
56
- headers?: IncomingHttpHeaders | string[] | null,
57
- body?: null | Record<string, any> | string
58
- )
59
- name: 'ResponseStatusCodeError'
60
- code: 'UND_ERR_RESPONSE_STATUS_CODE'
61
- body: null | Record<string, any> | string
62
- status: number
63
- statusCode: number
64
- headers: IncomingHttpHeaders | string[] | null
65
- }
66
-
67
67
  /** Passed an invalid argument. */
68
68
  export class InvalidArgumentError extends UndiciError {
69
69
  name: 'InvalidArgumentError'
@@ -168,5 +168,10 @@ declare namespace Errors {
168
168
  name: 'SecureProxyConnectionError'
169
169
  code: 'UND_ERR_PRX_TLS'
170
170
  }
171
+
172
+ class MaxOriginsReachedError extends UndiciError {
173
+ name: 'MaxOriginsReachedError'
174
+ code: 'UND_ERR_MAX_ORIGINS_REACHED'
175
+ }
171
176
  }
172
177
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { MessageEvent, ErrorEvent } from './websocket'
2
17
  import Dispatcher from './dispatcher'
3
18
 
@@ -18,9 +33,9 @@ interface EventSource extends EventTarget {
18
33
  readonly CLOSED: 2
19
34
  readonly CONNECTING: 0
20
35
  readonly OPEN: 1
21
- onerror: (this: EventSource, ev: ErrorEvent) => any
22
- onmessage: (this: EventSource, ev: MessageEvent) => any
23
- onopen: (this: EventSource, ev: Event) => any
36
+ onerror: ((this: EventSource, ev: ErrorEvent) => any) | null
37
+ onmessage: ((this: EventSource, ev: MessageEvent) => any) | null
38
+ onopen: ((this: EventSource, ev: Event) => any) | null
24
39
  readonly readyState: 0 | 1 | 2
25
40
  readonly url: string
26
41
  readonly withCredentials: boolean
@@ -56,7 +71,12 @@ export declare const EventSource: {
56
71
  }
57
72
 
58
73
  interface EventSourceInit {
59
- withCredentials?: boolean,
74
+ withCredentials?: boolean
75
+ // @deprecated use `node.dispatcher` instead
60
76
  dispatcher?: Dispatcher
77
+ node?: {
78
+ dispatcher?: Dispatcher
79
+ reconnectionTime?: number
80
+ }
61
81
  }
62
82
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  // based on https://github.com/Ethan-Arrowood/undici-fetch/blob/249269714db874351589d2d364a0645d5160ae71/index.d.ts (MIT license)
2
17
  // and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license)
3
18
  /// <reference types="node" />
@@ -33,6 +48,7 @@ export class BodyMixin {
33
48
 
34
49
  readonly arrayBuffer: () => Promise<ArrayBuffer>
35
50
  readonly blob: () => Promise<Blob>
51
+ readonly bytes: () => Promise<Uint8Array>
36
52
  /**
37
53
  * @deprecated This method is not recommended for parsing multipart/form-data bodies in server environments.
38
54
  * It is recommended to use a library such as [@fastify/busboy](https://www.npmjs.com/package/@fastify/busboy) as follows:
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  // Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT)
2
17
  /// <reference types="node" />
3
18
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import Dispatcher from './dispatcher'
2
17
 
3
18
  declare function setGlobalDispatcher<DispatcherImplementation extends Dispatcher> (dispatcher: DispatcherImplementation): void
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  declare function setGlobalOrigin (origin: string | URL | undefined): void
2
17
  declare function getGlobalOrigin (): URL | undefined
3
18
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { URL } from 'node:url'
2
17
  import Dispatcher from './dispatcher'
3
18
  import buildConnector from './connector'
@@ -51,8 +66,6 @@ export declare namespace H2CClient {
51
66
  /** TODO */
52
67
  maxCachedSessions?: number;
53
68
  /** TODO */
54
- maxRedirections?: number;
55
- /** TODO */
56
69
  connect?: Omit<Partial<buildConnector.BuildOptions>, 'allowH2'> | buildConnector.connector;
57
70
  /** TODO */
58
71
  maxRequestsPerClient?: number;
@@ -1,8 +1,23 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import Dispatcher from './dispatcher'
2
17
 
3
18
  export declare class RedirectHandler implements Dispatcher.DispatchHandler {
4
19
  constructor (
5
- dispatch: Dispatcher,
20
+ dispatch: Dispatcher.Dispatch,
6
21
  maxRedirections: number,
7
22
  opts: Dispatcher.DispatchOptions,
8
23
  handler: Dispatcher.DispatchHandler,
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import { Autocomplete } from './utility'
2
17
 
3
18
  /**
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import Dispatcher from './dispatcher'
2
17
  import { setGlobalDispatcher, getGlobalDispatcher } from './global-dispatcher'
3
18
  import { setGlobalOrigin, getGlobalOrigin } from './global-origin'
@@ -13,6 +28,7 @@ import Agent from './agent'
13
28
  import MockClient from './mock-client'
14
29
  import MockPool from './mock-pool'
15
30
  import MockAgent from './mock-agent'
31
+ import { SnapshotAgent } from './snapshot-agent'
16
32
  import { MockCallHistory, MockCallHistoryLog } from './mock-call-history'
17
33
  import mockErrors from './mock-errors'
18
34
  import ProxyAgent from './proxy-agent'
@@ -33,7 +49,9 @@ export * from './content-type'
33
49
  export * from './cache'
34
50
  export { Interceptable } from './mock-interceptor'
35
51
 
36
- export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient }
52
+ declare function globalThisInstall (): void
53
+
54
+ export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
37
55
  export default Undici
38
56
 
39
57
  declare namespace Undici {
@@ -58,6 +76,7 @@ declare namespace Undici {
58
76
  const MockClient: typeof import('./mock-client').default
59
77
  const MockPool: typeof import('./mock-pool').default
60
78
  const MockAgent: typeof import('./mock-agent').default
79
+ const SnapshotAgent: typeof import('./snapshot-agent').SnapshotAgent
61
80
  const MockCallHistory: typeof import('./mock-call-history').MockCallHistory
62
81
  const MockCallHistoryLog: typeof import('./mock-call-history').MockCallHistoryLog
63
82
  const mockErrors: typeof import('./mock-errors').default
@@ -72,5 +91,6 @@ declare namespace Undici {
72
91
  MemoryCacheStore: typeof import('./cache-interceptor').default.MemoryCacheStore,
73
92
  SqliteCacheStore: typeof import('./cache-interceptor').default.SqliteCacheStore
74
93
  }
94
+ const install: typeof globalThisInstall
75
95
  }
76
96
 
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import CacheHandler from './cache-interceptor'
2
17
  import Dispatcher from './dispatcher'
3
18
  import RetryHandler from './retry-handler'
@@ -9,6 +24,10 @@ declare namespace Interceptors {
9
24
  export type DumpInterceptorOpts = { maxSize?: number }
10
25
  export type RetryInterceptorOpts = RetryHandler.RetryOptions
11
26
  export type RedirectInterceptorOpts = { maxRedirections?: number }
27
+ export type DecompressInterceptorOpts = {
28
+ skipErrorResponses?: boolean
29
+ skipStatusCodes?: number[]
30
+ }
12
31
 
13
32
  export type ResponseErrorInterceptorOpts = { throwOnError: boolean }
14
33
  export type CacheInterceptorOpts = CacheHandler.CacheOptions
@@ -28,6 +47,7 @@ declare namespace Interceptors {
28
47
  export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
29
48
  export function retry (opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
30
49
  export function redirect (opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
50
+ export function decompress (opts?: DecompressInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
31
51
  export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
32
52
  export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
33
53
  export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
@@ -1,3 +1,18 @@
1
+ // biome-ignore-all lint: generated file
2
+ // biome-ignore-all assist: generated file
3
+ /* eslint-disable */
4
+ // @ts-ignore
5
+
6
+ /******************************************************************************
7
+ * GENERATED FILE, DO NOT MODIFY
8
+ * 这是生成的文件,千万不要修改
9
+ *
10
+ * @build-script/codegen - The Simple Code Generater
11
+ * https://github.com/GongT/baobao
12
+ *
13
+ ******************************************************************************/
14
+
15
+
1
16
  import Agent from './agent'
2
17
  import Dispatcher from './dispatcher'
3
18
  import { Interceptable, MockInterceptor } from './mock-interceptor'
@@ -59,6 +74,9 @@ declare namespace MockAgent {
59
74
  /** Ignore trailing slashes in the path */
60
75
  ignoreTrailingSlash?: boolean;
61
76
 
77
+ /** Accept URLs with search parameters using non standard syntaxes. default false */
78
+ acceptNonStandardSearchParameters?: boolean;
79
+
62
80
  /** Enable call history. you can either call MockAgent.enableCallHistory(). default false */
63
81
  enableCallHistory?: boolean
64
82
  }