pi-cursor-sdk 0.1.49 → 0.1.51

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 (278) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +2 -2
  3. package/docs/cursor-live-smoke-checklist.md +4 -4
  4. package/docs/cursor-model-ux-spec.md +5 -5
  5. package/docs/cursor-native-tool-replay.md +2 -2
  6. package/docs/cursor-native-tool-visual-audit.md +1 -1
  7. package/docs/cursor-testing-lessons.md +1 -1
  8. package/package.json +6 -15
  9. package/src/cursor-fallback-models.generated.ts +536 -302
  10. package/src/cursor-provider-errors.ts +29 -0
  11. package/src/cursor-provider-overflow.ts +96 -0
  12. package/src/cursor-tool-manifest.ts +1 -1
  13. package/src/index.ts +4 -1
  14. package/node_modules/@connectrpc/connect-node/README.md +0 -141
  15. package/node_modules/@connectrpc/connect-node/dist/cjs/compression.d.ts +0 -15
  16. package/node_modules/@connectrpc/connect-node/dist/cjs/compression.js +0 -89
  17. package/node_modules/@connectrpc/connect-node/dist/cjs/connect-node-adapter.d.ts +0 -42
  18. package/node_modules/@connectrpc/connect-node/dist/cjs/connect-node-adapter.js +0 -61
  19. package/node_modules/@connectrpc/connect-node/dist/cjs/connect-transport.d.ts +0 -100
  20. package/node_modules/@connectrpc/connect-node/dist/cjs/connect-transport.js +0 -25
  21. package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-transport.d.ts +0 -96
  22. package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-transport.js +0 -25
  23. package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-web-transport.d.ts +0 -96
  24. package/node_modules/@connectrpc/connect-node/dist/cjs/grpc-web-transport.js +0 -25
  25. package/node_modules/@connectrpc/connect-node/dist/cjs/http2-session-manager.d.ts +0 -146
  26. package/node_modules/@connectrpc/connect-node/dist/cjs/http2-session-manager.js +0 -536
  27. package/node_modules/@connectrpc/connect-node/dist/cjs/index.d.ts +0 -15
  28. package/node_modules/@connectrpc/connect-node/dist/cjs/index.js +0 -36
  29. package/node_modules/@connectrpc/connect-node/dist/cjs/node-error.d.ts +0 -45
  30. package/node_modules/@connectrpc/connect-node/dist/cjs/node-error.js +0 -154
  31. package/node_modules/@connectrpc/connect-node/dist/cjs/node-headers-polyfill.d.ts +0 -1
  32. package/node_modules/@connectrpc/connect-node/dist/cjs/node-headers-polyfill.js +0 -29
  33. package/node_modules/@connectrpc/connect-node/dist/cjs/node-transport-options.d.ts +0 -89
  34. package/node_modules/@connectrpc/connect-node/dist/cjs/node-transport-options.js +0 -58
  35. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-client.d.ts +0 -54
  36. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-client.js +0 -326
  37. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-handler.d.ts +0 -41
  38. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-handler.js +0 -234
  39. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-header.d.ts +0 -19
  40. package/node_modules/@connectrpc/connect-node/dist/cjs/node-universal-header.js +0 -97
  41. package/node_modules/@connectrpc/connect-node/dist/cjs/package.json +0 -1
  42. package/node_modules/@connectrpc/connect-node/dist/esm/compression.d.ts +0 -15
  43. package/node_modules/@connectrpc/connect-node/dist/esm/compression.js +0 -86
  44. package/node_modules/@connectrpc/connect-node/dist/esm/connect-node-adapter.d.ts +0 -42
  45. package/node_modules/@connectrpc/connect-node/dist/esm/connect-node-adapter.js +0 -58
  46. package/node_modules/@connectrpc/connect-node/dist/esm/connect-transport.d.ts +0 -100
  47. package/node_modules/@connectrpc/connect-node/dist/esm/connect-transport.js +0 -22
  48. package/node_modules/@connectrpc/connect-node/dist/esm/grpc-transport.d.ts +0 -96
  49. package/node_modules/@connectrpc/connect-node/dist/esm/grpc-transport.js +0 -22
  50. package/node_modules/@connectrpc/connect-node/dist/esm/grpc-web-transport.d.ts +0 -96
  51. package/node_modules/@connectrpc/connect-node/dist/esm/grpc-web-transport.js +0 -22
  52. package/node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.d.ts +0 -146
  53. package/node_modules/@connectrpc/connect-node/dist/esm/http2-session-manager.js +0 -532
  54. package/node_modules/@connectrpc/connect-node/dist/esm/index.d.ts +0 -15
  55. package/node_modules/@connectrpc/connect-node/dist/esm/index.js +0 -23
  56. package/node_modules/@connectrpc/connect-node/dist/esm/node-error.d.ts +0 -45
  57. package/node_modules/@connectrpc/connect-node/dist/esm/node-error.js +0 -147
  58. package/node_modules/@connectrpc/connect-node/dist/esm/node-headers-polyfill.d.ts +0 -1
  59. package/node_modules/@connectrpc/connect-node/dist/esm/node-headers-polyfill.js +0 -27
  60. package/node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.d.ts +0 -89
  61. package/node_modules/@connectrpc/connect-node/dist/esm/node-transport-options.js +0 -58
  62. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.d.ts +0 -54
  63. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-client.js +0 -324
  64. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-handler.d.ts +0 -41
  65. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-handler.js +0 -230
  66. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-header.d.ts +0 -19
  67. package/node_modules/@connectrpc/connect-node/dist/esm/node-universal-header.js +0 -93
  68. package/node_modules/@connectrpc/connect-node/package.json +0 -46
  69. package/node_modules/undici/LICENSE +0 -21
  70. package/node_modules/undici/README.md +0 -741
  71. package/node_modules/undici/docs/docs/api/Agent.md +0 -84
  72. package/node_modules/undici/docs/docs/api/BalancedPool.md +0 -99
  73. package/node_modules/undici/docs/docs/api/CacheStorage.md +0 -30
  74. package/node_modules/undici/docs/docs/api/CacheStore.md +0 -164
  75. package/node_modules/undici/docs/docs/api/Client.md +0 -288
  76. package/node_modules/undici/docs/docs/api/ClientStats.md +0 -27
  77. package/node_modules/undici/docs/docs/api/Connector.md +0 -115
  78. package/node_modules/undici/docs/docs/api/ContentType.md +0 -57
  79. package/node_modules/undici/docs/docs/api/Cookies.md +0 -128
  80. package/node_modules/undici/docs/docs/api/Debug.md +0 -62
  81. package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +0 -315
  82. package/node_modules/undici/docs/docs/api/Dispatcher.md +0 -1392
  83. package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +0 -159
  84. package/node_modules/undici/docs/docs/api/Errors.md +0 -49
  85. package/node_modules/undici/docs/docs/api/EventSource.md +0 -45
  86. package/node_modules/undici/docs/docs/api/Fetch.md +0 -60
  87. package/node_modules/undici/docs/docs/api/GlobalInstallation.md +0 -139
  88. package/node_modules/undici/docs/docs/api/H2CClient.md +0 -263
  89. package/node_modules/undici/docs/docs/api/MockAgent.md +0 -603
  90. package/node_modules/undici/docs/docs/api/MockCallHistory.md +0 -197
  91. package/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +0 -43
  92. package/node_modules/undici/docs/docs/api/MockClient.md +0 -81
  93. package/node_modules/undici/docs/docs/api/MockErrors.md +0 -12
  94. package/node_modules/undici/docs/docs/api/MockPool.md +0 -555
  95. package/node_modules/undici/docs/docs/api/Pool.md +0 -84
  96. package/node_modules/undici/docs/docs/api/PoolStats.md +0 -35
  97. package/node_modules/undici/docs/docs/api/ProxyAgent.md +0 -229
  98. package/node_modules/undici/docs/docs/api/RedirectHandler.md +0 -93
  99. package/node_modules/undici/docs/docs/api/RetryAgent.md +0 -50
  100. package/node_modules/undici/docs/docs/api/RetryHandler.md +0 -118
  101. package/node_modules/undici/docs/docs/api/RoundRobinPool.md +0 -145
  102. package/node_modules/undici/docs/docs/api/SnapshotAgent.md +0 -616
  103. package/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +0 -275
  104. package/node_modules/undici/docs/docs/api/Util.md +0 -25
  105. package/node_modules/undici/docs/docs/api/WebSocket.md +0 -141
  106. package/node_modules/undici/docs/docs/api/api-lifecycle.md +0 -91
  107. package/node_modules/undici/docs/docs/best-practices/client-certificate.md +0 -64
  108. package/node_modules/undici/docs/docs/best-practices/crawling.md +0 -58
  109. package/node_modules/undici/docs/docs/best-practices/mocking-request.md +0 -190
  110. package/node_modules/undici/docs/docs/best-practices/proxy.md +0 -127
  111. package/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +0 -224
  112. package/node_modules/undici/docs/docs/best-practices/writing-tests.md +0 -63
  113. package/node_modules/undici/index-fetch.js +0 -65
  114. package/node_modules/undici/index.d.ts +0 -3
  115. package/node_modules/undici/index.js +0 -234
  116. package/node_modules/undici/lib/api/abort-signal.js +0 -59
  117. package/node_modules/undici/lib/api/api-connect.js +0 -110
  118. package/node_modules/undici/lib/api/api-pipeline.js +0 -252
  119. package/node_modules/undici/lib/api/api-request.js +0 -214
  120. package/node_modules/undici/lib/api/api-stream.js +0 -209
  121. package/node_modules/undici/lib/api/api-upgrade.js +0 -111
  122. package/node_modules/undici/lib/api/index.js +0 -7
  123. package/node_modules/undici/lib/api/readable.js +0 -580
  124. package/node_modules/undici/lib/cache/memory-cache-store.js +0 -234
  125. package/node_modules/undici/lib/cache/sqlite-cache-store.js +0 -461
  126. package/node_modules/undici/lib/core/connect.js +0 -153
  127. package/node_modules/undici/lib/core/constants.js +0 -143
  128. package/node_modules/undici/lib/core/diagnostics.js +0 -227
  129. package/node_modules/undici/lib/core/errors.js +0 -477
  130. package/node_modules/undici/lib/core/request.js +0 -453
  131. package/node_modules/undici/lib/core/socks5-client.js +0 -422
  132. package/node_modules/undici/lib/core/socks5-utils.js +0 -212
  133. package/node_modules/undici/lib/core/symbols.js +0 -75
  134. package/node_modules/undici/lib/core/tree.js +0 -160
  135. package/node_modules/undici/lib/core/util.js +0 -992
  136. package/node_modules/undici/lib/dispatcher/agent.js +0 -158
  137. package/node_modules/undici/lib/dispatcher/balanced-pool.js +0 -219
  138. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -1722
  139. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -995
  140. package/node_modules/undici/lib/dispatcher/client.js +0 -664
  141. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +0 -184
  142. package/node_modules/undici/lib/dispatcher/dispatcher.js +0 -48
  143. package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +0 -146
  144. package/node_modules/undici/lib/dispatcher/fixed-queue.js +0 -135
  145. package/node_modules/undici/lib/dispatcher/h2c-client.js +0 -51
  146. package/node_modules/undici/lib/dispatcher/pool-base.js +0 -214
  147. package/node_modules/undici/lib/dispatcher/pool.js +0 -118
  148. package/node_modules/undici/lib/dispatcher/proxy-agent.js +0 -319
  149. package/node_modules/undici/lib/dispatcher/retry-agent.js +0 -35
  150. package/node_modules/undici/lib/dispatcher/round-robin-pool.js +0 -137
  151. package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +0 -260
  152. package/node_modules/undici/lib/encoding/index.js +0 -33
  153. package/node_modules/undici/lib/global.js +0 -59
  154. package/node_modules/undici/lib/handler/cache-handler.js +0 -578
  155. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +0 -124
  156. package/node_modules/undici/lib/handler/decorator-handler.js +0 -67
  157. package/node_modules/undici/lib/handler/deduplication-handler.js +0 -460
  158. package/node_modules/undici/lib/handler/redirect-handler.js +0 -238
  159. package/node_modules/undici/lib/handler/retry-handler.js +0 -394
  160. package/node_modules/undici/lib/handler/unwrap-handler.js +0 -106
  161. package/node_modules/undici/lib/handler/wrap-handler.js +0 -105
  162. package/node_modules/undici/lib/interceptor/cache.js +0 -495
  163. package/node_modules/undici/lib/interceptor/decompress.js +0 -259
  164. package/node_modules/undici/lib/interceptor/deduplicate.js +0 -117
  165. package/node_modules/undici/lib/interceptor/dns.js +0 -571
  166. package/node_modules/undici/lib/interceptor/dump.js +0 -112
  167. package/node_modules/undici/lib/interceptor/redirect.js +0 -21
  168. package/node_modules/undici/lib/interceptor/response-error.js +0 -95
  169. package/node_modules/undici/lib/interceptor/retry.js +0 -19
  170. package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  171. package/node_modules/undici/lib/llhttp/constants.d.ts +0 -195
  172. package/node_modules/undici/lib/llhttp/constants.js +0 -531
  173. package/node_modules/undici/lib/llhttp/llhttp-wasm.js +0 -15
  174. package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +0 -15
  175. package/node_modules/undici/lib/llhttp/utils.d.ts +0 -2
  176. package/node_modules/undici/lib/llhttp/utils.js +0 -12
  177. package/node_modules/undici/lib/mock/mock-agent.js +0 -232
  178. package/node_modules/undici/lib/mock/mock-call-history.js +0 -248
  179. package/node_modules/undici/lib/mock/mock-client.js +0 -68
  180. package/node_modules/undici/lib/mock/mock-errors.js +0 -29
  181. package/node_modules/undici/lib/mock/mock-interceptor.js +0 -209
  182. package/node_modules/undici/lib/mock/mock-pool.js +0 -68
  183. package/node_modules/undici/lib/mock/mock-symbols.js +0 -32
  184. package/node_modules/undici/lib/mock/mock-utils.js +0 -486
  185. package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +0 -43
  186. package/node_modules/undici/lib/mock/snapshot-agent.js +0 -353
  187. package/node_modules/undici/lib/mock/snapshot-recorder.js +0 -588
  188. package/node_modules/undici/lib/mock/snapshot-utils.js +0 -158
  189. package/node_modules/undici/lib/util/cache.js +0 -414
  190. package/node_modules/undici/lib/util/date.js +0 -653
  191. package/node_modules/undici/lib/util/promise.js +0 -28
  192. package/node_modules/undici/lib/util/runtime-features.js +0 -124
  193. package/node_modules/undici/lib/util/stats.js +0 -32
  194. package/node_modules/undici/lib/util/timers.js +0 -425
  195. package/node_modules/undici/lib/web/cache/cache.js +0 -864
  196. package/node_modules/undici/lib/web/cache/cachestorage.js +0 -152
  197. package/node_modules/undici/lib/web/cache/util.js +0 -45
  198. package/node_modules/undici/lib/web/cookies/constants.js +0 -12
  199. package/node_modules/undici/lib/web/cookies/index.js +0 -199
  200. package/node_modules/undici/lib/web/cookies/parse.js +0 -314
  201. package/node_modules/undici/lib/web/cookies/util.js +0 -282
  202. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +0 -399
  203. package/node_modules/undici/lib/web/eventsource/eventsource.js +0 -501
  204. package/node_modules/undici/lib/web/eventsource/util.js +0 -29
  205. package/node_modules/undici/lib/web/fetch/LICENSE +0 -21
  206. package/node_modules/undici/lib/web/fetch/body.js +0 -509
  207. package/node_modules/undici/lib/web/fetch/constants.js +0 -131
  208. package/node_modules/undici/lib/web/fetch/data-url.js +0 -596
  209. package/node_modules/undici/lib/web/fetch/formdata-parser.js +0 -586
  210. package/node_modules/undici/lib/web/fetch/formdata.js +0 -259
  211. package/node_modules/undici/lib/web/fetch/global.js +0 -40
  212. package/node_modules/undici/lib/web/fetch/headers.js +0 -719
  213. package/node_modules/undici/lib/web/fetch/index.js +0 -2413
  214. package/node_modules/undici/lib/web/fetch/request.js +0 -1115
  215. package/node_modules/undici/lib/web/fetch/response.js +0 -641
  216. package/node_modules/undici/lib/web/fetch/util.js +0 -1522
  217. package/node_modules/undici/lib/web/infra/index.js +0 -229
  218. package/node_modules/undici/lib/web/subresource-integrity/Readme.md +0 -9
  219. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +0 -307
  220. package/node_modules/undici/lib/web/webidl/index.js +0 -1006
  221. package/node_modules/undici/lib/web/websocket/connection.js +0 -329
  222. package/node_modules/undici/lib/web/websocket/constants.js +0 -126
  223. package/node_modules/undici/lib/web/websocket/events.js +0 -331
  224. package/node_modules/undici/lib/web/websocket/frame.js +0 -133
  225. package/node_modules/undici/lib/web/websocket/permessage-deflate.js +0 -100
  226. package/node_modules/undici/lib/web/websocket/receiver.js +0 -507
  227. package/node_modules/undici/lib/web/websocket/sender.js +0 -109
  228. package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +0 -104
  229. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +0 -498
  230. package/node_modules/undici/lib/web/websocket/util.js +0 -347
  231. package/node_modules/undici/lib/web/websocket/websocket.js +0 -758
  232. package/node_modules/undici/package.json +0 -152
  233. package/node_modules/undici/scripts/strip-comments.js +0 -10
  234. package/node_modules/undici/types/README.md +0 -6
  235. package/node_modules/undici/types/agent.d.ts +0 -32
  236. package/node_modules/undici/types/api.d.ts +0 -43
  237. package/node_modules/undici/types/balanced-pool.d.ts +0 -30
  238. package/node_modules/undici/types/cache-interceptor.d.ts +0 -179
  239. package/node_modules/undici/types/cache.d.ts +0 -36
  240. package/node_modules/undici/types/client-stats.d.ts +0 -15
  241. package/node_modules/undici/types/client.d.ts +0 -139
  242. package/node_modules/undici/types/connector.d.ts +0 -36
  243. package/node_modules/undici/types/content-type.d.ts +0 -21
  244. package/node_modules/undici/types/cookies.d.ts +0 -30
  245. package/node_modules/undici/types/diagnostics-channel.d.ts +0 -74
  246. package/node_modules/undici/types/dispatcher.d.ts +0 -275
  247. package/node_modules/undici/types/env-http-proxy-agent.d.ts +0 -22
  248. package/node_modules/undici/types/errors.d.ts +0 -177
  249. package/node_modules/undici/types/eventsource.d.ts +0 -66
  250. package/node_modules/undici/types/fetch.d.ts +0 -231
  251. package/node_modules/undici/types/formdata.d.ts +0 -114
  252. package/node_modules/undici/types/global-dispatcher.d.ts +0 -9
  253. package/node_modules/undici/types/global-origin.d.ts +0 -7
  254. package/node_modules/undici/types/h2c-client.d.ts +0 -73
  255. package/node_modules/undici/types/handlers.d.ts +0 -14
  256. package/node_modules/undici/types/header.d.ts +0 -160
  257. package/node_modules/undici/types/index.d.ts +0 -91
  258. package/node_modules/undici/types/interceptors.d.ts +0 -80
  259. package/node_modules/undici/types/mock-agent.d.ts +0 -68
  260. package/node_modules/undici/types/mock-call-history.d.ts +0 -111
  261. package/node_modules/undici/types/mock-client.d.ts +0 -27
  262. package/node_modules/undici/types/mock-errors.d.ts +0 -12
  263. package/node_modules/undici/types/mock-interceptor.d.ts +0 -94
  264. package/node_modules/undici/types/mock-pool.d.ts +0 -27
  265. package/node_modules/undici/types/patch.d.ts +0 -29
  266. package/node_modules/undici/types/pool-stats.d.ts +0 -19
  267. package/node_modules/undici/types/pool.d.ts +0 -41
  268. package/node_modules/undici/types/proxy-agent.d.ts +0 -29
  269. package/node_modules/undici/types/readable.d.ts +0 -68
  270. package/node_modules/undici/types/retry-agent.d.ts +0 -8
  271. package/node_modules/undici/types/retry-handler.d.ts +0 -125
  272. package/node_modules/undici/types/round-robin-pool.d.ts +0 -41
  273. package/node_modules/undici/types/snapshot-agent.d.ts +0 -109
  274. package/node_modules/undici/types/socks5-proxy-agent.d.ts +0 -25
  275. package/node_modules/undici/types/util.d.ts +0 -18
  276. package/node_modules/undici/types/utility.d.ts +0 -7
  277. package/node_modules/undici/types/webidl.d.ts +0 -347
  278. package/node_modules/undici/types/websocket.d.ts +0 -188
