@psnext/slingcli 3.5.20261007-3 → 3.5.20261019-1

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 (377) hide show
  1. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +12 -3
  2. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +94 -1589
  3. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js +12 -3
  4. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -7
  5. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +1 -3
  6. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +1 -3
  7. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +2 -8
  8. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  9. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  10. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  11. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  12. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +10 -10
  13. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +1 -2
  14. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +1 -2
  15. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +2 -3
  16. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +2 -3
  17. package/node_modules/@aws-sdk/core/package.json +3 -3
  18. package/node_modules/@aws-sdk/credential-provider-env/package.json +3 -3
  19. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -3
  20. package/node_modules/@aws-sdk/credential-provider-ini/package.json +10 -10
  21. package/node_modules/@aws-sdk/credential-provider-login/package.json +4 -4
  22. package/node_modules/@aws-sdk/credential-provider-node/package.json +8 -8
  23. package/node_modules/@aws-sdk/credential-provider-process/package.json +3 -3
  24. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +37 -19
  25. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/dist-es/fromSso.js +37 -19
  26. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +4 -4
  27. package/node_modules/@aws-sdk/credential-provider-sso/package.json +5 -5
  28. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +4 -4
  29. package/node_modules/@aws-sdk/eventstream-handler-node/package.json +2 -2
  30. package/node_modules/@aws-sdk/middleware-eventstream/package.json +2 -2
  31. package/node_modules/@aws-sdk/middleware-websocket/package.json +4 -4
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +11 -1
  33. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +6 -1
  34. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +6 -1
  35. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +13 -1
  36. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +9 -1
  37. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/CognitoIdentityServiceException.js +1 -0
  38. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/models/errors.js +9 -0
  39. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/SigninServiceException.js +1 -0
  40. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/models/errors.js +4 -0
  41. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/SSOServiceException.js +1 -0
  42. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/models/errors.js +4 -0
  43. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/SSOOIDCServiceException.js +1 -0
  44. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/models/errors.js +11 -0
  45. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/STSServiceException.js +1 -0
  46. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/models/errors.js +7 -0
  47. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
  48. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/models/errors.d.ts +9 -0
  49. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/SigninServiceException.d.ts +1 -0
  50. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/models/errors.d.ts +4 -0
  51. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/SSOServiceException.d.ts +1 -0
  52. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/models/errors.d.ts +4 -0
  53. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
  54. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/models/errors.d.ts +11 -0
  55. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/STSServiceException.d.ts +1 -0
  56. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/errors.d.ts +7 -0
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/CognitoIdentityServiceException.d.ts +1 -0
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/models/errors.d.ts +9 -0
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/SigninServiceException.d.ts +1 -0
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/models/errors.d.ts +4 -0
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/SSOServiceException.d.ts +1 -0
  62. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/models/errors.d.ts +4 -0
  63. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/SSOOIDCServiceException.d.ts +1 -0
  64. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/models/errors.d.ts +11 -0
  65. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/STSServiceException.d.ts +1 -0
  66. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/errors.d.ts +7 -0
  67. package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
  68. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  69. package/node_modules/@earendil-works/pi-ai/dist/providers/opencode-go.js +2 -0
  70. package/node_modules/@earendil-works/pi-codemode/dist/runtime/host.js +21 -86
  71. package/node_modules/@earendil-works/pi-codemode/dist/runtime/prelude-source.js +3 -103
  72. package/node_modules/@earendil-works/pi-codemode/package.json +1 -1
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-TFS67BSI.js → chunk-23QDZLZG.js} +20 -14
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{chunk-IB6ONE3U.js → chunk-QPFSTNX5.js} +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/chunks/{virtual-modules-P5ROWYIG.js → virtual-modules-GRXGP6ZA.js} +1 -1
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/cli-runtime.js +1 -1
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/index.js +1 -1
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/bundle/rpc-entry.js +1 -1
  79. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Agent.md +8 -8
  80. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
  81. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Client.md +11 -6
  82. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
  83. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Dispatcher.md +12 -0
  84. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Errors.md +101 -1
  85. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Fetch.md +10 -0
  86. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
  87. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Interceptors.md +17 -9
  88. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/Pool.md +5 -6
  89. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
  90. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/index.md +22 -13
  91. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/docs/docs/type-map.json +66 -66
  92. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/api/readable.js +1 -2
  93. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
  94. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
  95. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/connect.js +10 -4
  96. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/constants.js +12 -1
  97. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/errors.js +38 -1
  98. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/request.js +39 -3
  99. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/symbols.js +2 -0
  100. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/core/util.js +26 -40
  101. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/agent.js +6 -2
  102. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h1.js +127 -84
  103. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client-h2.js +97 -21
  104. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/client.js +10 -2
  105. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
  106. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
  107. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
  108. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
  109. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool-base.js +117 -19
  110. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/pool.js +99 -13
  111. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/proxy-agent.js +34 -11
  112. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
  113. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
  114. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/cache-handler.js +153 -15
  115. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/deduplication-handler.js +126 -52
  116. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/redirect-handler.js +31 -6
  117. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/handler/retry-handler.js +116 -24
  118. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/cache.js +15 -4
  119. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/decompress.js +253 -73
  120. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/dns.js +11 -0
  121. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/interceptor/response-error.js +72 -28
  122. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/LICENSE.md +7 -0
  123. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/no-simd.js +1002 -0
  124. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/milo/simd.js +1002 -0
  125. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/mock-agent.js +11 -0
  126. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
  127. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
  128. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/util/cache.js +11 -5
  129. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cache.js +17 -8
  130. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
  131. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/index.js +19 -7
  132. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/cookies/util.js +21 -2
  133. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
  134. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/eventsource/eventsource.js +50 -3
  135. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/body.js +69 -53
  136. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/data-url.js +6 -6
  137. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
  138. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/formdata.js +30 -36
  139. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/headers.js +36 -33
  140. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/index.js +54 -29
  141. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/request.js +74 -79
  142. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/response.js +43 -44
  143. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/fetch/util.js +7 -7
  144. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/infra/index.js +16 -1
  145. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  146. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/webidl/index.js +2 -14
  147. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/connection.js +33 -12
  148. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/events.js +43 -26
  149. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/receiver.js +27 -4
  150. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
  151. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
  152. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/lib/web/websocket/websocket.js +44 -41
  153. package/node_modules/@earendil-works/pi-coding-agent/node_modules/undici/package.json +7 -5
  154. package/node_modules/@earendil-works/pi-coding-agent/package.json +2 -2
  155. package/node_modules/@hono/node-server/README.md +2 -0
  156. package/node_modules/@hono/node-server/dist/index.cjs +1 -1
  157. package/node_modules/@hono/node-server/dist/index.mjs +1 -1
  158. package/node_modules/@hono/node-server/dist/serve-static.cjs +2 -1
  159. package/node_modules/@hono/node-server/dist/serve-static.mjs +2 -1
  160. package/node_modules/@hono/node-server/package.json +2 -2
  161. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  162. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +2 -1
  163. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +1695 -3
  164. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/cache/EndpointCache.js +2 -1
  165. package/node_modules/@smithy/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
  166. package/node_modules/@smithy/core/dist-es/submodules/protocols/UnionSerde.js +26 -0
  167. package/node_modules/@smithy/core/dist-es/submodules/protocols/common.js +3 -0
  168. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +8 -0
  169. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/SmithyRpcV2JsonProtocol.js +102 -0
  170. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +8 -1
  171. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +8 -1
  172. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +13 -2
  173. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +11 -1
  174. package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/parseJsonBody.js +16 -1
  175. package/node_modules/@smithy/core/dist-es/submodules/protocols/writeKey.js +3 -0
  176. package/node_modules/@smithy/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  177. package/node_modules/@smithy/core/dist-types/submodules/protocols/UnionSerde.d.ts +24 -0
  178. package/node_modules/@smithy/core/dist-types/submodules/protocols/common.d.ts +2 -0
  179. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +9 -0
  180. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/JsonSettings.d.ts +13 -0
  181. package/node_modules/@smithy/core/dist-types/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
  182. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +16 -0
  183. package/node_modules/@smithy/core/dist-types/submodules/protocols/writeKey.d.ts +4 -0
  184. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
  185. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/UnionSerde.d.ts +24 -0
  186. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -0
  187. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +9 -0
  188. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/JsonSettings.d.ts +13 -0
  189. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/SmithyRpcV2JsonProtocol.d.ts +28 -0
  190. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonCodec.d.ts +15 -11
  191. package/node_modules/{@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json → @smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +7 -4
  192. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +14 -0
  193. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +29 -0
  194. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +51 -0
  195. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +13 -9
  196. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +30 -0
  197. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +60 -0
  198. package/node_modules/{@aws-sdk → @smithy}/core/dist-types/ts3.4/submodules/protocols/json/detectBufferParsing.d.ts +1 -1
  199. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +21 -0
  200. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +15 -0
  201. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +11 -0
  202. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +38 -0
  203. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/writeKey.d.ts +4 -0
  204. package/node_modules/@smithy/core/package.json +2 -1
  205. package/node_modules/@types/node/README.md +1 -1
  206. package/node_modules/@types/node/package.json +2 -2
  207. package/node_modules/@types/node/util.d.ts +6 -3
  208. package/node_modules/content-disposition/README.md +105 -35
  209. package/node_modules/content-disposition/dist/index.d.ts +72 -0
  210. package/node_modules/content-disposition/dist/index.js +388 -0
  211. package/node_modules/content-disposition/dist/index.js.map +1 -0
  212. package/node_modules/content-disposition/package.json +31 -19
  213. package/node_modules/express/Readme.md +15 -9
  214. package/node_modules/express/lib/application.js +2 -2
  215. package/node_modules/express/lib/request.js +32 -19
  216. package/node_modules/express/lib/response.js +27 -30
  217. package/node_modules/express/node_modules/content-type/LICENSE +22 -0
  218. package/node_modules/express/node_modules/content-type/README.md +71 -0
  219. package/node_modules/express/node_modules/content-type/dist/index.d.ts +46 -0
  220. package/node_modules/express/node_modules/content-type/dist/index.js +176 -0
  221. package/node_modules/express/node_modules/content-type/dist/index.js.map +1 -0
  222. package/node_modules/express/node_modules/content-type/package.json +52 -0
  223. package/node_modules/express/package.json +10 -10
  224. package/node_modules/fast-uri/.github/workflows/release.yml +35 -0
  225. package/node_modules/fast-uri/README.md +8 -0
  226. package/node_modules/fast-uri/index.js +98 -18
  227. package/node_modules/fast-uri/lib/utils.js +52 -0
  228. package/node_modules/fast-uri/package.json +1 -1
  229. package/node_modules/fast-uri/test/host-delimiter-security.test.js +94 -0
  230. package/node_modules/fast-uri/test/relative-normalization-security.test.js +156 -0
  231. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +32 -4
  232. package/node_modules/fast-uri/test/scheme-validation.test.js +53 -14
  233. package/node_modules/ip-address/README.md +70 -70
  234. package/node_modules/ip-address/dist/ipv6.js +7 -4
  235. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  236. package/node_modules/ip-address/dist/v6/constants.d.ts +3 -0
  237. package/node_modules/ip-address/dist/v6/constants.js +3 -0
  238. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  239. package/node_modules/ip-address/package.json +2 -1
  240. package/node_modules/jose/README.md +2 -2
  241. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +5 -4
  242. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +4 -4
  243. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +5 -4
  244. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +5 -5
  245. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +5 -4
  246. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +5 -5
  247. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -4
  248. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +5 -5
  249. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +5 -4
  250. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +6 -5
  251. package/node_modules/jose/dist/types/jws/general/sign.d.ts +9 -6
  252. package/node_modules/jose/dist/types/jws/general/verify.d.ts +7 -5
  253. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +7 -6
  254. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +1 -1
  255. package/node_modules/jose/dist/types/jwt/sign.d.ts +1 -1
  256. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +1 -1
  257. package/node_modules/jose/dist/types/jwt/verify.d.ts +3 -5
  258. package/node_modules/jose/dist/types/key/export.d.ts +1 -1
  259. package/node_modules/jose/dist/types/key/generate_secret.d.ts +1 -1
  260. package/node_modules/jose/dist/types/key/import.d.ts +2 -2
  261. package/node_modules/jose/dist/types/types.d.ts +165 -107
  262. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +2 -2
  263. package/node_modules/jose/dist/types/util/errors.d.ts +1 -1
  264. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +3 -3
  265. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +8 -8
  266. package/node_modules/jose/dist/webapi/jwks/local.js +2 -1
  267. package/node_modules/jose/dist/webapi/jwks/remote.js +4 -4
  268. package/node_modules/jose/dist/webapi/jws/general/sign.js +3 -3
  269. package/node_modules/jose/dist/webapi/jws/general/verify.js +3 -3
  270. package/node_modules/jose/dist/webapi/jwt/encrypt.js +2 -2
  271. package/node_modules/jose/dist/webapi/jwt/sign.js +2 -2
  272. package/node_modules/jose/dist/webapi/jwt/unsecured.js +3 -3
  273. package/node_modules/jose/dist/webapi/key/generate_secret.js +4 -4
  274. package/node_modules/jose/dist/webapi/lib/asn1.js +2 -2
  275. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +4 -4
  276. package/node_modules/jose/dist/webapi/lib/content_encryption.js +8 -8
  277. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +14 -14
  278. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +3 -3
  279. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +2 -2
  280. package/node_modules/jose/dist/webapi/lib/jws_sign.js +11 -11
  281. package/node_modules/jose/dist/webapi/lib/jws_verify.js +19 -16
  282. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +44 -43
  283. package/node_modules/jose/dist/webapi/lib/key.js +4 -4
  284. package/node_modules/jose/dist/webapi/lib/key_management.js +17 -17
  285. package/node_modules/jose/dist/webapi/lib/validate.js +10 -10
  286. package/node_modules/jose/dist/webapi/util/decode_jwt.js +12 -12
  287. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +5 -5
  288. package/node_modules/jose/package.json +1 -1
  289. package/node_modules/qs/.github/THREAT_MODEL.md +4 -2
  290. package/node_modules/qs/CHANGELOG.md +38 -14
  291. package/node_modules/qs/README.md +31 -3
  292. package/node_modules/qs/dist/qs.js +20 -20
  293. package/node_modules/qs/lib/parse.js +94 -4
  294. package/node_modules/qs/lib/stringify.js +4 -4
  295. package/node_modules/qs/lib/utils.js +130 -6
  296. package/node_modules/qs/package.json +4 -4
  297. package/node_modules/qs/test/parse.js +174 -0
  298. package/node_modules/qs/test/stringify.js +263 -33
  299. package/node_modules/qs/test/utils.js +184 -0
  300. package/node_modules/undici/docs/docs/api/Client.md +2 -0
  301. package/node_modules/undici/lib/core/connect.js +10 -4
  302. package/node_modules/undici/lib/core/symbols.js +1 -0
  303. package/node_modules/undici/lib/dispatcher/agent.js +6 -2
  304. package/node_modules/undici/lib/dispatcher/client-h1.js +0 -2
  305. package/node_modules/undici/lib/dispatcher/client-h2.js +0 -4
  306. package/node_modules/undici/lib/dispatcher/client.js +3 -2
  307. package/node_modules/undici/lib/dispatcher/dispatcher-base.js +12 -0
  308. package/node_modules/undici/lib/handler/cache-handler.js +48 -0
  309. package/node_modules/undici/lib/handler/deduplication-handler.js +57 -13
  310. package/node_modules/undici/lib/handler/redirect-handler.js +8 -1
  311. package/node_modules/undici/lib/interceptor/decompress.js +15 -5
  312. package/node_modules/undici/lib/web/cookies/index.js +3 -1
  313. package/node_modules/undici/lib/web/cookies/parse.js +138 -137
  314. package/node_modules/undici/lib/web/cookies/util.js +21 -2
  315. package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +90 -9
  316. package/node_modules/undici/lib/web/eventsource/eventsource.js +4 -1
  317. package/node_modules/undici/lib/web/fetch/index.js +3 -3
  318. package/node_modules/undici/lib/web/infra/index.js +14 -0
  319. package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
  320. package/node_modules/undici/lib/web/websocket/receiver.js +13 -0
  321. package/node_modules/undici/package.json +1 -1
  322. package/node_modules/undici/types/client.d.ts +14 -0
  323. package/node_modules/zod/package.json +1 -1
  324. package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
  325. package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
  326. package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
  327. package/node_modules/zod/src/v4/core/compile.ts +9 -0
  328. package/node_modules/zod/src/v4/core/schemas.ts +35 -1
  329. package/node_modules/zod/src/v4/core/util.ts +13 -0
  330. package/node_modules/zod/src/v4/core/versions.ts +1 -1
  331. package/node_modules/zod/v4/core/compile.cjs +8 -0
  332. package/node_modules/zod/v4/core/compile.js +8 -0
  333. package/node_modules/zod/v4/core/schemas.cjs +30 -0
  334. package/node_modules/zod/v4/core/schemas.d.cts +3 -1
  335. package/node_modules/zod/v4/core/schemas.d.ts +3 -1
  336. package/node_modules/zod/v4/core/schemas.js +30 -0
  337. package/node_modules/zod/v4/core/util.cjs +15 -0
  338. package/node_modules/zod/v4/core/util.d.cts +2 -0
  339. package/node_modules/zod/v4/core/util.d.ts +2 -0
  340. package/node_modules/zod/v4/core/util.js +14 -0
  341. package/node_modules/zod/v4/core/versions.cjs +1 -1
  342. package/node_modules/zod/v4/core/versions.js +1 -1
  343. package/package.json +5 -4
  344. package/slingshot/index.js +124 -124
  345. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -7
  346. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonSettings.d.ts +0 -4
  347. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -13
  348. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -18
  349. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -27
  350. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -15
  351. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -39
  352. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +0 -7
  353. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +0 -7
  354. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/needsReviver.d.ts +0 -2
  355. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +0 -14
  356. package/node_modules/content-disposition/index.js +0 -536
  357. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/JsonSettings.js +0 -0
  358. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js +0 -0
  359. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v1/JsonSettings.js +0 -0
  360. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js +0 -0
  361. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js +0 -0
  362. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/detectBufferParsing.js +0 -0
  363. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReplacer.js +0 -0
  364. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/jsonReviver.js +0 -0
  365. /package/node_modules/{@aws-sdk → @smithy}/core/dist-es/submodules/protocols/json/needsReviver.js +0 -0
  366. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonCodec.d.ts +0 -0
  367. /package/node_modules/{@aws-sdk/core/dist-types/submodules/protocols/json → @smithy/core/dist-types/submodules/protocols/json/codec-v1}/JsonSettings.d.ts +0 -0
  368. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeDeserializer.d.ts +0 -0
  369. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v1/JsonShapeSerializer.d.ts +0 -0
  370. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.d.ts +0 -0
  371. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonCodec2.d.ts +0 -0
  372. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.d.ts +0 -0
  373. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/codec-v2/JsonShapeSerializer2.d.ts +0 -0
  374. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/detectBufferParsing.d.ts +0 -0
  375. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +0 -0
  376. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +0 -0
  377. /package/node_modules/{@aws-sdk → @smithy}/core/dist-types/submodules/protocols/json/needsReviver.d.ts +0 -0
@@ -13,7 +13,7 @@ It is also a Stranger Things reference.
13
13
 
14
14
  Have a question about using Undici? Open a [Q&A Discussion](https://github.com/nodejs/undici/discussions/new) or join our official OpenJS [Slack](https://openjs-foundation.slack.com/archives/C01QF9Q31QD) channel.
15
15
 
16
- Looking to contribute? Start by reading the [contributing guide](./CONTRIBUTING.md)
16
+ Looking to contribute? Start by reading the [contributing guide](https://github.com/nodejs/undici/blob/main/CONTRIBUTING.md)
17
17
 
18
18
  ## Install
19
19
 
@@ -380,7 +380,16 @@ The `body` mixins are the most common way to format the request/response body. M
380
380
  > The body returned from `undici.request` does not implement `.formData()`.
381
381
 
382
382
  > [!WARNING]
383
- > Calling `body.formData()` on a fetch response causes undici to buffer and parse the entire body. Since this is dictated by the spec, `body.formData()` must only be called on responses from trusted servers.
383
+ > The body mixins `.arrayBuffer()`, `.blob()`, `.bytes()`, `.json()`, `.text()`,
384
+ > and `.formData()` buffer the entire body in memory before returning. Where
385
+ > applicable, they also decode or parse the payload and retain that
386
+ > representation in memory. Calling these methods therefore means trusting that
387
+ > the response body is small enough to fit in the available memory. Do not use
388
+ > them for responses from untrusted or user-controlled sources. Instead, consume
389
+ > the response body as a stream and enforce an application-specific size limit:
390
+ > use `response.body` for fetch responses or the `body` returned by
391
+ > `undici.request()`. For streaming decoded text, use `body.textStream()` on a
392
+ > fetch `Request` or `Response`.
384
393
 
385
394
  Example usage:
386
395
 
@@ -408,7 +417,7 @@ For more information about their behavior, please reference the body mixin from
408
417
 
409
418
  ## Common API Methods
410
419
 
411
- This section documents our most commonly used API methods. Additional APIs are documented in their own files within the [docs](./docs/) folder and are accessible via the navigation list on the left side of the docs site.
420
+ This section documents our most commonly used API methods. Additional APIs are documented in their own files within the [`api`](./api/) folder and are accessible via the navigation list on the left side of the docs site.
412
421
 
413
422
  For the top-level APIs below, the `url` argument supplies the request origin and
414
423
  path. Do not pass `origin` or `path` in the second `options` argument. The linked
@@ -418,19 +427,19 @@ lower-level APIs that do not receive a separate `url` argument.
418
427
  ### `undici.request([url, options])`
419
428
 
420
429
  * `url` {string|URL|UrlObject}
421
- * `options` {RequestOptions} See [`RequestOptions`](./docs/docs/api/Dispatcher.md#parameter-requestoptions).
430
+ * `options` {RequestOptions} See [`RequestOptions`](./api/Dispatcher.md#parameter-requestoptions).
422
431
  * `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
423
432
  * `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
424
433
  * Returns: {Promise} A promise with the result of the `Dispatcher.request` method.
425
434
 
426
435
  Calls `options.dispatcher.request(options)`.
427
436
 
428
- See [Dispatcher.request](./docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](./docs/examples/README.md) for examples.
437
+ See [Dispatcher.request](./api/Dispatcher.md#dispatcherrequestoptions-callback) for more details, and [request examples](https://github.com/nodejs/undici/blob/main/docs/examples/README.md) for examples.
429
438
 
430
439
  ### `undici.stream([url, options, ]factory)`
431
440
 
432
441
  * `url` {string|URL|UrlObject}
433
- * `options` {StreamOptions} See [`StreamOptions`](./docs/docs/api/Dispatcher.md#parameter-streamoptions).
442
+ * `options` {StreamOptions} See [`StreamOptions`](./api/Dispatcher.md#parameter-streamoptions).
434
443
  * `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
435
444
  * `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
436
445
  * `factory` {Function} `Dispatcher.stream.factory`.
@@ -438,12 +447,12 @@ See [Dispatcher.request](./docs/docs/api/Dispatcher.md#dispatcherrequestoptions-
438
447
 
439
448
  Calls `options.dispatcher.stream(options, factory)`.
440
449
 
441
- See [Dispatcher.stream](./docs/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback) for more details.
450
+ See [Dispatcher.stream](./api/Dispatcher.md#dispatcherstreamoptions-factory-callback) for more details.
442
451
 
443
452
  ### `undici.pipeline([url, options, ]handler)`
444
453
 
445
454
  * `url` {string|URL|UrlObject}
446
- * `options` {PipelineOptions} See [`PipelineOptions`](./docs/docs/api/Dispatcher.md#parameter-pipelineoptions).
455
+ * `options` {PipelineOptions} See [`PipelineOptions`](./api/Dispatcher.md#parameter-pipelineoptions).
447
456
  * `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
448
457
  * `method` {string} **Default:** `PUT` if `options.body`, otherwise `GET`.
449
458
  * `handler` {Function} `Dispatcher.pipeline.handler`.
@@ -451,21 +460,21 @@ See [Dispatcher.stream](./docs/docs/api/Dispatcher.md#dispatcherstreamoptions-fa
451
460
 
452
461
  Calls `options.dispatch.pipeline(options, handler)`.
453
462
 
454
- See [Dispatcher.pipeline](./docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler) for more details.
463
+ See [Dispatcher.pipeline](./api/Dispatcher.md#dispatcherpipelineoptions-handler) for more details.
455
464
 
456
465
  ### `undici.connect([url, options])`
457
466
 
458
467
  Starts two-way communications with the requested resource using [HTTP CONNECT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/CONNECT).
459
468
 
460
469
  * `url` {string|URL|UrlObject}
461
- * `options` {ConnectOptions} See [`ConnectOptions`](./docs/docs/api/Dispatcher.md#parameter-connectoptions).
470
+ * `options` {ConnectOptions} See [`ConnectOptions`](./api/Dispatcher.md#parameter-connectoptions).
462
471
  * `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
463
472
  * `callback` {Function} (optional) — `(err, data) => void`.
464
473
  * Returns: {Promise} A promise with the result of the `Dispatcher.connect` method.
465
474
 
466
475
  Calls `options.dispatch.connect(options)`.
467
476
 
468
- See [Dispatcher.connect](./docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback) for more details.
477
+ See [Dispatcher.connect](./api/Dispatcher.md#dispatcherconnectoptions-callback) for more details.
469
478
 
470
479
  ### `undici.fetch(input[, init])`
471
480
 
@@ -638,14 +647,14 @@ Undici limits the number of `Content-Encoding` layers in a response to **5** to
638
647
  Upgrade to a different protocol. See [MDN - HTTP - Protocol upgrade mechanism](https://developer.mozilla.org/en-US/docs/Web/HTTP/Protocol_upgrade_mechanism) for more details.
639
648
 
640
649
  * `url` {string|URL|UrlObject}
641
- * `options` {UpgradeOptions} See [`UpgradeOptions`](./docs/docs/api/Dispatcher.md#parameter-upgradeoptions).
650
+ * `options` {UpgradeOptions} See [`UpgradeOptions`](./api/Dispatcher.md#parameter-upgradeoptions).
642
651
  * `dispatcher` {Dispatcher} **Default:** [getGlobalDispatcher](#undicigetglobaldispatcher).
643
652
  * `callback` {Function} (optional) — `(error, data) => void`.
644
653
  * Returns: {Promise} A promise with the result of the `Dispatcher.upgrade` method.
645
654
 
646
655
  Calls `options.dispatcher.upgrade(options)`.
647
656
 
648
- See [Dispatcher.upgrade](./docs/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback) for more details.
657
+ See [Dispatcher.upgrade](./api/Dispatcher.md#dispatcherupgradeoptions-callback) for more details.
649
658
 
650
659
  ### `undici.setGlobalDispatcher(dispatcher)`
651
660
 
@@ -1,79 +1,79 @@
1
1
  {
2
- "AbortError": "/api/Errors.md#class-aborterror",
3
- "Agent": "/api/Agent.md#class-agent",
4
- "AgentDispatchOptions": "/api/Agent.md#agentdispatchoptions-handler",
5
- "AgentOptions": "/api/Agent.md#new-agentoptions",
6
- "BalancedPool": "/api/BalancedPool.md#class-balancedpool",
7
- "BalancedPoolOptions": "/api/BalancedPool.md#parameter-balancedpooloptions",
8
- "BodyMixin": "/api/Fetch.md#new-formdata",
2
+ "AbortError": "/api/Errors.html#class-aborterror",
3
+ "Agent": "/api/Agent.html#class-agent",
4
+ "AgentDispatchOptions": "/api/Agent.html#agentdispatchoptions-handler",
5
+ "AgentOptions": "/api/Agent.html#new-agentoptions",
6
+ "BalancedPool": "/api/BalancedPool.html#class-balancedpool",
7
+ "BalancedPoolOptions": "/api/BalancedPool.html#parameter-balancedpooloptions",
8
+ "BodyMixin": "/api/Fetch.html#new-formdata",
9
9
  "Buffer": "https://nodejs.org/api/buffer.html#class-buffer",
10
- "BuildOptions": "/api/Connector.md#buildconnectoroptions",
11
- "CacheKey": "/api/CacheStore.md#cachekey",
12
- "CacheStore": "/api/CacheStore.md#new-memorycachestoreoptions",
13
- "CacheValue": "/api/CacheStore.md#cachevalue",
14
- "ClientDestroyedError": "/api/Errors.md#class-clientdestroyederror",
15
- "ClientOptions": "/api/Client.md#new-clienturl-options",
16
- "ClientStats": "/api/ClientStats.md#class-clientstats",
17
- "ConnectOptions": "/api/Dispatcher.md#class-dispatcher",
18
- "Cookie": "/api/Cookies.md#cookie",
19
- "DispatchController": "/api/Dispatcher.md#class-dispatcher",
20
- "DispatchHandler": "/api/Dispatcher.md#class-dispatcher",
21
- "DispatchOptions": "/api/Dispatcher.md#class-dispatcher",
22
- "Dispatcher": "/api/Dispatcher.md#class-dispatcher",
10
+ "BuildOptions": "/api/Connector.html#buildconnectoroptions",
11
+ "CacheKey": "/api/CacheStore.html#cachekey",
12
+ "CacheStore": "/api/CacheStore.html#new-memorycachestoreoptions",
13
+ "CacheValue": "/api/CacheStore.html#cachevalue",
14
+ "ClientDestroyedError": "/api/Errors.html#class-clientdestroyederror",
15
+ "ClientOptions": "/api/Client.html#new-clienturl-options",
16
+ "ClientStats": "/api/ClientStats.html#class-clientstats",
17
+ "ConnectOptions": "/api/Dispatcher.html#class-dispatcher",
18
+ "Cookie": "/api/Cookies.html#cookie",
19
+ "DispatchController": "/api/Dispatcher.html#class-dispatcher",
20
+ "DispatchHandler": "/api/Dispatcher.html#class-dispatcher",
21
+ "DispatchOptions": "/api/Dispatcher.html#class-dispatcher",
22
+ "Dispatcher": "/api/Dispatcher.html#class-dispatcher",
23
23
  "Duplex": "https://nodejs.org/api/stream.html#class-streamduplex",
24
- "EnvHttpProxyAgent": "/api/EnvHttpProxyAgent.md#class-envhttpproxyagent",
25
- "EnvHttpProxyAgentOptions": "/api/EnvHttpProxyAgent.md#new-envhttpproxyagentoptions",
24
+ "EnvHttpProxyAgent": "/api/EnvHttpProxyAgent.html#class-envhttpproxyagent",
25
+ "EnvHttpProxyAgentOptions": "/api/EnvHttpProxyAgent.html#new-envhttpproxyagentoptions",
26
26
  "EventEmitter": "https://nodejs.org/api/events.html#class-eventemitter",
27
- "GetResult": "/api/CacheStore.md#getresult",
28
- "H2CClientOptions": "/api/H2CClient.md#new-h2cclienturl-options",
27
+ "GetResult": "/api/CacheStore.html#getresult",
28
+ "H2CClientOptions": "/api/H2CClient.html#new-h2cclienturl-options",
29
29
  "HeadersInit": "https://developer.mozilla.org/docs/Web/API/Headers/Headers",
30
- "InvalidArgumentError": "/api/Errors.md#class-invalidargumenterror",
30
+ "InvalidArgumentError": "/api/Errors.html#class-invalidargumenterror",
31
31
  "Iterable": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols",
32
- "MaxOriginsReachedError": "/api/Errors.md#class-maxoriginsreachederror",
33
- "MockAgent": "/api/MockAgent.md#class-mockagent",
34
- "MockAgentOptions": "/api/MockAgent.md#parameter-mockagentoptions",
35
- "MockCallHistory": "/api/MockCallHistory.md#class-mockcallhistory",
36
- "MockCallHistoryLog": "/api/MockCallHistoryLog.md#class-mockcallhistorylog",
37
- "MockClient": "/api/MockClient.md#class-mockclient",
38
- "MockClientOptions": "/api/MockClient.md#parameter-mockclientoptions",
39
- "MockInterceptor": "/api/MockPool.md#return-mockinterceptor",
40
- "MockInterceptor.Options": "/api/MockPool.md#parameter-mockpoolinterceptoptions",
41
- "MockPool": "/api/MockPool.md#class-mockpool",
42
- "MockPoolInterceptOptions": "/api/MockPool.md#parameter-mockpoolinterceptoptions",
43
- "MockPoolOptions": "/api/MockPool.md#parameter-mockpooloptions",
44
- "MockResponseOptions": "/api/MockPool.md#parameter-mockresponseoptions",
45
- "MockScope": "/api/MockPool.md#return-mockscope",
46
- "PendingInterceptor": "/api/MockAgent.md#new-mockagentoptions",
47
- "PipelineOptions": "/api/Dispatcher.md#class-dispatcher",
48
- "Pool": "/api/Pool.md#class-pool",
49
- "PoolOptions": "/api/Pool.md#new-poolurl-options",
50
- "PoolStats": "/api/PoolStats.md#class-poolstats",
51
- "ProxyAgent": "/api/ProxyAgent.md#class-proxyagent",
52
- "ProxyAgentOptions": "/api/ProxyAgent.md#new-proxyagentoptions",
32
+ "MaxOriginsReachedError": "/api/Errors.html#class-maxoriginsreachederror",
33
+ "MockAgent": "/api/MockAgent.html#class-mockagent",
34
+ "MockAgentOptions": "/api/MockAgent.html#parameter-mockagentoptions",
35
+ "MockCallHistory": "/api/MockCallHistory.html#class-mockcallhistory",
36
+ "MockCallHistoryLog": "/api/MockCallHistoryLog.html#class-mockcallhistorylog",
37
+ "MockClient": "/api/MockClient.html#class-mockclient",
38
+ "MockClientOptions": "/api/MockClient.html#parameter-mockclientoptions",
39
+ "MockInterceptor": "/api/MockPool.html#return-mockinterceptor",
40
+ "MockInterceptor.Options": "/api/MockPool.html#parameter-mockpoolinterceptoptions",
41
+ "MockPool": "/api/MockPool.html#class-mockpool",
42
+ "MockPoolInterceptOptions": "/api/MockPool.html#parameter-mockpoolinterceptoptions",
43
+ "MockPoolOptions": "/api/MockPool.html#parameter-mockpooloptions",
44
+ "MockResponseOptions": "/api/MockPool.html#parameter-mockresponseoptions",
45
+ "MockScope": "/api/MockPool.html#return-mockscope",
46
+ "PendingInterceptor": "/api/MockAgent.html#new-mockagentoptions",
47
+ "PipelineOptions": "/api/Dispatcher.html#class-dispatcher",
48
+ "Pool": "/api/Pool.html#class-pool",
49
+ "PoolOptions": "/api/Pool.html#new-poolurl-options",
50
+ "PoolStats": "/api/PoolStats.html#class-poolstats",
51
+ "ProxyAgent": "/api/ProxyAgent.html#class-proxyagent",
52
+ "ProxyAgentOptions": "/api/ProxyAgent.html#new-proxyagentoptions",
53
53
  "Readable": "https://nodejs.org/api/stream.html#class-streamreadable",
54
54
  "Record": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type",
55
- "RequestInit": "/api/Fetch.md#new-formdata",
56
- "RequestOptions": "/api/Dispatcher.md#class-dispatcher",
57
- "ResponseInit": "/api/Fetch.md#new-formdata",
58
- "RetryContext": "/api/RetryHandler.md#retrycontext",
59
- "RetryHandler": "/api/RetryHandler.md#class-retryhandler",
60
- "RetryHandlers": "/api/RetryHandler.md#parameter-retryhandlers",
61
- "RetryOptions": "/api/RetryHandler.md#retryoptions",
62
- "RetryState": "/api/RetryHandler.md#retrystate",
63
- "RoundRobinPoolOptions": "/api/RoundRobinPool.md#parameter-roundrobinpooloptions",
64
- "SnapshotRecorder": "/api/SnapshotAgent.md#new-snapshotagentoptions",
55
+ "RequestInit": "/api/Fetch.html#new-formdata",
56
+ "RequestOptions": "/api/Dispatcher.html#class-dispatcher",
57
+ "ResponseInit": "/api/Fetch.html#new-formdata",
58
+ "RetryContext": "/api/RetryHandler.html#retrycontext",
59
+ "RetryHandler": "/api/RetryHandler.html#class-retryhandler",
60
+ "RetryHandlers": "/api/RetryHandler.html#parameter-retryhandlers",
61
+ "RetryOptions": "/api/RetryHandler.html#retryoptions",
62
+ "RetryState": "/api/RetryHandler.html#retrystate",
63
+ "RoundRobinPoolOptions": "/api/RoundRobinPool.html#parameter-roundrobinpooloptions",
64
+ "SnapshotRecorder": "/api/SnapshotAgent.html#new-snapshotagentoptions",
65
65
  "Socket": "https://nodejs.org/api/net.html#class-netsocket",
66
- "SocketInfo": "/api/Errors.md#new-requestretryerrormessage-code-options",
67
- "StreamOptions": "/api/Dispatcher.md#class-dispatcher",
66
+ "SocketInfo": "/api/Errors.html#new-requestretryerrormessage-code-options",
67
+ "StreamOptions": "/api/Dispatcher.html#class-dispatcher",
68
68
  "TLSSocket": "https://nodejs.org/api/tls.html#class-tlstlssocket",
69
- "UndiciError": "/api/Errors.md#class-undicierror",
70
- "UndiciHeaders": "/api/Dispatcher.md#class-dispatcher",
71
- "UpgradeOptions": "/api/Dispatcher.md#class-dispatcher",
72
- "UrlObject": "/index.md#urlobject",
73
- "WebSocketInit": "/api/WebSocket.md#new-websocketurl-protocols",
74
- "WebSocketStreamOptions": "/api/WebSocket.md#new-websocketurl-protocols",
69
+ "UndiciError": "/api/Errors.html#class-undicierror",
70
+ "UndiciHeaders": "/api/Dispatcher.html#class-dispatcher",
71
+ "UpgradeOptions": "/api/Dispatcher.html#class-dispatcher",
72
+ "UrlObject": "/index.html#urlobject",
73
+ "WebSocketInit": "/api/WebSocket.html#new-websocketurl-protocols",
74
+ "WebSocketStreamOptions": "/api/WebSocket.html#new-websocketurl-protocols",
75
75
  "Writable": "https://nodejs.org/api/stream.html#class-streamwritable",
76
- "buildConnector.BuildOptions": "/api/Connector.md#buildconnectoroptions",
76
+ "buildConnector.BuildOptions": "/api/Connector.html#buildconnectoroptions",
77
77
  "net.Socket": "https://nodejs.org/api/net.html#class-netsocket",
78
78
  "stream.Readable": "https://nodejs.org/api/stream.html#class-streamreadable"
79
- }
79
+ }
@@ -5,7 +5,6 @@ const { addAbortListener } = require('node:events')
5
5
  const { Readable } = require('node:stream')
6
6
  const { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError } = require('../core/errors')
7
7
  const util = require('../core/util')
8
- const { ReadableStreamFrom } = require('../core/util')
9
8
 
10
9
  const kConsume = Symbol('kConsume')
11
10
  const kReading = Symbol('kReading')
@@ -246,7 +245,7 @@ class BodyReadable extends Readable {
246
245
  */
247
246
  get body () {
248
247
  if (!this[kBody]) {
249
- this[kBody] = ReadableStreamFrom(this)
248
+ this[kBody] = ReadableStream.from(this)
250
249
  if (this[kConsume]) {
251
250
  // TODO: Is this the best way to force a lock?
252
251
  this[kBody].getReader() // Ensure stream is locked.
@@ -100,6 +100,11 @@ class MemoryCacheStore extends EventEmitter {
100
100
 
101
101
  const entry = entries ? findEntry(key, entries, now) : null
102
102
 
103
+ if (entry != null) {
104
+ this.#entries.delete(topLevelKey)
105
+ this.#entries.set(topLevelKey, entries)
106
+ }
107
+
103
108
  return entry == null
104
109
  ? undefined
105
110
  : {
@@ -148,11 +153,13 @@ class MemoryCacheStore extends EventEmitter {
148
153
  },
149
154
  final (callback) {
150
155
  let entries = store.#entries.get(topLevelKey)
151
- if (!entries) {
156
+ if (entries) {
157
+ store.#entries.delete(topLevelKey)
158
+ } else {
152
159
  entries = []
153
- store.#entries.set(topLevelKey, entries)
154
160
  }
155
- const previousEntry = findEntry(key, entries, Date.now())
161
+ store.#entries.set(topLevelKey, entries)
162
+ const previousEntry = findEntry(key, entries, -Infinity)
156
163
  if (previousEntry) {
157
164
  const index = entries.indexOf(previousEntry)
158
165
  entries.splice(index, 1, entry)
@@ -177,16 +184,7 @@ class MemoryCacheStore extends EventEmitter {
177
184
  store.#hasEmittedMaxSizeEvent = true
178
185
  }
179
186
 
180
- // Perform eviction
181
- for (const [key, entries] of store.#entries) {
182
- for (const entry of entries.splice(0, Math.ceil(entries.length / 2))) {
183
- store.#size -= entry.size
184
- store.#count -= 1
185
- }
186
- if (entries.length === 0) {
187
- store.#entries.delete(key)
188
- }
189
- }
187
+ store.#evict(entry)
190
188
 
191
189
  // Reset the event flag after eviction
192
190
  if (store.#size < store.#maxSize && store.#count < store.#maxCount) {
@@ -199,6 +197,43 @@ class MemoryCacheStore extends EventEmitter {
199
197
  })
200
198
  }
201
199
 
200
+ #evict (keep) {
201
+ const targetSize = this.#maxSize / 2
202
+ const targetCount = this.#maxCount / 2
203
+
204
+ for (const [key, entries] of this.#entries) {
205
+ for (let i = 0; i < entries.length && (this.#size > targetSize || this.#count > targetCount);) {
206
+ const entry = entries[i]
207
+ if (entry === keep) {
208
+ i++
209
+ continue
210
+ }
211
+ entries.splice(i, 1)
212
+ this.#size -= entry.size
213
+ this.#count -= 1
214
+ }
215
+
216
+ if (entries.length === 0) {
217
+ this.#entries.delete(key)
218
+ }
219
+
220
+ if (this.#size <= targetSize && this.#count <= targetCount) {
221
+ return
222
+ }
223
+ }
224
+
225
+ if (this.#size > this.#maxSize || this.#count > this.#maxCount) {
226
+ const topLevelKey = `${keep.origin}:${keep.path}`
227
+ const entries = this.#entries.get(topLevelKey)
228
+ entries.splice(entries.indexOf(keep), 1)
229
+ this.#size -= keep.size
230
+ this.#count -= 1
231
+ if (entries.length === 0) {
232
+ this.#entries.delete(topLevelKey)
233
+ }
234
+ }
235
+ }
236
+
202
237
  /**
203
238
  * @param {CacheKey} key
204
239
  */
@@ -2,14 +2,22 @@
2
2
 
3
3
  const { Writable } = require('node:stream')
4
4
  const { assertCacheKey, assertCacheValue } = require('../util/cache.js')
5
+ const { zstdCompressSync, zstdDecompressSync } = require('node:zlib')
5
6
 
6
7
  let DatabaseSync
7
8
 
8
- const VERSION = 3
9
+ const VERSION = 4
9
10
 
10
11
  // 2gb
11
12
  const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
12
13
 
14
+ // 1MiB
15
+ const COMPRESS_THRESHOLD = 1024 * 1024
16
+
17
+ // zstd support landed in Node 22.19.0/23.4.0, so it may be missing even when
18
+ // node:sqlite is available.
19
+ const hasZstd = typeof zstdCompressSync === 'function' && typeof zstdDecompressSync === 'function'
20
+
13
21
  /**
14
22
  * @typedef {import('../../types/cache-interceptor.d.ts').default.CacheStore} CacheStore
15
23
  * @implements {CacheStore}
@@ -17,6 +25,7 @@ const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
17
25
  * @typedef {{
18
26
  * id: Readonly<number>,
19
27
  * body?: Uint8Array
28
+ * compressed?: string
20
29
  * statusCode: number
21
30
  * statusMessage: string
22
31
  * headers?: string
@@ -31,6 +40,7 @@ const MAX_ENTRY_SIZE = 2 * 1000 * 1000 * 1000
31
40
  module.exports = class SqliteCacheStore {
32
41
  #maxEntrySize = MAX_ENTRY_SIZE
33
42
  #maxCount = Infinity
43
+ #compressThreshold = COMPRESS_THRESHOLD
34
44
 
35
45
  /**
36
46
  * @type {import('node:sqlite').DatabaseSync}
@@ -107,6 +117,17 @@ module.exports = class SqliteCacheStore {
107
117
  }
108
118
  this.#maxCount = opts.maxCount
109
119
  }
120
+
121
+ if (opts.compressThreshold !== undefined) {
122
+ if (
123
+ typeof opts.compressThreshold !== 'number' ||
124
+ !Number.isInteger(opts.compressThreshold) ||
125
+ opts.compressThreshold < 0
126
+ ) {
127
+ throw new TypeError('SqliteCacheStore options.compressThreshold must be a non-negative integer')
128
+ }
129
+ this.#compressThreshold = opts.compressThreshold
130
+ }
110
131
  }
111
132
 
112
133
  if (!DatabaseSync) {
@@ -128,6 +149,7 @@ module.exports = class SqliteCacheStore {
128
149
 
129
150
  -- Data returned to the interceptor
130
151
  body BUF NULL,
152
+ compressed TEXT NULL,
131
153
  deleteAt INTEGER NOT NULL,
132
154
  statusCode INTEGER NOT NULL,
133
155
  statusMessage TEXT NOT NULL,
@@ -147,6 +169,7 @@ module.exports = class SqliteCacheStore {
147
169
  SELECT
148
170
  id,
149
171
  body,
172
+ compressed,
150
173
  deleteAt,
151
174
  statusCode,
152
175
  statusMessage,
@@ -167,6 +190,7 @@ module.exports = class SqliteCacheStore {
167
190
  this.#updateValueQuery = this.#db.prepare(`
168
191
  UPDATE cacheInterceptorV${VERSION} SET
169
192
  body = ?,
193
+ compressed = ?,
170
194
  deleteAt = ?,
171
195
  statusCode = ?,
172
196
  statusMessage = ?,
@@ -185,6 +209,7 @@ module.exports = class SqliteCacheStore {
185
209
  url,
186
210
  method,
187
211
  body,
212
+ compressed,
188
213
  deleteAt,
189
214
  statusCode,
190
215
  statusMessage,
@@ -194,7 +219,7 @@ module.exports = class SqliteCacheStore {
194
219
  vary,
195
220
  cachedAt,
196
221
  staleAt
197
- ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
222
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
198
223
  `)
199
224
 
200
225
  this.#deleteByUrlQuery = this.#db.prepare(
@@ -237,7 +262,11 @@ module.exports = class SqliteCacheStore {
237
262
  const value = this.#findValue(key)
238
263
  return value
239
264
  ? {
240
- body: value.body ? Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength) : undefined,
265
+ body: value.body
266
+ ? value.compressed === 'zstd'
267
+ ? zstdDecompressSync(Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength))
268
+ : Buffer.from(value.body.buffer, value.body.byteOffset, value.body.byteLength)
269
+ : undefined,
241
270
  statusCode: value.statusCode,
242
271
  statusMessage: value.statusMessage,
243
272
  headers: value.headers ? JSON.parse(value.headers) : undefined,
@@ -268,11 +297,22 @@ module.exports = class SqliteCacheStore {
268
297
  return
269
298
  }
270
299
 
300
+ let compressed = null
301
+ let storedBody = body
302
+ if (body && hasZstd && (size > this.#compressThreshold || isCompressibleContentType(getContentType(value.headers)))) {
303
+ const candidate = zstdCompressSync(body)
304
+ if (candidate.byteLength < body.byteLength) {
305
+ storedBody = candidate
306
+ compressed = 'zstd'
307
+ }
308
+ }
309
+
271
310
  const existingValue = this.#findValue(key, true)
272
311
  if (existingValue) {
273
312
  // Updating an existing response, let's overwrite it
274
313
  this.#updateValueQuery.run(
275
- body,
314
+ storedBody,
315
+ compressed,
276
316
  value.deleteAt,
277
317
  value.statusCode,
278
318
  value.statusMessage,
@@ -289,7 +329,8 @@ module.exports = class SqliteCacheStore {
289
329
  this.#insertValueQuery.run(
290
330
  url,
291
331
  key.method,
292
- body,
332
+ storedBody,
333
+ compressed,
293
334
  value.deleteAt,
294
335
  value.statusCode,
295
336
  value.statusMessage,
@@ -467,3 +508,40 @@ function headerValueEquals (lhs, rhs) {
467
508
 
468
509
  return lhs === rhs
469
510
  }
511
+
512
+ /**
513
+ * @param {Record<string, string|string[]>|null|undefined} headers
514
+ * @returns {string|undefined}
515
+ */
516
+ function getContentType (headers) {
517
+ if (headers == null) {
518
+ return undefined
519
+ }
520
+
521
+ for (const key in headers) {
522
+ if (key.toLowerCase() === 'content-type') {
523
+ const value = headers[key]
524
+ return Array.isArray(value) ? value[0] : value
525
+ }
526
+ }
527
+
528
+ return undefined
529
+ }
530
+
531
+ /**
532
+ * @param {string|undefined} contentType
533
+ * @returns {boolean}
534
+ */
535
+ function isCompressibleContentType (contentType) {
536
+ if (contentType == null) {
537
+ return false
538
+ }
539
+
540
+ const type = contentType.toLowerCase()
541
+
542
+ // text/* and application/json, xml, javascript, ... are easily compressible
543
+ // even at smaller sizes, so ignore the compressThreshold for them.
544
+ return /^text\//.test(type) ||
545
+ /^application\/(json|xml|javascript|x-www-form-urlencoded|graphql)(\s|;|$)/.test(type) ||
546
+ /\+(json|xml)(\s|;|$)/.test(type)
547
+ }
@@ -41,16 +41,22 @@ const SessionCache = class WeakSessionCache {
41
41
  if (this._sessionCache.has(sessionKey)) {
42
42
  this._sessionCache.delete(sessionKey)
43
43
  } else if (this._sessionCache.size >= this._maxCachedSessions) {
44
+ // Make room for the new session: prefer an entry whose session has
45
+ // already been collected, otherwise evict the oldest one.
46
+ let evicted = false
44
47
  for (const [key, ref] of this._sessionCache) {
45
48
  if (ref.deref() === undefined) {
46
49
  this._sessionCache.delete(key)
47
- return
50
+ evicted = true
51
+ break
48
52
  }
49
53
  }
50
54
 
51
- const oldest = this._sessionCache.keys().next()
52
- if (!oldest.done) {
53
- this._sessionCache.delete(oldest.value)
55
+ if (!evicted) {
56
+ const oldest = this._sessionCache.keys().next()
57
+ if (!oldest.done) {
58
+ this._sessionCache.delete(oldest.value)
59
+ }
54
60
  }
55
61
  }
56
62
 
@@ -114,7 +114,18 @@ for (let i = 0; i < wellknownHeaderNames.length; ++i) {
114
114
  lowerCasedKey
115
115
  }
116
116
 
117
+ /**
118
+ * Default WebSocket receive limits (see `webSocket` in Client.md). Used by
119
+ * DispatcherBase#webSocketOptions and by the WebSocket parser when the
120
+ * dispatcher doesn't provide a value, so a dispatcher without
121
+ * `webSocketOptions` (a custom one, or a wrapper) doesn't remove the limits.
122
+ */
123
+ const defaultWebSocketMaxFragments = 131072
124
+ const defaultWebSocketMaxPayloadSize = 128 * 1024 * 1024 // 128 MB
125
+
117
126
  module.exports = {
118
127
  wellknownHeaderNames,
119
- headerNameLowerCasedRecord
128
+ headerNameLowerCasedRecord,
129
+ defaultWebSocketMaxFragments,
130
+ defaultWebSocketMaxPayloadSize
120
131
  }