deepv-code 1.0.182 → 1.0.183

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 (193) hide show
  1. package/bundle/dvcode.js +635 -635
  2. package/package.json +1 -1
  3. package/bundle/assets/help/README.md +0 -113
  4. package/bundle/assets/sounds/README.md +0 -74
  5. package/bundle/node_modules/undici/LICENSE +0 -21
  6. package/bundle/node_modules/undici/README.md +0 -472
  7. package/bundle/node_modules/undici/docs/docs/api/Agent.md +0 -83
  8. package/bundle/node_modules/undici/docs/docs/api/BalancedPool.md +0 -99
  9. package/bundle/node_modules/undici/docs/docs/api/CacheStorage.md +0 -30
  10. package/bundle/node_modules/undici/docs/docs/api/CacheStore.md +0 -151
  11. package/bundle/node_modules/undici/docs/docs/api/Client.md +0 -281
  12. package/bundle/node_modules/undici/docs/docs/api/ClientStats.md +0 -27
  13. package/bundle/node_modules/undici/docs/docs/api/Connector.md +0 -115
  14. package/bundle/node_modules/undici/docs/docs/api/ContentType.md +0 -57
  15. package/bundle/node_modules/undici/docs/docs/api/Cookies.md +0 -101
  16. package/bundle/node_modules/undici/docs/docs/api/Debug.md +0 -62
  17. package/bundle/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -204
  18. package/bundle/node_modules/undici/docs/docs/api/Dispatcher.md +0 -1200
  19. package/bundle/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -159
  20. package/bundle/node_modules/undici/docs/docs/api/Errors.md +0 -49
  21. package/bundle/node_modules/undici/docs/docs/api/EventSource.md +0 -45
  22. package/bundle/node_modules/undici/docs/docs/api/Fetch.md +0 -52
  23. package/bundle/node_modules/undici/docs/docs/api/H2CClient.md +0 -262
  24. package/bundle/node_modules/undici/docs/docs/api/MockAgent.md +0 -603
  25. package/bundle/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -197
  26. package/bundle/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -43
  27. package/bundle/node_modules/undici/docs/docs/api/MockClient.md +0 -77
  28. package/bundle/node_modules/undici/docs/docs/api/MockErrors.md +0 -12
  29. package/bundle/node_modules/undici/docs/docs/api/MockPool.md +0 -548
  30. package/bundle/node_modules/undici/docs/docs/api/Pool.md +0 -84
  31. package/bundle/node_modules/undici/docs/docs/api/PoolStats.md +0 -35
  32. package/bundle/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -227
  33. package/bundle/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -96
  34. package/bundle/node_modules/undici/docs/docs/api/RetryAgent.md +0 -45
  35. package/bundle/node_modules/undici/docs/docs/api/RetryHandler.md +0 -117
  36. package/bundle/node_modules/undici/docs/docs/api/Util.md +0 -25
  37. package/bundle/node_modules/undici/docs/docs/api/WebSocket.md +0 -85
  38. package/bundle/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -91
  39. package/bundle/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -64
  40. package/bundle/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -190
  41. package/bundle/node_modules/undici/docs/docs/best-practices/proxy.md +0 -127
  42. package/bundle/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -20
  43. package/bundle/node_modules/undici/index-fetch.js +0 -35
  44. package/bundle/node_modules/undici/index.d.ts +0 -3
  45. package/bundle/node_modules/undici/index.js +0 -183
  46. package/bundle/node_modules/undici/lib/api/abort-signal.js +0 -59
  47. package/bundle/node_modules/undici/lib/api/api-connect.js +0 -110
  48. package/bundle/node_modules/undici/lib/api/api-pipeline.js +0 -252
  49. package/bundle/node_modules/undici/lib/api/api-request.js +0 -199
  50. package/bundle/node_modules/undici/lib/api/api-stream.js +0 -209
  51. package/bundle/node_modules/undici/lib/api/api-upgrade.js +0 -110
  52. package/bundle/node_modules/undici/lib/api/index.js +0 -7
  53. package/bundle/node_modules/undici/lib/api/readable.js +0 -558
  54. package/bundle/node_modules/undici/lib/api/util.js +0 -95
  55. package/bundle/node_modules/undici/lib/cache/memory-cache-store.js +0 -234
  56. package/bundle/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -461
  57. package/bundle/node_modules/undici/lib/core/connect.js +0 -164
  58. package/bundle/node_modules/undici/lib/core/constants.js +0 -143
  59. package/bundle/node_modules/undici/lib/core/diagnostics.js +0 -196
  60. package/bundle/node_modules/undici/lib/core/errors.js +0 -244
  61. package/bundle/node_modules/undici/lib/core/request.js +0 -397
  62. package/bundle/node_modules/undici/lib/core/symbols.js +0 -68
  63. package/bundle/node_modules/undici/lib/core/tree.js +0 -160
  64. package/bundle/node_modules/undici/lib/core/util.js +0 -988
  65. package/bundle/node_modules/undici/lib/dispatcher/agent.js +0 -135
  66. package/bundle/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -206
  67. package/bundle/node_modules/undici/lib/dispatcher/client-h1.js +0 -1615
  68. package/bundle/node_modules/undici/lib/dispatcher/client-h2.js +0 -798
  69. package/bundle/node_modules/undici/lib/dispatcher/client.js +0 -614
  70. package/bundle/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -161
  71. package/bundle/node_modules/undici/lib/dispatcher/dispatcher.js +0 -48
  72. package/bundle/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -151
  73. package/bundle/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -159
  74. package/bundle/node_modules/undici/lib/dispatcher/h2c-client.js +0 -122
  75. package/bundle/node_modules/undici/lib/dispatcher/pool-base.js +0 -191
  76. package/bundle/node_modules/undici/lib/dispatcher/pool.js +0 -118
  77. package/bundle/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -275
  78. package/bundle/node_modules/undici/lib/dispatcher/retry-agent.js +0 -35
  79. package/bundle/node_modules/undici/lib/global.js +0 -32
  80. package/bundle/node_modules/undici/lib/handler/cache-handler.js +0 -448
  81. package/bundle/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -124
  82. package/bundle/node_modules/undici/lib/handler/decorator-handler.js +0 -67
  83. package/bundle/node_modules/undici/lib/handler/redirect-handler.js +0 -227
  84. package/bundle/node_modules/undici/lib/handler/retry-handler.js +0 -342
  85. package/bundle/node_modules/undici/lib/handler/unwrap-handler.js +0 -96
  86. package/bundle/node_modules/undici/lib/handler/wrap-handler.js +0 -95
  87. package/bundle/node_modules/undici/lib/interceptor/cache.js +0 -372
  88. package/bundle/node_modules/undici/lib/interceptor/dns.js +0 -432
  89. package/bundle/node_modules/undici/lib/interceptor/dump.js +0 -111
  90. package/bundle/node_modules/undici/lib/interceptor/redirect.js +0 -21
  91. package/bundle/node_modules/undici/lib/interceptor/response-error.js +0 -95
  92. package/bundle/node_modules/undici/lib/interceptor/retry.js +0 -19
  93. package/bundle/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  94. package/bundle/node_modules/undici/lib/llhttp/constants.d.ts +0 -97
  95. package/bundle/node_modules/undici/lib/llhttp/constants.js +0 -498
  96. package/bundle/node_modules/undici/lib/llhttp/constants.js.map +0 -1
  97. package/bundle/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  98. package/bundle/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  99. package/bundle/node_modules/undici/lib/llhttp/utils.d.ts +0 -2
  100. package/bundle/node_modules/undici/lib/llhttp/utils.js +0 -15
  101. package/bundle/node_modules/undici/lib/llhttp/utils.js.map +0 -1
  102. package/bundle/node_modules/undici/lib/mock/mock-agent.js +0 -224
  103. package/bundle/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  104. package/bundle/node_modules/undici/lib/mock/mock-client.js +0 -64
  105. package/bundle/node_modules/undici/lib/mock/mock-errors.js +0 -19
  106. package/bundle/node_modules/undici/lib/mock/mock-interceptor.js +0 -209
  107. package/bundle/node_modules/undici/lib/mock/mock-pool.js +0 -64
  108. package/bundle/node_modules/undici/lib/mock/mock-symbols.js +0 -31
  109. package/bundle/node_modules/undici/lib/mock/mock-utils.js +0 -433
  110. package/bundle/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  111. package/bundle/node_modules/undici/lib/util/cache.js +0 -368
  112. package/bundle/node_modules/undici/lib/util/date.js +0 -259
  113. package/bundle/node_modules/undici/lib/util/stats.js +0 -32
  114. package/bundle/node_modules/undici/lib/util/timers.js +0 -423
  115. package/bundle/node_modules/undici/lib/web/cache/cache.js +0 -862
  116. package/bundle/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  117. package/bundle/node_modules/undici/lib/web/cache/util.js +0 -45
  118. package/bundle/node_modules/undici/lib/web/cookies/constants.js +0 -12
  119. package/bundle/node_modules/undici/lib/web/cookies/index.js +0 -199
  120. package/bundle/node_modules/undici/lib/web/cookies/parse.js +0 -322
  121. package/bundle/node_modules/undici/lib/web/cookies/util.js +0 -282
  122. package/bundle/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -399
  123. package/bundle/node_modules/undici/lib/web/eventsource/eventsource.js +0 -484
  124. package/bundle/node_modules/undici/lib/web/eventsource/util.js +0 -37
  125. package/bundle/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  126. package/bundle/node_modules/undici/lib/web/fetch/body.js +0 -532
  127. package/bundle/node_modules/undici/lib/web/fetch/constants.js +0 -131
  128. package/bundle/node_modules/undici/lib/web/fetch/data-url.js +0 -744
  129. package/bundle/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +0 -46
  130. package/bundle/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -501
  131. package/bundle/node_modules/undici/lib/web/fetch/formdata.js +0 -263
  132. package/bundle/node_modules/undici/lib/web/fetch/global.js +0 -40
  133. package/bundle/node_modules/undici/lib/web/fetch/headers.js +0 -719
  134. package/bundle/node_modules/undici/lib/web/fetch/index.js +0 -2258
  135. package/bundle/node_modules/undici/lib/web/fetch/request.js +0 -1099
  136. package/bundle/node_modules/undici/lib/web/fetch/response.js +0 -636
  137. package/bundle/node_modules/undici/lib/web/fetch/util.js +0 -1782
  138. package/bundle/node_modules/undici/lib/web/fetch/webidl.js +0 -740
  139. package/bundle/node_modules/undici/lib/web/websocket/connection.js +0 -325
  140. package/bundle/node_modules/undici/lib/web/websocket/constants.js +0 -126
  141. package/bundle/node_modules/undici/lib/web/websocket/events.js +0 -331
  142. package/bundle/node_modules/undici/lib/web/websocket/frame.js +0 -138
  143. package/bundle/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -70
  144. package/bundle/node_modules/undici/lib/web/websocket/receiver.js +0 -454
  145. package/bundle/node_modules/undici/lib/web/websocket/sender.js +0 -109
  146. package/bundle/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -83
  147. package/bundle/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -485
  148. package/bundle/node_modules/undici/lib/web/websocket/util.js +0 -338
  149. package/bundle/node_modules/undici/lib/web/websocket/websocket.js +0 -686
  150. package/bundle/node_modules/undici/package.json +0 -149
  151. package/bundle/node_modules/undici/scripts/strip-comments.js +0 -10
  152. package/bundle/node_modules/undici/types/README.md +0 -6
  153. package/bundle/node_modules/undici/types/agent.d.ts +0 -35
  154. package/bundle/node_modules/undici/types/api.d.ts +0 -43
  155. package/bundle/node_modules/undici/types/balanced-pool.d.ts +0 -29
  156. package/bundle/node_modules/undici/types/cache-interceptor.d.ts +0 -172
  157. package/bundle/node_modules/undici/types/cache.d.ts +0 -36
  158. package/bundle/node_modules/undici/types/client-stats.d.ts +0 -15
  159. package/bundle/node_modules/undici/types/client.d.ts +0 -110
  160. package/bundle/node_modules/undici/types/connector.d.ts +0 -34
  161. package/bundle/node_modules/undici/types/content-type.d.ts +0 -21
  162. package/bundle/node_modules/undici/types/cookies.d.ts +0 -30
  163. package/bundle/node_modules/undici/types/diagnostics-channel.d.ts +0 -66
  164. package/bundle/node_modules/undici/types/dispatcher.d.ts +0 -281
  165. package/bundle/node_modules/undici/types/env-http-proxy-agent.d.ts +0 -21
  166. package/bundle/node_modules/undici/types/errors.d.ts +0 -171
  167. package/bundle/node_modules/undici/types/eventsource.d.ts +0 -61
  168. package/bundle/node_modules/undici/types/fetch.d.ts +0 -210
  169. package/bundle/node_modules/undici/types/formdata.d.ts +0 -108
  170. package/bundle/node_modules/undici/types/global-dispatcher.d.ts +0 -9
  171. package/bundle/node_modules/undici/types/global-origin.d.ts +0 -7
  172. package/bundle/node_modules/undici/types/h2c-client.d.ts +0 -75
  173. package/bundle/node_modules/undici/types/handlers.d.ts +0 -15
  174. package/bundle/node_modules/undici/types/header.d.ts +0 -160
  175. package/bundle/node_modules/undici/types/index.d.ts +0 -75
  176. package/bundle/node_modules/undici/types/interceptors.d.ts +0 -34
  177. package/bundle/node_modules/undici/types/mock-agent.d.ts +0 -68
  178. package/bundle/node_modules/undici/types/mock-call-history.d.ts +0 -111
  179. package/bundle/node_modules/undici/types/mock-client.d.ts +0 -25
  180. package/bundle/node_modules/undici/types/mock-errors.d.ts +0 -12
  181. package/bundle/node_modules/undici/types/mock-interceptor.d.ts +0 -93
  182. package/bundle/node_modules/undici/types/mock-pool.d.ts +0 -25
  183. package/bundle/node_modules/undici/types/patch.d.ts +0 -29
  184. package/bundle/node_modules/undici/types/pool-stats.d.ts +0 -19
  185. package/bundle/node_modules/undici/types/pool.d.ts +0 -41
  186. package/bundle/node_modules/undici/types/proxy-agent.d.ts +0 -29
  187. package/bundle/node_modules/undici/types/readable.d.ts +0 -68
  188. package/bundle/node_modules/undici/types/retry-agent.d.ts +0 -8
  189. package/bundle/node_modules/undici/types/retry-handler.d.ts +0 -116
  190. package/bundle/node_modules/undici/types/util.d.ts +0 -18
  191. package/bundle/node_modules/undici/types/utility.d.ts +0 -7
  192. package/bundle/node_modules/undici/types/webidl.d.ts +0 -266
  193. package/bundle/node_modules/undici/types/websocket.d.ts +0 -184