@@ -1,36 +0,0 @@
1
- import { TLSSocket, ConnectionOptions } from 'node:tls'
2
- import { IpcNetConnectOpts, Socket, TcpNetConnectOpts } from 'node:net'
3
-
4
- export default buildConnector
5
- declare function buildConnector (options?: buildConnector.BuildOptions): buildConnector.connector
6
-
7
- declare namespace buildConnector {
8
- export type BuildOptions = (ConnectionOptions | TcpNetConnectOpts | IpcNetConnectOpts) & {
9
- allowH2?: boolean;
10
- maxCachedSessions?: number | null;
11
- socketPath?: string | null;
12
- timeout?: number | null;
13
- port?: number;
14
- keepAlive?: boolean | null;
15
- keepAliveInitialDelay?: number | null;
16
- typeOfService?: number | null;
17
- }
18
-
19
- export interface Options {
20
- hostname: string
21
- host?: string
22
- protocol: string
23
- port: string
24
- servername?: string
25
- localAddress?: string | null
26
- socketPath?: string | null
27
- httpSocket?: Socket
28
- }
29
-
30
- export type Callback = (...args: CallbackArgs) => void
31
- type CallbackArgs = [null, Socket | TLSSocket] | [Error, null]
32
-
33
- export interface connector {
34
- (options: buildConnector.Options, callback: buildConnector.Callback): void
35
- }
36
- }
@@ -1,21 +0,0 @@
1
- /// <reference types="node" />
2
-
3
- interface MIMEType {
4
- type: string
5
- subtype: string
6
- parameters: Map<string, string>
7
- essence: string
8
- }
9
-
10
- /**
11
- * Parse a string to a {@link MIMEType} object. Returns `failure` if the string
12
- * couldn't be parsed.
13
- * @see https://mimesniff.spec.whatwg.org/#parse-a-mime-type
14
- */
15
- export function parseMIMEType (input: string): 'failure' | MIMEType
16
-
17
- /**
18
- * Convert a MIMEType object to a string.
19
- * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type
20
- */
21
- export function serializeAMimeType (mimeType: MIMEType): string
@@ -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,74 +0,0 @@
1
- import { Socket } from 'node:net'
2
- import { URL } from 'node: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
- interface ConnectParams {
20
- host: URL['host'];
21
- hostname: URL['hostname'];
22
- protocol: URL['protocol'];
23
- port: URL['port'];
24
- servername: string | null;
25
- }
26
- type Connector = buildConnector.connector
27
- export interface RequestCreateMessage {
28
- request: Request;
29
- }
30
- export interface RequestBodySentMessage {
31
- request: Request;
32
- }
33
-
34
- export interface RequestBodyChunkSentMessage {
35
- request: Request;
36
- chunk: Uint8Array | string;
37
- }
38
- export interface RequestBodyChunkReceivedMessage {
39
- request: Request;
40
- chunk: Buffer;
41
- }
42
- export interface RequestHeadersMessage {
43
- request: Request;
44
- response: Response;
45
- }
46
- export interface RequestTrailersMessage {
47
- request: Request;
48
- trailers: Array<Buffer>;
49
- }
50
- export interface RequestErrorMessage {
51
- request: Request;
52
- error: Error;
53
- }
54
- export interface ClientSendHeadersMessage {
55
- request: Request;
56
- headers: string;
57
- socket: Socket;
58
- }
59
- export interface ClientBeforeConnectMessage {
60
- connectParams: ConnectParams;
61
- connector: Connector;
62
- }
63
- export interface ClientConnectedMessage {
64
- socket: Socket;
65
- connectParams: ConnectParams;
66
- connector: Connector;
67
- }
68
- export interface ClientConnectErrorMessage {
69
- error: Error;
70
- socket: Socket;
71
- connectParams: ConnectParams;
72
- connector: Connector;
73
- }
74
- }
@@ -1,275 +0,0 @@
1
- import { URL } from 'node:url'
2
- import { Duplex, Readable, Writable } from 'node:stream'
3
- import { EventEmitter } from 'node:events'
4
- import { Blob } from 'node: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>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void
23
- connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>
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>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void
29
- request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>
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>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void
34
- stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>
35
- /** Upgrade to a different protocol. */
36
- upgrade (options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void
37
- upgrade (options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>
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 (callback: () => void): void
40
- close (): Promise<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 (err: Error | null, callback: () => void): void
43
- destroy (callback: () => void): void
44
- destroy (err: Error | null): Promise<void>
45
- destroy (): Promise<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 Dispatch = Dispatcher['dispatch']
101
- export type DispatcherComposeInterceptor = (dispatch: Dispatch) => Dispatch
102
- export interface DispatchOptions {
103
- origin?: string | URL;
104
- path: string;
105
- method: HttpMethod;
106
- /** Default: `null` */
107
- body?: string | Buffer | Uint8Array | Readable | null | FormData;
108
- /** Default: `null` */
109
- headers?: UndiciHeaders;
110
- /** Query string params to be embedded in the request URL. Default: `null` */
111
- query?: Record<string, any>;
112
- /** 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`. */
113
- idempotent?: boolean;
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
- 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;
118
- /** Upgrade the request. Should be used to specify the kind of upgrade i.e. `'Websocket'`. Default: `method === 'CONNECT' || null`. */
119
- upgrade?: boolean | string | null;
120
- /** The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers. Defaults to 300 seconds. */
121
- headersTimeout?: number | null;
122
- /** 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. */
123
- bodyTimeout?: number | null;
124
- /** Whether the request should stablish a keep-alive or not. Default `false` */
125
- reset?: boolean;
126
- /** Whether Undici should throw an error upon receiving a 4xx or 5xx response from the server. Defaults to false */
127
- throwOnError?: boolean;
128
- /** For H2, it appends the expect: 100-continue header, and halts the request body until a 100-continue is received from the remote server */
129
- expectContinue?: boolean;
130
- }
131
- export interface ConnectOptions<TOpaque = null> {
132
- origin: string | URL;
133
- path: string;
134
- /** Default: `null` */
135
- headers?: UndiciHeaders;
136
- /** Default: `null` */
137
- signal?: AbortSignal | EventEmitter | null;
138
- /** This argument parameter is passed through to `ConnectData` */
139
- opaque?: TOpaque;
140
- /** Default: `null` */
141
- responseHeaders?: 'raw' | null;
142
- }
143
- export interface RequestOptions<TOpaque = null> extends DispatchOptions {
144
- /** Default: `null` */
145
- opaque?: TOpaque;
146
- /** Default: `null` */
147
- signal?: AbortSignal | EventEmitter | null;
148
- /** Default: `null` */
149
- onInfo?: (info: { statusCode: number, headers: Record<string, string | string[]> }) => void;
150
- /** Default: `null` */
151
- responseHeaders?: 'raw' | null;
152
- /** Default: `64 KiB` */
153
- highWaterMark?: number;
154
- }
155
- export interface PipelineOptions<TOpaque = null> extends RequestOptions<TOpaque> {
156
- /** `true` if the `handler` will return an object stream. Default: `false` */
157
- objectMode?: boolean;
158
- }
159
- export interface UpgradeOptions {
160
- path: string;
161
- /** Default: `'GET'` */
162
- method?: string;
163
- /** Default: `null` */
164
- headers?: UndiciHeaders;
165
- /** A string of comma separated protocols, in descending preference order. Default: `'Websocket'` */
166
- protocol?: string;
167
- /** Default: `null` */
168
- signal?: AbortSignal | EventEmitter | null;
169
- /** Default: `null` */
170
- responseHeaders?: 'raw' | null;
171
- }
172
- export interface ConnectData<TOpaque = null> {
173
- statusCode: number;
174
- headers: IncomingHttpHeaders;
175
- socket: Duplex;
176
- opaque: TOpaque;
177
- }
178
- export interface ResponseData<TOpaque = null> {
179
- statusCode: number;
180
- statusText: string;
181
- headers: IncomingHttpHeaders;
182
- body: BodyReadable & BodyMixin;
183
- trailers: Record<string, string>;
184
- opaque: TOpaque;
185
- context: object;
186
- }
187
- export interface PipelineHandlerData<TOpaque = null> {
188
- statusCode: number;
189
- headers: IncomingHttpHeaders;
190
- opaque: TOpaque;
191
- body: BodyReadable;
192
- context: object;
193
- }
194
- export interface StreamData<TOpaque = null> {
195
- opaque: TOpaque;
196
- trailers: Record<string, string>;
197
- }
198
- export interface UpgradeData<TOpaque = null> {
199
- headers: IncomingHttpHeaders;
200
- socket: Duplex;
201
- opaque: TOpaque;
202
- }
203
- export interface StreamFactoryData<TOpaque = null> {
204
- statusCode: number;
205
- headers: IncomingHttpHeaders;
206
- opaque: TOpaque;
207
- context: object;
208
- }
209
- export type StreamFactory<TOpaque = null> = (data: StreamFactoryData<TOpaque>) => Writable
210
-
211
- export interface DispatchController {
212
- get aborted(): boolean
213
- get paused(): boolean
214
- get reason(): Error | null
215
- rawHeaders?: Buffer[] | string[] | IncomingHttpHeaders | null
216
- rawTrailers?: Buffer[] | string[] | IncomingHttpHeaders | null
217
- abort(reason: Error): void
218
- pause(): void
219
- resume(): void
220
- }
221
-
222
- export interface DispatchHandler {
223
- onRequestStart?(controller: DispatchController, context: any): void;
224
- onRequestUpgrade?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, socket: Duplex): void;
225
- onResponseStart?(controller: DispatchController, statusCode: number, headers: IncomingHttpHeaders, statusMessage?: string): void;
226
- onResponseData?(controller: DispatchController, chunk: Buffer): void;
227
- onResponseEnd?(controller: DispatchController, trailers: IncomingHttpHeaders): void;
228
- onResponseError?(controller: DispatchController, error: Error): void;
229
-
230
- /** 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. */
231
- /** @deprecated */
232
- onConnect?(abort: (err?: Error) => void): void;
233
- /** Invoked when an error has occurred. */
234
- /** @deprecated */
235
- onError?(err: Error): void;
236
- /** Invoked when request is upgraded either due to a `Upgrade` header or `CONNECT` method. */
237
- /** @deprecated */
238
- onUpgrade?(statusCode: number, headers: Buffer[] | string[] | null, socket: Duplex): void;
239
- /** Invoked when response is received, before headers have been read. **/
240
- /** @deprecated */
241
- onResponseStarted?(): void;
242
- /** Invoked when statusCode and headers have been received. May be invoked multiple times due to 1xx informational headers. */
243
- /** @deprecated */
244
- onHeaders?(statusCode: number, headers: Buffer[], resume: () => void, statusText: string): boolean;
245
- /** Invoked when response payload data is received. */
246
- /** @deprecated */
247
- onData?(chunk: Buffer): boolean;
248
- /** Invoked when response payload and trailers have been received and the request has completed. */
249
- /** @deprecated */
250
- onComplete?(trailers: string[] | null): void;
251
- /** Invoked when a body chunk is sent to the server. May be invoked multiple times for chunked requests */
252
- /** @deprecated */
253
- onBodySent?(chunkSize: number, totalBytesSent: number): void;
254
- }
255
- export type PipelineHandler<TOpaque = null> = (data: PipelineHandlerData<TOpaque>) => Readable
256
- export type HttpMethod = Autocomplete<'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH'>
257
-
258
- /**
259
- * @link https://fetch.spec.whatwg.org/#body-mixin
260
- */
261
- interface BodyMixin {
262
- readonly body?: never;
263
- readonly bodyUsed: boolean;
264
- arrayBuffer(): Promise<ArrayBuffer>;
265
- blob(): Promise<Blob>;
266
- bytes(): Promise<Uint8Array>;
267
- formData(): Promise<never>;
268
- json(): Promise<unknown>;
269
- text(): Promise<string>;
270
- }
271
-
272
- export interface DispatchInterceptor {
273
- (dispatch: Dispatch): Dispatch
274
- }
275
- }
@@ -1,22 +0,0 @@
1
- import Agent from './agent'
2
- import ProxyAgent from './proxy-agent'
3
- import Dispatcher from './dispatcher'
4
-
5
- export default EnvHttpProxyAgent
6
-
7
- declare class EnvHttpProxyAgent extends Dispatcher {
8
- constructor (opts?: EnvHttpProxyAgent.Options)
9
-
10
- dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
11
- }
12
-
13
- declare namespace EnvHttpProxyAgent {
14
- export interface Options extends Omit<ProxyAgent.Options, 'uri'> {
15
- /** Overrides the value of the HTTP_PROXY environment variable */
16
- httpProxy?: string;
17
- /** Overrides the value of the HTTPS_PROXY environment variable */
18
- httpsProxy?: string;
19
- /** Overrides the value of the NO_PROXY environment variable */
20
- noProxy?: string;
21
- }
22
- }
@@ -1,177 +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
- /** Passed an invalid argument. */
53
- export class InvalidArgumentError extends UndiciError {
54
- name: 'InvalidArgumentError'
55
- code: 'UND_ERR_INVALID_ARG'
56
- }
57
-
58
- /** Returned an invalid value. */
59
- export class InvalidReturnValueError extends UndiciError {
60
- name: 'InvalidReturnValueError'
61
- code: 'UND_ERR_INVALID_RETURN_VALUE'
62
- }
63
-
64
- /** The request has been aborted by the user. */
65
- export class RequestAbortedError extends UndiciError {
66
- name: 'AbortError'
67
- code: 'UND_ERR_ABORTED'
68
- }
69
-
70
- /** Expected error with reason. */
71
- export class InformationalError extends UndiciError {
72
- name: 'InformationalError'
73
- code: 'UND_ERR_INFO'
74
- }
75
-
76
- /** Request body length does not match content-length header. */
77
- export class RequestContentLengthMismatchError extends UndiciError {
78
- name: 'RequestContentLengthMismatchError'
79
- code: 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'
80
- }
81
-
82
- /** Response body length does not match content-length header. */
83
- export class ResponseContentLengthMismatchError extends UndiciError {
84
- name: 'ResponseContentLengthMismatchError'
85
- code: 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'
86
- }
87
-
88
- /** Trying to use a destroyed client. */
89
- export class ClientDestroyedError extends UndiciError {
90
- name: 'ClientDestroyedError'
91
- code: 'UND_ERR_DESTROYED'
92
- }
93
-
94
- /** Trying to use a closed client. */
95
- export class ClientClosedError extends UndiciError {
96
- name: 'ClientClosedError'
97
- code: 'UND_ERR_CLOSED'
98
- }
99
-
100
- /** There is an error with the socket. */
101
- export class SocketError extends UndiciError {
102
- name: 'SocketError'
103
- code: 'UND_ERR_SOCKET'
104
- socket: Client.SocketInfo | null
105
- }
106
-
107
- /** Encountered unsupported functionality. */
108
- export class NotSupportedError extends UndiciError {
109
- name: 'NotSupportedError'
110
- code: 'UND_ERR_NOT_SUPPORTED'
111
- }
112
-
113
- /** No upstream has been added to the BalancedPool. */
114
- export class BalancedPoolMissingUpstreamError extends UndiciError {
115
- name: 'MissingUpstreamError'
116
- code: 'UND_ERR_BPL_MISSING_UPSTREAM'
117
- }
118
-
119
- export class HTTPParserError extends UndiciError {
120
- name: 'HTTPParserError'
121
- code: string
122
- }
123
-
124
- /** The response exceed the length allowed. */
125
- export class ResponseExceededMaxSizeError extends UndiciError {
126
- name: 'ResponseExceededMaxSizeError'
127
- code: 'UND_ERR_RES_EXCEEDED_MAX_SIZE'
128
- }
129
-
130
- export class RequestRetryError extends UndiciError {
131
- constructor (
132
- message: string,
133
- statusCode: number,
134
- headers?: IncomingHttpHeaders | string[] | null,
135
- body?: null | Record<string, any> | string
136
- )
137
- name: 'RequestRetryError'
138
- code: 'UND_ERR_REQ_RETRY'
139
- statusCode: number
140
- data: {
141
- count: number;
142
- }
143
-
144
- headers: Record<string, string | string[]>
145
- }
146
-
147
- export class SecureProxyConnectionError extends UndiciError {
148
- constructor (
149
- cause?: Error,
150
- message?: string,
151
- options?: Record<any, any>
152
- )
153
- name: 'SecureProxyConnectionError'
154
- code: 'UND_ERR_PRX_TLS'
155
- }
156
-
157
- export class MaxOriginsReachedError extends UndiciError {
158
- name: 'MaxOriginsReachedError'
159
- code: 'UND_ERR_MAX_ORIGINS_REACHED'
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
- }
171
-
172
- /** WebSocket decompressed message exceeded maximum size. */
173
- export class MessageSizeExceededError extends UndiciError {
174
- name: 'MessageSizeExceededError'
175
- code: 'UND_ERR_WS_MESSAGE_SIZE_EXCEEDED'
176
- }
177
- }