@@ -1,30 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- import type { Headers } from './fetch'
4
-
5
- export interface Cookie {
6
- name: string
7
- value: string
8
- expires?: Date | number
9
- maxAge?: number
10
- domain?: string
11
- path?: string
12
- secure?: boolean
13
- httpOnly?: boolean
14
- sameSite?: 'Strict' | 'Lax' | 'None'
15
- unparsed?: string[]
16
- }
17
-
18
- export function deleteCookie (
19
- headers: Headers,
20
- name: string,
21
- attributes?: { name?: string, domain?: string }
22
- ): void
23
-
24
- export function getCookies (headers: Headers): Record<string, string>
25
-
26
- export function getSetCookies (headers: Headers): Cookie[]
27
-
28
- export function setCookie (headers: Headers, cookie: Cookie): void
29
-
30
- export function parseCookie (cookie: string): Cookie | null
@@ -1,66 +0,0 @@
1
- import { Socket } from 'net'
2
- import { URL } from 'url'
3
- import buildConnector from './connector'
4
- import Dispatcher from './dispatcher'
5
-
6
- declare namespace DiagnosticsChannel {
7
- interface Request {
8
- origin?: string | URL;
9
- completed: boolean;
10
- method?: Dispatcher.HttpMethod;
11
- path: string;
12
- headers: any;
13
- }
14
- interface Response {
15
- statusCode: number;
16
- statusText: string;
17
- headers: Array<Buffer>;
18
- }
19
- type Error = unknown
20
- interface ConnectParams {
21
- host: URL['host'];
22
- hostname: URL['hostname'];
23
- protocol: URL['protocol'];
24
- port: URL['port'];
25
- servername: string | null;
26
- }
27
- type Connector = buildConnector.connector
28
- export interface RequestCreateMessage {
29
- request: Request;
30
- }
31
- export interface RequestBodySentMessage {
32
- request: Request;
33
- }
34
- export interface RequestHeadersMessage {
35
- request: Request;
36
- response: Response;
37
- }
38
- export interface RequestTrailersMessage {
39
- request: Request;
40
- trailers: Array<Buffer>;
41
- }
42
- export interface RequestErrorMessage {
43
- request: Request;
44
- error: Error;
45
- }
46
- export interface ClientSendHeadersMessage {
47
- request: Request;
48
- headers: string;
49
- socket: Socket;
50
- }
51
- export interface ClientBeforeConnectMessage {
52
- connectParams: ConnectParams;
53
- connector: Connector;
54
- }
55
- export interface ClientConnectedMessage {
56
- socket: Socket;
57
- connectParams: ConnectParams;
58
- connector: Connector;
59
- }
60
- export interface ClientConnectErrorMessage {
61
- error: Error;
62
- socket: Socket;
63
- connectParams: ConnectParams;
64
- connector: Connector;
65
- }
66
- }
@@ -1,281 +0,0 @@
1
- import { URL } from 'url'
2
- import { Duplex, Readable, Writable } from 'stream'
3
- import { EventEmitter } from 'events'
4
- import { Blob } from 'buffer'
5
- import { IncomingHttpHeaders } from './header'
6
- import BodyReadable from './readable'
7
- import { FormData } from './formdata'
8
- import Errors from './errors'
9
- import { Autocomplete } from './utility'
10
-
11
- type AbortSignal = unknown
12
-
13
- export default Dispatcher
14
-
15
- export type UndiciHeaders = Record<string, string | string[]> | IncomingHttpHeaders | string[] | Iterable<[string, string | string[] | undefined]> | null
16
-
17
- /** Dispatcher is the core API used to dispatch requests. */
18
- declare class Dispatcher extends EventEmitter {
19
- /** 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. */
20
- dispatch (options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
21
- /** Starts two-way communications with the requested resource. */
22
- connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>
23
- connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void
24
- /** Compose a chain of dispatchers */
25
- compose (dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
26
- compose (...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
27
- /** Performs an HTTP request. */
28
- request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>
29
- request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void
30
- /** For easy use with `stream.pipeline`. */
31
- pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex
32
- /** A faster version of `Dispatcher.request`. */
33
- stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>
34
- stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void
35
- /** Upgrade to a different protocol. */
36
- upgrade (options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>
37
- upgrade (options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void
38
- /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
39
- close (): Promise<void>
40
- close (callback: () => void): void
41
- /** 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. */
42
- destroy (): Promise<void>
43
- destroy (err: Error | null): Promise<void>
44
- destroy (callback: () => void): void
45
- destroy (err: Error | null, callback: () => void): void
46
-
47
- on (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
48
- on (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
49
- on (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
50
- on (eventName: 'drain', callback: (origin: URL) => void): this
51
-
52
- once (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
53
- once (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
54
- once (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
55
- once (eventName: 'drain', callback: (origin: URL) => void): this
56
-
57
- off (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
58
- off (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
59
- off (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
60
- off (eventName: 'drain', callback: (origin: URL) => void): this
61
-
62
- addListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
63
- addListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
64
- addListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
65
- addListener (eventName: 'drain', callback: (origin: URL) => void): this
66
-
67
- removeListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
68
- removeListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
69
- removeListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
70
- removeListener (eventName: 'drain', callback: (origin: URL) => void): this
71
-
72
- prependListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
73
- prependListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
74
- prependListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
75
- prependListener (eventName: 'drain', callback: (origin: URL) => void): this
76
-
77
- prependOnceListener (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
78
- prependOnceListener (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
79
- prependOnceListener (eventName: 'connectionError', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
80
- prependOnceListener (eventName: 'drain', callback: (origin: URL) => void): this
81
-
82
- listeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
83
- listeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
84
- listeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
85
- listeners (eventName: 'drain'): ((origin: URL) => void)[]
86
-
87
- rawListeners (eventName: 'connect'): ((origin: URL, targets: readonly Dispatcher[]) => void)[]
88
- rawListeners (eventName: 'disconnect'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
89
- rawListeners (eventName: 'connectionError'): ((origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void)[]
90
- rawListeners (eventName: 'drain'): ((origin: URL) => void)[]
91
-
92
- emit (eventName: 'connect', origin: URL, targets: readonly Dispatcher[]): boolean
93
- emit (eventName: 'disconnect', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean
94
- emit (eventName: 'connectionError', origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError): boolean
95
- emit (eventName: 'drain', origin: URL): boolean
96
- }
97
-
98
- declare namespace Dispatcher {
99
- export interface ComposedDispatcher extends Dispatcher {}
100
- export type DispatcherComposeInterceptor = (dispatch: Dispatcher['dispatch']) => Dispatcher['dispatch']
101
- export interface DispatchOptions {
102
- origin?: string | URL;
103
- path: string;
104
- method: HttpMethod;
105
- /** Default: `null` */
106
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
107
- /** Default: `null` */
108
- headers?: UndiciHeaders;
109
- /** Query string params to be embedded in the request URL. Default: `null` */
110
- query?: Record<string, any>;
111
- /** 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`. */
112
- idempotent?: boolean;
113
- /** 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'`. */
114
- blocking?: boolean;
115
- /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
116
- upgrade?: boolean | string | null;
117
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
118
- headersTimeout?: number | null;
119
- /** 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. */
120
- bodyTimeout?: number | null;
121
- /** Whether the request should stablish a keep-alive or not. Default `false` */
122
- reset?: boolean;
123
- /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
124
- throwOnError?: boolean;
125
- /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */
126
- expectContinue?: boolean;
127
- }
128
- export interface ConnectOptions<TOpaque = null> {
129
- origin: string | URL;
130
- path: string;
131
- /** Default: `null` */
132
- headers?: UndiciHeaders;
133
- /** Default: `null` */
134
- signal?: AbortSignal | EventEmitter | null;
135
- /** This argument parameter is passed through to `ConnectData` */
136
- opaque?: TOpaque;
137
- /** Default: 0 */
138
- maxRedirections?: number;
139
- /** Default: false */
140
- redirectionLimitReached?: boolean;
141
- /** Default: `null` */
142
- responseHeaders?: 'raw' | null;
143
- }
144
- export interface RequestOptions<TOpaque = null> extends DispatchOptions {
145
- /** Default: `null` */
146
- opaque?: TOpaque;
147
- /** Default: `null` */
148
- signal?: AbortSignal | EventEmitter | null;
149
- /** Default: 0 */
150
- maxRedirections?: number;
151
- /** Default: false */
152
- redirectionLimitReached?: boolean;
153
- /** Default: `null` */
154
- onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
155
- /** Default: `null` */
156
- responseHeaders?: 'raw' | null;
157
- /** Default: `64 KiB` */
158
- highWaterMark?: number;
159
- }
160
- export interface PipelineOptions<TOpaque = null> extends RequestOptions<TOpaque> {
161
- /** `true` if the `handler` will return an object stream. Default: `false` */
162
- objectMode?: boolean;
163
- }
164
- export interface UpgradeOptions {
165
- path: string;
166
- /** Default: `'GET'` */
167
- method?: string;
168
- /** Default: `null` */
169
- headers?: UndiciHeaders;
170
- /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
171
- protocol?: string;
172
- /** Default: `null` */
173
- signal?: AbortSignal | EventEmitter | null;
174
- /** Default: 0 */
175
- maxRedirections?: number;
176
- /** Default: false */
177
- redirectionLimitReached?: boolean;
178
- /** Default: `null` */
179
- responseHeaders?: 'raw' | null;
180
- }
181
- export interface ConnectData<TOpaque = null> {
182
- statusCode: number;
183
- headers: IncomingHttpHeaders;
184
- socket: Duplex;
185
- opaque: TOpaque;
186
- }
187
- export interface ResponseData<TOpaque = null> {
188
- statusCode: number;
189
- headers: IncomingHttpHeaders;
190
- body: BodyReadable & BodyMixin;
191
- trailers: Record<string, string>;
192
- opaque: TOpaque;
193
- context: object;
194
- }
195
- export interface PipelineHandlerData<TOpaque = null> {
196
- statusCode: number;
197
- headers: IncomingHttpHeaders;
198
- opaque: TOpaque;
199
- body: BodyReadable;
200
- context: object;
201
- }
202
- export interface StreamData<TOpaque = null> {
203
- opaque: TOpaque;
204
- trailers: Record<string, string>;
205
- }
206
- export interface UpgradeData<TOpaque = null> {
207
- headers: IncomingHttpHeaders;
208
- socket: Duplex;
209
- opaque: TOpaque;
210
- }
211
- export interface StreamFactoryData<TOpaque = null> {
212
- statusCode: number;
213
- headers: IncomingHttpHeaders;
214
- opaque: TOpaque;
215
- context: object;
216
- }
217
- export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable
218
-
219
- export interface DispatchController {
220
- get aborted () : boolean
221
- get paused () : boolean
222
- get reason () : Error | null
223
- abort (reason: Error): void
224
- pause(): void
225
- resume(): void
226
- }
227
-
228
- export interface DispatchHandler {
229
- onRequestStart?(controller: DispatchController, context: any): void;
230
- onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void;
231
- onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void;
232
- onResponseData?(controller: DispatchController, chunk: Buffer): void;
233
- onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
234
- onResponseError?(controller: DispatchController, error: Error): void;
235
-
236
- /** 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. */
237
- /** @deprecated */
238
- onConnect?(abort: (err?: Error) => void): void;
239
- /** Invoked when an error has occurred. */
240
- /** @deprecated */
241
- onError?(err: Error): void;
242
- /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
243
- /** @deprecated */
244
- onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
245
- /** Invoked when response is received, before headers have been read. **/
246
- /** @deprecated */
247
- onResponseStarted?(): void;
248
- /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
249
- /** @deprecated */
250
- onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
251
- /** Invoked when response payload data is received. */
252
- /** @deprecated */
253
- onData?(chunk: Buffer): boolean;
254
- /** Invoked when response payload and trailers have been received and the request has completed. */
255
- /** @deprecated */
256
- onComplete?(trailers: string[] | null): void;
257
- /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
258
- /** @deprecated */
259
- onBodySent?(chunkSize: number, totalBytesSent: number): void;
260
- }
261
- export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable
262
- export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>
263
-
264
- /**
265
- * @link https://fetch.spec.whatwg.org/#body-mixin
266
- */
267
- interface BodyMixin {
268
- readonly body?: never;
269
- readonly bodyUsed: boolean;
270
- arrayBuffer(): Promise<ArrayBuffer>;
271
- blob(): Promise<Blob>;
272
- bytes(): Promise<Uint8Array>;
273
- formData(): Promise<never>;
274
- json(): Promise<unknown>;
275
- text(): Promise<string>;
276
- }
277
-
278
- export interface DispatchInterceptor {
279
- (dispatch: Dispatcher['dispatch']): Dispatcher['dispatch']
280
- }
281
- }
@@ -1,21 +0,0 @@
1
- import Agent from './agent'
2
- import Dispatcher from './dispatcher'
3
-
4
- export default EnvHttpProxyAgent
5
-
6
- declare class EnvHttpProxyAgent extends Dispatcher {
7
- constructor (opts?: EnvHttpProxyAgent.Options)
8
-
9
- dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
10
- }
11
-
12
- declare namespace EnvHttpProxyAgent {
13
- export interface Options extends Agent.Options {
14
- /** Overrides the value of the HTTP_PROXY environment variable */
15
- httpProxy?: string;
16
- /** Overrides the value of the HTTPS_PROXY environment variable */
17
- httpsProxy?: string;
18
- /** Overrides the value of the NO_PROXY environment variable */
19
- noProxy?: string;
20
- }
21
- }
@@ -1,171 +0,0 @@
1
- import { IncomingHttpHeaders } from './header'
2
- import Client from './client'
3
-
4
- export default Errors
5
-
6
- declare namespace Errors {
7
- export class UndiciError extends Error {
8
- name: string
9
- code: string
10
- }
11
-
12
- /** Connect timeout error. */
13
- export class ConnectTimeoutError extends UndiciError {
14
- name: 'ConnectTimeoutError'
15
- code: 'UND_ERR_CONNECT_TIMEOUT'
16
- }
17
-
18
- /** A header exceeds the `headersTimeout` option. */
19
- export class HeadersTimeoutError extends UndiciError {
20
- name: 'HeadersTimeoutError'
21
- code: 'UND_ERR_HEADERS_TIMEOUT'
22
- }
23
-
24
- /** Headers overflow error. */
25
- export class HeadersOverflowError extends UndiciError {
26
- name: 'HeadersOverflowError'
27
- code: 'UND_ERR_HEADERS_OVERFLOW'
28
- }
29
-
30
- /** A body exceeds the `bodyTimeout` option. */
31
- export class BodyTimeoutError extends UndiciError {
32
- name: 'BodyTimeoutError'
33
- code: 'UND_ERR_BODY_TIMEOUT'
34
- }
35
-
36
- export class ResponseError extends UndiciError {
37
- constructor (
38
- message: string,
39
- code: number,
40
- options: {
41
- headers?: IncomingHttpHeaders | string[] | null,
42
- body?: null | Record<string, any> | string
43
- }
44
- )
45
- name: 'ResponseError'
46
- code: 'UND_ERR_RESPONSE'
47
- statusCode: number
48
- body: null | Record<string, any> | string
49
- headers: IncomingHttpHeaders | string[] | null
50
- }
51
-
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
- /** Passed an invalid argument. */
68
- export class InvalidArgumentError extends UndiciError {
69
- name: 'InvalidArgumentError'
70
- code: 'UND_ERR_INVALID_ARG'
71
- }
72
-
73
- /** Returned an invalid value. */
74
- export class InvalidReturnValueError extends UndiciError {
75
- name: 'InvalidReturnValueError'
76
- code: 'UND_ERR_INVALID_RETURN_VALUE'
77
- }
78
-
79
- /** The request has been aborted by the user. */
80
- export class RequestAbortedError extends UndiciError {
81
- name: 'AbortError'
82
- code: 'UND_ERR_ABORTED'
83
- }
84
-
85
- /** Expected error with reason. */
86
- export class InformationalError extends UndiciError {
87
- name: 'InformationalError'
88
- code: 'UND_ERR_INFO'
89
- }
90
-
91
- /** Request body length does not match content-length header. */
92
- export class RequestContentLengthMismatchError extends UndiciError {
93
- name: 'RequestContentLengthMismatchError'
94
- code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
95
- }
96
-
97
- /** Response body length does not match content-length header. */
98
- export class ResponseContentLengthMismatchError extends UndiciError {
99
- name: 'ResponseContentLengthMismatchError'
100
- code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
101
- }
102
-
103
- /** Trying to use a destroyed client. */
104
- export class ClientDestroyedError extends UndiciError {
105
- name: 'ClientDestroyedError'
106
- code: 'UND_ERR_DESTROYED'
107
- }
108
-
109
- /** Trying to use a closed client. */
110
- export class ClientClosedError extends UndiciError {
111
- name: 'ClientClosedError'
112
- code: 'UND_ERR_CLOSED'
113
- }
114
-
115
- /** There is an error with the socket. */
116
- export class SocketError extends UndiciError {
117
- name: 'SocketError'
118
- code: 'UND_ERR_SOCKET'
119
- socket: Client.SocketInfo | null
120
- }
121
-
122
- /** Encountered unsupported functionality. */
123
- export class NotSupportedError extends UndiciError {
124
- name: 'NotSupportedError'
125
- code: 'UND_ERR_NOT_SUPPORTED'
126
- }
127
-
128
- /** No upstream has been added to the BalancedPool. */
129
- export class BalancedPoolMissingUpstreamError extends UndiciError {
130
- name: 'MissingUpstreamError'
131
- code: 'UND_ERR_BPL_MISSING_UPSTREAM'
132
- }
133
-
134
- export class HTTPParserError extends UndiciError {
135
- name: 'HTTPParserError'
136
- code: string
137
- }
138
-
139
- /** The response exceed the length allowed. */
140
- export class ResponseExceededMaxSizeError extends UndiciError {
141
- name: 'ResponseExceededMaxSizeError'
142
- code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
143
- }
144
-
145
- export class RequestRetryError extends UndiciError {
146
- constructor (
147
- message: string,
148
- statusCode: number,
149
- headers?: IncomingHttpHeaders | string[] | null,
150
- body?: null | Record<string, any> | string
151
- )
152
- name: 'RequestRetryError'
153
- code: 'UND_ERR_REQ_RETRY'
154
- statusCode: number
155
- data: {
156
- count: number;
157
- }
158
-
159
- headers: Record<string, string | string[]>
160
- }
161
-
162
- export class SecureProxyConnectionError extends UndiciError {
163
- constructor (
164
- cause?: Error,
165
- message?: string,
166
- options?: Record<any, any>
167
- )
168
- name: 'SecureProxyConnectionError'
169
- code: 'UND_ERR_PRX_TLS'
170
- }
171
- }
@@ -1,61 +0,0 @@
1
- import { MessageEvent, ErrorEvent } from './websocket'
2
- import Dispatcher from './dispatcher'
3
-
4
- import {
5
- EventListenerOptions,
6
- AddEventListenerOptions,
7
- EventListenerOrEventListenerObject
8
- } from './patch'
9
-
10
- interface EventSourceEventMap {
11
- error: ErrorEvent
12
- message: MessageEvent
13
- open: Event
14
- }
15
-
16
- interface EventSource extends EventTarget {
17
- close(): void
18
- readonly CLOSED: 2
19
- readonly CONNECTING: 0
20
- readonly OPEN: 1
21
- onerror: (this: EventSource, ev: ErrorEvent) => any
22
- onmessage: (this: EventSource, ev: MessageEvent) => any
23
- onopen: (this: EventSource, ev: Event) => any
24
- readonly readyState: 0 | 1 | 2
25
- readonly url: string
26
- readonly withCredentials: boolean
27
-
28
- addEventListener<K extends keyof EventSourceEventMap>(
29
- type: K,
30
- listener: (this: EventSource, ev: EventSourceEventMap[K]) => any,
31
- options?: boolean | AddEventListenerOptions
32
- ): void
33
- addEventListener(
34
- type: string,
35
- listener: EventListenerOrEventListenerObject,
36
- options?: boolean | AddEventListenerOptions
37
- ): void
38
- removeEventListener<K extends keyof EventSourceEventMap>(
39
- type: K,
40
- listener: (this: EventSource, ev: EventSourceEventMap[K]) => any,
41
- options?: boolean | EventListenerOptions
42
- ): void
43
- removeEventListener(
44
- type: string,
45
- listener: EventListenerOrEventListenerObject,
46
- options?: boolean | EventListenerOptions
47
- ): void
48
- }
49
-
50
- export declare const EventSource: {
51
- prototype: EventSource
52
- new (url: string | URL, init?: EventSourceInit): EventSource
53
- readonly CLOSED: 2
54
- readonly CONNECTING: 0
55
- readonly OPEN: 1
56
- }
57
-
58
- interface EventSourceInit {
59
- withCredentials?: boolean,
60
- dispatcher?: Dispatcher
61
- }