@suveren/gateway 0.7.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/content/integrations/mollie.json +103 -28
  2. package/dist/control-plane/index.mjs +248 -58
  3. package/dist/mcp-server/http.mjs +577 -124
  4. package/dist/ui/assets/index-BFnSVa9N.js +110 -0
  5. package/dist/ui/assets/{index-CkWaRck1.css → index-BYVb_0oG.css} +1 -1
  6. package/dist/ui/index.html +2 -2
  7. package/node_modules/@hap/core/dist/index.d.mts +285 -13
  8. package/node_modules/@hap/core/dist/index.d.ts +285 -13
  9. package/node_modules/@hap/core/dist/index.js +281 -13
  10. package/node_modules/@hap/core/dist/index.mjs +266 -12
  11. package/node_modules/@hap/core/package.json +4 -2
  12. package/node_modules/@hap/core/src/did-key.ts +126 -0
  13. package/node_modules/@hap/core/src/frame.ts +115 -14
  14. package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
  15. package/node_modules/@hap/core/src/identity.ts +21 -5
  16. package/node_modules/@hap/core/src/index.ts +3 -0
  17. package/node_modules/@hap/core/src/mandate.ts +207 -0
  18. package/node_modules/@hap/core/src/receipt.ts +74 -0
  19. package/node_modules/@hap/core/src/types.ts +87 -5
  20. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/accept.js +54 -0
  21. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/charset.js +10 -34
  22. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/encoding.js +9 -30
  23. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/language.js +15 -36
  24. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/lib/mediaType.js +16 -134
  25. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
  26. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/README.md +71 -0
  27. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
  28. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
  29. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
  30. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/node_modules/content-type/package.json +52 -0
  31. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/package.json +16 -10
  32. package/node_modules/@types/node/README.md +1 -1
  33. package/node_modules/@types/node/buffer.buffer.d.ts +10 -5
  34. package/node_modules/@types/node/crypto.d.ts +2 -4
  35. package/node_modules/@types/node/dgram.d.ts +119 -4
  36. package/node_modules/@types/node/ffi.d.ts +1 -1
  37. package/node_modules/@types/node/fs/promises.d.ts +61 -65
  38. package/node_modules/@types/node/fs.d.ts +86 -76
  39. package/node_modules/@types/node/http.d.ts +17 -1
  40. package/node_modules/@types/node/http2.d.ts +12 -4
  41. package/node_modules/@types/node/index.d.ts +1 -0
  42. package/node_modules/@types/node/inspector.d.ts +2 -1
  43. package/node_modules/@types/node/net.d.ts +108 -16
  44. package/node_modules/@types/node/package.json +2 -2
  45. package/node_modules/@types/node/process.d.ts +52 -0
  46. package/node_modules/@types/node/quic.d.ts +246 -38
  47. package/node_modules/@types/node/sqlite.d.ts +6 -2
  48. package/node_modules/@types/node/stream/iter.d.ts +4 -4
  49. package/node_modules/@types/node/test.d.ts +36 -0
  50. package/node_modules/@types/node/tls.d.ts +24 -0
  51. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
  52. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  53. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  54. package/node_modules/@types/node/tty.d.ts +4 -3
  55. package/node_modules/@types/node/vfs.d.ts +210 -0
  56. package/node_modules/@types/node/vm.d.ts +1 -1
  57. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  58. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  59. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  60. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  61. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  62. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  63. package/node_modules/express-rate-limit/package.json +5 -5
  64. package/node_modules/express-rate-limit/readme.md +1 -0
  65. package/node_modules/fast-uri/index.js +215 -47
  66. package/node_modules/fast-uri/lib/schemes.js +9 -4
  67. package/node_modules/fast-uri/lib/utils.js +396 -92
  68. package/node_modules/fast-uri/package.json +1 -1
  69. package/node_modules/fast-uri/test/component-safe-serialization.test.js +163 -0
  70. package/node_modules/fast-uri/test/equal.test.js +31 -3
  71. package/node_modules/fast-uri/test/fixtures/uri-js-parse.json +2 -0
  72. package/node_modules/fast-uri/test/ipv6-canonical.test.js +34 -0
  73. package/node_modules/fast-uri/test/ipv6-validation.test.js +124 -0
  74. package/node_modules/fast-uri/test/malformed-percent.test.js +77 -0
  75. package/node_modules/fast-uri/test/malformed-urn.test.js +61 -0
  76. package/node_modules/fast-uri/test/parse.test.js +7 -3
  77. package/node_modules/fast-uri/test/query-fragment-normalization.test.js +33 -0
  78. package/node_modules/fast-uri/test/reserved-path-normalization.test.js +109 -0
  79. package/node_modules/fast-uri/test/scheme-validation.test.js +124 -0
  80. package/node_modules/fast-uri/test/security-normalization.test.js +101 -0
  81. package/node_modules/fast-uri/test/security.test.js +75 -3
  82. package/node_modules/fast-uri/test/urn-full-input.test.js +29 -0
  83. package/node_modules/fast-uri/test/websocket-query-preservation.test.js +24 -0
  84. package/node_modules/hono/dist/cjs/client/client.js +25 -11
  85. package/node_modules/hono/dist/cjs/client/utils.js +4 -1
  86. package/node_modules/hono/dist/cjs/context.js +4 -0
  87. package/node_modules/hono/dist/cjs/helper/accepts/accepts.js +36 -2
  88. package/node_modules/hono/dist/cjs/helper/ssg/ssg.js +1 -1
  89. package/node_modules/hono/dist/cjs/helper/ssg/utils.js +30 -10
  90. package/node_modules/hono/dist/cjs/jsx/dom/render.js +2 -0
  91. package/node_modules/hono/dist/cjs/middleware/cache/index.js +1 -1
  92. package/node_modules/hono/dist/cjs/middleware/cors/index.js +1 -1
  93. package/node_modules/hono/dist/cjs/middleware/csrf/index.js +1 -1
  94. package/node_modules/hono/dist/cjs/middleware/etag/digest.js +1 -1
  95. package/node_modules/hono/dist/cjs/middleware/etag/index.js +3 -3
  96. package/node_modules/hono/dist/cjs/middleware/pretty-json/index.js +3 -1
  97. package/node_modules/hono/dist/cjs/request.js +8 -4
  98. package/node_modules/hono/dist/cjs/router/linear-router/router.js +7 -2
  99. package/node_modules/hono/dist/cjs/router/pattern-router/router.js +3 -9
  100. package/node_modules/hono/dist/cjs/router/reg-exp-router/node.js +10 -3
  101. package/node_modules/hono/dist/cjs/router/reg-exp-router/router.js +47 -83
  102. package/node_modules/hono/dist/cjs/router/reg-exp-router/trie.js +2 -1
  103. package/node_modules/hono/dist/cjs/router/trie-router/node.js +46 -69
  104. package/node_modules/hono/dist/cjs/router/trie-router/router.js +3 -11
  105. package/node_modules/hono/dist/cjs/router/utils.js +27 -0
  106. package/node_modules/hono/dist/cjs/utils/body.js +15 -3
  107. package/node_modules/hono/dist/cjs/utils/cookie.js +1 -1
  108. package/node_modules/hono/dist/cjs/utils/ipaddr.js +5 -3
  109. package/node_modules/hono/dist/cjs/utils/stream.js +7 -1
  110. package/node_modules/hono/dist/cjs/utils/url.js +9 -1
  111. package/node_modules/hono/dist/client/client.js +25 -11
  112. package/node_modules/hono/dist/client/utils.js +4 -1
  113. package/node_modules/hono/dist/context.js +4 -0
  114. package/node_modules/hono/dist/helper/accepts/accepts.js +36 -2
  115. package/node_modules/hono/dist/helper/ssg/ssg.js +1 -1
  116. package/node_modules/hono/dist/helper/ssg/utils.js +30 -10
  117. package/node_modules/hono/dist/jsx/dom/render.js +2 -0
  118. package/node_modules/hono/dist/middleware/cache/index.js +1 -1
  119. package/node_modules/hono/dist/middleware/cors/index.js +1 -1
  120. package/node_modules/hono/dist/middleware/csrf/index.js +1 -1
  121. package/node_modules/hono/dist/middleware/etag/digest.js +1 -1
  122. package/node_modules/hono/dist/middleware/etag/index.js +3 -3
  123. package/node_modules/hono/dist/middleware/pretty-json/index.js +3 -1
  124. package/node_modules/hono/dist/request.js +8 -4
  125. package/node_modules/hono/dist/router/linear-router/router.js +7 -2
  126. package/node_modules/hono/dist/router/pattern-router/router.js +3 -9
  127. package/node_modules/hono/dist/router/reg-exp-router/node.js +6 -2
  128. package/node_modules/hono/dist/router/reg-exp-router/router.js +53 -84
  129. package/node_modules/hono/dist/router/reg-exp-router/trie.js +2 -1
  130. package/node_modules/hono/dist/router/trie-router/node.js +46 -69
  131. package/node_modules/hono/dist/router/trie-router/router.js +3 -11
  132. package/node_modules/hono/dist/router/utils.js +5 -0
  133. package/node_modules/hono/dist/types/context.d.ts +4 -0
  134. package/node_modules/hono/dist/types/router/reg-exp-router/node.d.ts +3 -0
  135. package/node_modules/hono/dist/types/router/trie-router/node.d.ts +1 -2
  136. package/node_modules/hono/dist/types/router/trie-router/router.d.ts +0 -1
  137. package/node_modules/hono/dist/types/router/utils.d.ts +1 -0
  138. package/node_modules/hono/dist/types/utils/url.d.ts +4 -0
  139. package/node_modules/hono/dist/utils/body.js +15 -3
  140. package/node_modules/hono/dist/utils/cookie.js +1 -1
  141. package/node_modules/hono/dist/utils/ipaddr.js +5 -3
  142. package/node_modules/hono/dist/utils/stream.js +7 -1
  143. package/node_modules/hono/dist/utils/url.js +9 -1
  144. package/node_modules/hono/package.json +1 -1
  145. package/node_modules/ip-address/README.md +92 -82
  146. package/node_modules/ip-address/dist/common.d.ts +20 -0
  147. package/node_modules/ip-address/dist/common.js +36 -0
  148. package/node_modules/ip-address/dist/common.js.map +1 -1
  149. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  150. package/node_modules/ip-address/dist/ipv4.js +75 -0
  151. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  152. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  153. package/node_modules/ip-address/dist/ipv6.js +120 -30
  154. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  155. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  156. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  157. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  158. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  159. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  160. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  161. package/node_modules/ip-address/package.json +1 -1
  162. package/node_modules/is-plain-object/README.md +39 -95
  163. package/node_modules/is-plain-object/dist/is-plain-object.js +0 -2
  164. package/node_modules/is-plain-object/is-plain-object.d.ts +6 -1
  165. package/node_modules/is-plain-object/package.json +8 -34
  166. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
  167. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +10 -20
  168. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
  169. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +16 -38
  170. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
  171. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +19 -38
  172. package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
  173. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
  174. package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
  175. package/node_modules/jose/dist/types/jwks/remote.d.ts +17 -28
  176. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
  177. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
  178. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
  179. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
  180. package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
  181. package/node_modules/jose/dist/types/jws/general/verify.d.ts +12 -21
  182. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
  183. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +17 -29
  184. package/node_modules/jose/dist/types/jwt/sign.d.ts +12 -19
  185. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +17 -28
  186. package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
  187. package/node_modules/jose/dist/types/key/export.d.ts +4 -4
  188. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
  189. package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
  190. package/node_modules/jose/dist/types/key/import.d.ts +10 -17
  191. package/node_modules/jose/dist/types/types.d.ts +48 -86
  192. package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
  193. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
  194. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
  195. package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
  196. package/node_modules/jose/dist/webapi/index.js +70 -32
  197. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
  198. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -26
  199. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -10
  200. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -71
  201. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  202. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -158
  203. package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -18
  204. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -64
  205. package/node_modules/jose/dist/webapi/jwks/local.js +49 -74
  206. package/node_modules/jose/dist/webapi/jwks/remote.js +91 -160
  207. package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -20
  208. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  209. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -30
  210. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -23
  211. package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -70
  212. package/node_modules/jose/dist/webapi/jws/general/verify.js +47 -41
  213. package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -22
  214. package/node_modules/jose/dist/webapi/jwt/encrypt.js +58 -100
  215. package/node_modules/jose/dist/webapi/jwt/sign.js +18 -50
  216. package/node_modules/jose/dist/webapi/jwt/unsecured.js +34 -63
  217. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  218. package/node_modules/jose/dist/webapi/key/export.js +32 -37
  219. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -44
  220. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -39
  221. package/node_modules/jose/dist/webapi/key/import.js +52 -52
  222. package/node_modules/jose/dist/webapi/lib/asn1.js +130 -164
  223. package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
  224. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
  225. package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -123
  226. package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
  227. package/node_modules/jose/dist/webapi/lib/deflate.js +46 -40
  228. package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
  229. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
  230. package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
  231. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
  232. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +210 -176
  233. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +105 -107
  234. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +19 -0
  235. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
  236. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  237. package/node_modules/jose/dist/webapi/lib/jws_sign.js +58 -72
  238. package/node_modules/jose/dist/webapi/lib/jws_verify.js +90 -103
  239. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +134 -185
  240. package/node_modules/jose/dist/webapi/lib/key.js +84 -121
  241. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  242. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  243. package/node_modules/jose/dist/webapi/lib/key_management.js +200 -225
  244. package/node_modules/jose/dist/webapi/lib/key_options.js +8 -0
  245. package/node_modules/jose/dist/webapi/lib/options.js +57 -44
  246. package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
  247. package/node_modules/jose/dist/webapi/lib/type_checks.js +28 -33
  248. package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
  249. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  250. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  251. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  252. package/node_modules/jose/package.json +17 -81
  253. package/package.json +2 -2
  254. package/profiles/calendar/0.5.profile.json +190 -0
  255. package/profiles/charge/0.5.profile.json +210 -0
  256. package/profiles/customers/0.7.profile.json +157 -0
  257. package/profiles/deploy/0.9.profile.json +176 -0
  258. package/profiles/email/0.6.profile.json +208 -0
  259. package/profiles/index.json +9 -1
  260. package/profiles/publish/0.5.profile.json +186 -0
  261. package/profiles/purchase/0.5.profile.json +231 -0
  262. package/profiles/records/0.5.profile.json +117 -0
  263. package/dist/ui/assets/index-0Q2eNytX.js +0 -110
  264. package/node_modules/@modelcontextprotocol/sdk/node_modules/negotiator/HISTORY.md +0 -114
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;AAyCH,wBAoBC;AA+BD,sBAeC;AAzGD,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,YAAY,GAAG,+BAA+B,CAAC;AAErD;;GAEG;AACH,MAAM,YAAY,GAAG,QAAQ,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM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AC,CAAC;QACtC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,KAAK,EAAE,CAAC;IACV,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,MAAc,EAAE,KAAa,EAAE,GAAW;IAC7D,OAAO,GAAG,GAAG,KAAK,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;QACxC,IAAI,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,IAAI;YAAE,MAAM;QACxC,GAAG,EAAE,CAAC;IACR,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,CAAC,GAAW;IAC1B,IAAI,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACvC,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC;IAE3E,MAAM,IAAI,SAAS,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;AACzD,CAAC","sourcesContent":["/*!\n * content-type\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nconst TEXT_REGEXP = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]*$/;\nconst TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * RegExp to match chars that must be quoted-pair in RFC 9110 sec 5.6.4\n */\nconst QUOTE_REGEXP = /[\\\\\"]/g;\n\n/**\n * RegExp to match type in RFC 9110 sec 8.3.1\n *\n * media-type = type \"/\" subtype\n * type = token\n * subtype = token\n */\nconst TYPE_REGEXP =\n /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;\n\n/**\n * Null object perf optimization. Faster than `Object.create(null)` and `{ __proto__: null }`.\n */\nconst NullObject = /* @__PURE__ */ (() => {\n const C = function () {};\n C.prototype = Object.create(null);\n return C;\n})() as unknown as { new (): any };\n\n/**\n * The content type object contains a type string and optional parameters.\n */\nexport interface ContentType {\n type: string;\n index: number;\n parameters: Record<string, string>;\n}\n\n/**\n * Format an object into a `Content-Type` header.\n */\nexport function format(obj: Partial<ContentType>): string {\n const { type, parameters } = obj;\n\n if (!type || !TYPE_REGEXP.test(type)) {\n throw new TypeError(`Invalid type: ${type}`);\n }\n\n let result = type;\n\n if (parameters) {\n for (const param of Object.keys(parameters)) {\n if (!TOKEN_REGEXP.test(param)) {\n throw new TypeError(`Invalid parameter name: ${param}`);\n }\n\n result += `; ${param}=${qstring(parameters[param])}`;\n }\n }\n\n return result;\n}\n\n/**\n * Options for parsing a `Content-Type` header.\n */\nexport interface ParseOptions {\n /**\n * Exit early on the first semicolon, returning only the type.\n * This is useful for parsing the MIME from `Content-Type` headers.\n *\n * @default false\n */\n parameters?: boolean;\n /**\n * Exits early on a comma, returning the first value and parameters.\n * This is useful for parsing `Accept` headers.\n *\n * @default false\n */\n comma?: boolean;\n /**\n * The index to start parsing from.\n *\n * @default 0\n */\n start?: number;\n}\n\n/**\n * Parse a `Content-Type` header.\n */\nexport function parse(header: string, options?: ParseOptions): ContentType {\n const stopChar = options?.comma === true ? COMMA : 65_536; // Sentinel for \"no stop char\".\n const len = header.length;\n let index = skipOWS(header, options?.start ?? 0, len);\n\n const valueStart = index;\n index = skipValue(header, index, len, stopChar);\n const valueEnd = trailingOWS(header, valueStart, index);\n const type = header.slice(valueStart, valueEnd).toLowerCase();\n\n if (options?.parameters === false) {\n return { type, index, parameters: new NullObject() };\n }\n\n return parseParameters(header, type, index, len, stopChar);\n}\n\nconst SP = 32; // \" \"\nconst HTAB = 9; // \"\\t\"\nconst SEMI = 59; // \";\"\nconst EQ = 61; // \"=\"\nconst DQUOTE = 34; // '\"'\nconst BSLASH = 92; // \"\\\\\"\nconst COMMA = 44; // \",\"\n\n/**\n * Parses the parameters of a `Content-Type` header starting at the given index.\n */\nfunction parseParameters(\n header: string,\n type: string,\n index: number,\n len: number,\n stopChar: number,\n): ContentType {\n const parameters: Record<string, string> = new NullObject();\n\n parameter: while (index < len) {\n if (header.charCodeAt(index) === stopChar) break;\n\n index = skipOWS(header, index + 1 /* Skip over ; */, len);\n\n const keyStart = index;\n\n while (index < len) {\n const code = header.charCodeAt(index);\n if (code === stopChar) break parameter;\n\n if (code === SEMI) continue parameter;\n\n if (code === EQ) {\n const keyEnd = trailingOWS(header, keyStart, index);\n const key = header.slice(keyStart, keyEnd).toLowerCase();\n\n index = skipOWS(header, index + 1, len);\n\n if (index < len && header.charCodeAt(index) === DQUOTE) {\n index++;\n\n let value = \"\";\n while (index < len) {\n const code = header.charCodeAt(index++);\n if (code === DQUOTE) {\n index = skipValue(header, index, len, stopChar);\n if (parameters[key] === undefined) parameters[key] = value;\n break;\n }\n\n if (code === BSLASH && index < len) {\n value += header[index++];\n continue;\n }\n\n value += String.fromCharCode(code);\n }\n\n continue parameter;\n }\n\n const valueStart = index;\n index = skipValue(header, index, len, stopChar);\n\n if (parameters[key] === undefined) {\n const valueEnd = trailingOWS(header, valueStart, index);\n parameters[key] = header.slice(valueStart, valueEnd);\n }\n\n continue parameter;\n }\n\n index++;\n }\n }\n\n return { type, index, parameters };\n}\n\n/**\n * Skip over characters until a semicolon or other exit character.\n */\nfunction skipValue(\n str: string,\n index: number,\n len: number,\n stopChar: number,\n): number {\n while (index < len) {\n const code = str.charCodeAt(index);\n if (code === SEMI || code === stopChar) break;\n index++;\n }\n return index;\n}\n\n/**\n * Skip optional whitespace (OWS) in an HTTP header value.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction skipOWS(header: string, index: number, len: number): number {\n while (index < len) {\n const char = header.charCodeAt(index);\n if (char !== SP && char !== HTAB) break;\n index++;\n }\n return index;\n}\n\n/**\n * Trim optional whitespace (OWS) from the end of a substring.\n *\n * OWS is defined in RFC 9110 sec 5.6.3 as SP (\" \") or HTAB (\"\\t\").\n */\nfunction trailingOWS(header: string, start: number, end: number): number {\n while (end > start) {\n const char = header.charCodeAt(end - 1);\n if (char !== SP && char !== HTAB) break;\n end--;\n }\n return end;\n}\n\n/**\n * Serialize a parameter value.\n */\nfunction qstring(str: string): string {\n if (TOKEN_REGEXP.test(str)) return str;\n if (TEXT_REGEXP.test(str)) return `\"${str.replace(QUOTE_REGEXP, \"\\\\$&\")}\"`;\n\n throw new TypeError(`Invalid parameter value: ${str}`);\n}\n"]}
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "content-type",
3
+ "version": "2.1.0",
4
+ "description": "Create and parse HTTP Content-Type header",
5
+ "keywords": [
6
+ "content-type",
7
+ "http",
8
+ "req",
9
+ "res",
10
+ "rfc7231",
11
+ "rfc9110"
12
+ ],
13
+ "repository": "jshttp/content-type",
14
+ "funding": {
15
+ "type": "opencollective",
16
+ "url": "https://opencollective.com/express"
17
+ },
18
+ "license": "MIT",
19
+ "author": "Douglas Christopher Wilson <doug@somethingdoug.com>",
20
+ "type": "commonjs",
21
+ "exports": "./dist/index.js",
22
+ "main": "./dist/index.js",
23
+ "typings": "./dist/index.d.ts",
24
+ "files": [
25
+ "dist/"
26
+ ],
27
+ "scripts": {
28
+ "bench": "vitest bench",
29
+ "build": "ts-scripts build",
30
+ "format": "ts-scripts format",
31
+ "prepare": "ts-scripts install && npm run build",
32
+ "specs": "ts-scripts specs",
33
+ "test": "ts-scripts test"
34
+ },
35
+ "devDependencies": {
36
+ "@borderless/ts-scripts": "^0.15.0",
37
+ "@vitest/coverage-v8": "^3.0.5",
38
+ "typescript": "^5.7.3",
39
+ "vitest": "^3.2.4"
40
+ },
41
+ "engines": {
42
+ "node": ">=18"
43
+ },
44
+ "ts-scripts": {
45
+ "dist": [
46
+ "dist"
47
+ ],
48
+ "project": [
49
+ "tsconfig.build.json"
50
+ ]
51
+ }
52
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "negotiator",
3
3
  "description": "HTTP content negotiation",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "contributors": [
6
6
  "Douglas Christopher Wilson <doug@somethingdoug.com>",
7
7
  "Federico Romero <federico.romero@outboxlabs.com>",
@@ -17,27 +17,33 @@
17
17
  "accept-charset"
18
18
  ],
19
19
  "repository": "jshttp/negotiator",
20
+ "funding": {
21
+ "type": "opencollective",
22
+ "url": "https://opencollective.com/express"
23
+ },
24
+ "dependencies": {
25
+ "content-type": "^2.1.0"
26
+ },
20
27
  "devDependencies": {
21
28
  "eslint": "7.32.0",
22
29
  "eslint-plugin-markdown": "2.2.1",
23
- "mocha": "9.1.3",
24
- "nyc": "15.1.0"
30
+ "mocha": "^11.7.0",
31
+ "nyc": "^17.1.0",
32
+ "vitest": "3.2.4"
25
33
  },
26
34
  "files": [
27
35
  "lib/",
28
- "HISTORY.md",
29
- "LICENSE",
30
- "index.js",
31
- "README.md"
36
+ "index.js"
32
37
  ],
33
38
  "engines": {
34
- "node": ">= 0.6"
39
+ "node": ">=18"
35
40
  },
36
41
  "scripts": {
42
+ "bench": "vitest bench",
37
43
  "lint": "eslint .",
38
- "test": "mocha --reporter spec --check-leaks --bail test/",
44
+ "test": "mocha --reporter spec --check-leaks test/",
39
45
  "test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/",
40
- "test-ci": "nyc --reporter=lcov --reporter=text npm test",
46
+ "test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
41
47
  "test-cov": "nyc --reporter=html --reporter=text npm test"
42
48
  }
43
49
  }
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 07 Aug 2026 17:46:44 GMT
11
+ * Last updated: Tue, 01 Sep 2026 20:06:05 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -316,11 +316,11 @@ declare module "node:buffer" {
316
316
  * such `Buffer` instances with zeroes.
317
317
  *
318
318
  * When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
319
- * allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
320
- * allows applications to avoid the garbage collection overhead of creating many
321
- * individually allocated `Buffer` instances. This approach improves both
322
- * performance and memory usage by eliminating the need to track and clean up as
323
- * many individual `ArrayBuffer` objects.
319
+ * allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
320
+ * from a single pre-allocated `Buffer`. This allows applications to avoid the
321
+ * garbage collection overhead of creating many individually allocated `Buffer`
322
+ * instances. This approach improves both performance and memory usage by
323
+ * eliminating the need to track and clean up as many individual `ArrayBuffer` objects.
324
324
  *
325
325
  * However, in the case where a developer may need to retain a small chunk of
326
326
  * memory from a pool for an indeterminate amount of time, it may be appropriate
@@ -463,4 +463,9 @@ declare module "node:buffer" {
463
463
  */
464
464
  type AllowSharedBuffer = Buffer<ArrayBufferLike>;
465
465
  }
466
+ /**
467
+ * @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
468
+ * TypeScript versions earlier than 5.7.
469
+ */
470
+ type BufferView<T extends NodeJS.ArrayBufferView> = T extends NodeJS.ArrayBufferView<infer B> ? Buffer<B> : never;
466
471
  }
@@ -3475,7 +3475,6 @@ declare module "node:crypto" {
3475
3475
  * ```
3476
3476
  * @since v24.7.0
3477
3477
  * @param algorithm Variant of Argon2, one of `"argon2d"`, `"argon2i"` or `"argon2id"`.
3478
- * @experimental
3479
3478
  */
3480
3479
  function argon2(
3481
3480
  algorithm: Argon2Algorithm,
@@ -3515,7 +3514,6 @@ declare module "node:crypto" {
3515
3514
  * console.log(derivedKey.toString('hex')); // 'af91dad...9520f15'
3516
3515
  * ```
3517
3516
  * @since v24.7.0
3518
- * @experimental
3519
3517
  */
3520
3518
  function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
3521
3519
  /**
@@ -3742,7 +3740,7 @@ declare module "node:crypto" {
3742
3740
  ciphertext: NodeJS.BufferSource,
3743
3741
  sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams,
3744
3742
  extractable: boolean,
3745
- usages: KeyUsage[],
3743
+ keyUsages: KeyUsage[],
3746
3744
  ): Promise<CryptoKey>;
3747
3745
  decrypt(
3748
3746
  algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
@@ -3774,7 +3772,7 @@ declare module "node:crypto" {
3774
3772
  encapsulationKey: CryptoKey,
3775
3773
  sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams,
3776
3774
  extractable: boolean,
3777
- usages: KeyUsage[],
3775
+ keyUsages: KeyUsage[],
3778
3776
  ): Promise<EncapsulatedKey>;
3779
3777
  encrypt(
3780
3778
  algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams,
@@ -15,6 +15,10 @@ declare module "node:dgram" {
15
15
  exclusive?: boolean | undefined;
16
16
  fd?: number | undefined;
17
17
  }
18
+ interface BindSyncOptions {
19
+ port?: number | undefined;
20
+ address?: string | undefined;
21
+ }
18
22
  type SocketType = "udp4" | "udp6";
19
23
  interface SocketOptions extends Abortable {
20
24
  type: SocketType;
@@ -117,10 +121,12 @@ declare module "node:dgram" {
117
121
  * messages on a named `port` and optional `address`. If `port` is not
118
122
  * specified or is `0`, the operating system will attempt to bind to a
119
123
  * random port. If `address` is not specified, the operating system will
120
- * attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is
124
+ * attempt to listen on all addresses. Once binding is complete, a
125
+ * `'listening'` event is emitted and the optional `callback` function is
121
126
  * called.
122
127
  *
123
- * Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very
128
+ * Specifying both a `'listening'` event listener and passing a
129
+ * `callback` to the `socket.bind()` method is not harmful but not very
124
130
  * useful.
125
131
  *
126
132
  * A bound datagram socket keeps the Node.js process running to receive
@@ -157,9 +163,82 @@ declare module "node:dgram" {
157
163
  * @param callback with no parameters. Called when binding is complete.
158
164
  */
159
165
  bind(port?: number, address?: string, callback?: () => void): this;
160
- bind(port?: number, callback?: () => void): this;
161
- bind(callback?: () => void): this;
166
+ bind(port: number, callback: () => void): this;
167
+ bind(callback: () => void): this;
168
+ /**
169
+ * For UDP sockets, causes the `dgram.Socket` to listen for datagram
170
+ * messages on a named `port` and optional `address` that are passed as
171
+ * properties of an `options` object passed as the first argument. If
172
+ * `port` is not specified or is `0`, the operating system will attempt
173
+ * to bind to a random port. If `address` is not specified, the operating
174
+ * system will attempt to listen on all addresses. Once binding is
175
+ * complete, a `'listening'` event is emitted and the optional `callback`
176
+ * function is called.
177
+ *
178
+ * The `options` object may contain a `fd` property. When a `fd` greater
179
+ * than `0` is set, it will wrap around an existing socket with the given
180
+ * file descriptor. In this case, the properties of `port` and `address`
181
+ * will be ignored.
182
+ *
183
+ * Specifying both a `'listening'` event listener and passing a
184
+ * `callback` to the `socket.bind()` method is not harmful but not very
185
+ * useful.
186
+ *
187
+ * The `options` object may contain an additional `exclusive` property that is
188
+ * used when using `dgram.Socket` objects with the [`cluster`](https://nodejs.org/docs/latest-v26.x/api/cluster.html) module. When
189
+ * `exclusive` is set to `false` (the default), cluster workers will use the same
190
+ * underlying socket handle allowing connection handling duties to be shared.
191
+ * When `exclusive` is `true`, however, the handle is not shared and attempted
192
+ * port sharing results in an error. Creating a `dgram.Socket` with the `reusePort`
193
+ * option set to `true` causes `exclusive` to always be `true` when `socket.bind()`
194
+ * is called.
195
+ *
196
+ * A bound datagram socket keeps the Node.js process running to receive
197
+ * datagram messages.
198
+ *
199
+ * If binding fails, an `'error'` event is generated. In rare case (e.g.
200
+ * attempting to bind with a closed socket), an `Error` may be thrown.
201
+ *
202
+ * An example socket listening on an exclusive port is shown below.
203
+ *
204
+ * ```js
205
+ * socket.bind({
206
+ * address: 'localhost',
207
+ * port: 8000,
208
+ * exclusive: true,
209
+ * });
210
+ * ```
211
+ * @since v0.11.14
212
+ * @param options Required. Supports the following properties:
213
+ */
162
214
  bind(options: BindOptions, callback?: () => void): this;
215
+ /**
216
+ * The synchronous counterpart of `socket.bind()`. `bind(2)` is a local,
217
+ * non-blocking system call, so the bind is performed inline and the resolved
218
+ * address is returned immediately, including the operating-system-assigned
219
+ * ephemeral port when `port` is `0`:
220
+ *
221
+ * ```js
222
+ * const dgram = require('node:dgram');
223
+ *
224
+ * const socket = dgram.createSocket('udp4');
225
+ * const address = socket.bindSync({ address: '0.0.0.0', port: 0 });
226
+ * console.log(address); // e.g. { address: '0.0.0.0', family: 'IPv4', port: 53124 }
227
+ * ```
228
+ *
229
+ * A bind failure such as `EADDRINUSE` is thrown synchronously rather than emitted
230
+ * as an `'error'` event. After `bindSync()` returns, `socket.address()` is
231
+ * valid synchronously and the `'listening'` event is emitted on the next tick.
232
+ *
233
+ * `address` must be a numeric IP literal; `bindSync()` never performs DNS
234
+ * resolution (asynchronous name resolution being the only genuinely blocking part
235
+ * of binding). Incoming datagrams continue to be delivered asynchronously via the
236
+ * `'message'` event. `bindSync()` always binds the socket's own handle and
237
+ * does not participate in [`cluster`](https://nodejs.org/docs/latest-v26.x/api/cluster.html) handle sharing.
238
+ * @since v26.4.0
239
+ * @returns The bound address as returned by `socket.address()`.
240
+ */
241
+ bindSync(options?: BindSyncOptions): AddressInfo;
163
242
  /**
164
243
  * Close the underlying socket and stop listening for data on it. If a callback is
165
244
  * provided, it is added as a listener for the `'close'` event.
@@ -182,6 +261,42 @@ declare module "node:dgram" {
182
261
  */
183
262
  connect(port: number, address?: string, callback?: () => void): void;
184
263
  connect(port: number, callback: () => void): void;
264
+ /**
265
+ * The synchronous counterpart of `socket.connect()`. For a UDP socket
266
+ * `connect(2)` only records the default peer address and is a local, non-blocking
267
+ * system call, so the association is performed inline. Any error raised by the
268
+ * call itself (for example `EAFNOSUPPORT` for a mismatched address family) is
269
+ * thrown synchronously rather than reported via the `'error'` event. Because
270
+ * `connect(2)` does not probe reachability, errors such as `ECONNREFUSED` are
271
+ * still surfaced asynchronously on a later send or receive, exactly as for
272
+ * `socket.connect()`:
273
+ *
274
+ * ```js
275
+ * const dgram = require('node:dgram');
276
+ *
277
+ * const socket = dgram.createSocket('udp4');
278
+ * socket.connectSync(41234, '127.0.0.1');
279
+ * console.log(socket.remoteAddress()); // { address: '127.0.0.1', family: 'IPv4', port: 41234 }
280
+ * ```
281
+ *
282
+ * If the socket is still unbound it is bound synchronously first. After
283
+ * `connectSync()` returns, `socket.remoteAddress()` is valid synchronously
284
+ * and the `'connect'` event is emitted on the next tick. Trying to call
285
+ * `connectSync()` on an already connected socket throws an
286
+ * `ERR_SOCKET_DGRAM_IS_CONNECTED` exception, and calling it while an
287
+ * asynchronous [`socket.bind()`][] is still in progress throws an
288
+ * `ERR_SOCKET_ALREADY_BOUND` exception.
289
+ *
290
+ * `address` must be a numeric IP literal; `connectSync()` never performs DNS
291
+ * resolution (asynchronous name resolution being the only genuinely blocking part
292
+ * of connecting).
293
+ * @since v26.4.0
294
+ * @param address A numeric IP address to connect to. Unlike
295
+ * `socket.connect()`, no DNS resolution is performed, so a host name is not
296
+ * accepted. If omitted, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for
297
+ * `udp6` sockets) is used.
298
+ */
299
+ connectSync(port: number, address?: string): void;
185
300
  /**
186
301
  * A synchronous function that disassociates a connected `dgram.Socket` from
187
302
  * its remote address. Trying to call `disconnect()` on an unbound or already
@@ -459,7 +459,7 @@ declare module "node:ffi" {
459
459
  "void": void;
460
460
  "number": number;
461
461
  "bigint": bigint;
462
- "pointer": bigint | null;
462
+ "pointer": bigint;
463
463
  }
464
464
  enum types {
465
465
  VOID = "void",
@@ -1,5 +1,5 @@
1
1
  declare module "node:fs/promises" {
2
- import { NonSharedBuffer } from "node:buffer";
2
+ import { BufferView, NonSharedBuffer } from "node:buffer";
3
3
  import { Abortable } from "node:events";
4
4
  import { Interface as ReadlineInterface } from "node:readline";
5
5
  import {
@@ -20,6 +20,10 @@ declare module "node:fs/promises" {
20
20
  OpenDirOptions,
21
21
  OpenMode,
22
22
  PathLike,
23
+ ReadFileOptions,
24
+ ReadFileOptionsWithBuffer,
25
+ ReadFileOptionsWithBufferEncoding,
26
+ ReadFileOptionsWithStringEncoding,
23
27
  ReadOptions,
24
28
  ReadOptionsWithBuffer,
25
29
  ReadPosition,
@@ -36,7 +40,6 @@ declare module "node:fs/promises" {
36
40
  WriteStream,
37
41
  WriteVResult,
38
42
  } from "node:fs";
39
- import { Stream } from "node:stream";
40
43
  import { ByteReadableStream, Transform, Writer } from "node:stream/iter";
41
44
  import { ReadableStream } from "node:stream/web";
42
45
  interface FileChangeInfo<T extends string | Buffer> {
@@ -357,39 +360,61 @@ declare module "node:fs/promises" {
357
360
  *
358
361
  * If `options` is a string, then it specifies the `encoding`.
359
362
  *
363
+ * If `buffer` is provided and no encoding is specified, the returned {Buffer} is
364
+ * a view over the supplied buffer containing only the bytes read. If the
365
+ * supplied buffer is too small to contain the entire file, the operation will
366
+ * fail.
367
+ *
360
368
  * The `FileHandle` has to support reading.
361
369
  *
362
- * If one or more `filehandle.read()` calls are made on a file handle and then a `filehandle.readFile()` call is made, the data will be read from the current
370
+ * If one or more `filehandle.read()` calls are made on a file handle and then a
371
+ * `filehandle.readFile()` call is made, the data will be read from the current
363
372
  * position till the end of the file. It doesn't always read from the beginning
364
373
  * of the file.
374
+ *
375
+ * An example using the `buffer` option with a pre-allocated buffer:
376
+ *
377
+ * ```js
378
+ * import { Buffer } from 'node:buffer';
379
+ * import { open } from 'node:fs/promises';
380
+ *
381
+ * const file = await open('./some/file/to/read');
382
+ * try {
383
+ * const buf = Buffer.alloc(16384);
384
+ * const contents = await file.readFile({ buffer: buf });
385
+ * console.log(contents); // A view over `buf` containing only the bytes read
386
+ * } finally {
387
+ * await file.close();
388
+ * }
389
+ * ```
390
+ *
391
+ * An example using the `buffer` option with a function returning a buffer:
392
+ *
393
+ * ```js
394
+ * import { Buffer } from 'node:buffer';
395
+ * import { open } from 'node:fs/promises';
396
+ *
397
+ * const file = await open('./some/file/to/read');
398
+ * try {
399
+ * const contents = await file.readFile({
400
+ * buffer: (size) => Buffer.alloc(size),
401
+ * });
402
+ * console.log(contents);
403
+ * } finally {
404
+ * await file.close();
405
+ * }
406
+ * ```
365
407
  * @since v10.0.0
366
- * @return Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the
367
- * data will be a string.
368
- */
369
- readFile(
370
- options?:
371
- | ({ encoding?: null | undefined } & Abortable)
372
- | null,
373
- ): Promise<NonSharedBuffer>;
374
- /**
375
- * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
376
- * The `FileHandle` must have been opened for reading.
408
+ * @returns Fulfills upon a successful read with the contents of the
409
+ * file. If no encoding is specified (using `options.encoding`), the data is
410
+ * returned as a `Buffer` object. Otherwise, the data will be a string.
377
411
  */
378
- readFile(
379
- options:
380
- | ({ encoding: BufferEncoding } & Abortable)
381
- | BufferEncoding,
382
- ): Promise<string>;
383
- /**
384
- * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
385
- * The `FileHandle` must have been opened for reading.
386
- */
387
- readFile(
388
- options?:
389
- | (ObjectEncodingOptions & Abortable)
390
- | BufferEncoding
391
- | null,
392
- ): Promise<string | NonSharedBuffer>;
412
+ readFile<T extends NodeJS.ArrayBufferView>(
413
+ options: Omit<ReadFileOptionsWithBuffer<T>, "flag">,
414
+ ): Promise<BufferView<T>>;
415
+ readFile(options?: Omit<ReadFileOptionsWithBufferEncoding, "flag"> | null): Promise<NonSharedBuffer>;
416
+ readFile(options: Omit<ReadFileOptionsWithStringEncoding, "flag"> | BufferEncoding): Promise<string>;
417
+ readFile(options: Omit<ReadFileOptions, "flag"> | BufferEncoding | null): Promise<string | NonSharedBuffer>;
393
418
  /**
394
419
  * Convenience method to create a `readline` interface and stream over the file.
395
420
  * See `filehandle.createReadStream()` for the options.
@@ -1310,50 +1335,21 @@ declare module "node:fs/promises" {
1310
1335
  * @param path filename or `FileHandle`
1311
1336
  * @return Fulfills with the contents of the file.
1312
1337
  */
1338
+ function readFile<T extends NodeJS.ArrayBufferView>(
1339
+ path: PathLike | FileHandle,
1340
+ options: ReadFileOptionsWithBuffer<T>,
1341
+ ): Promise<BufferView<T>>;
1313
1342
  function readFile(
1314
1343
  path: PathLike | FileHandle,
1315
- options?:
1316
- | ({
1317
- encoding?: null | undefined;
1318
- flag?: OpenMode | undefined;
1319
- } & Abortable)
1320
- | null,
1344
+ options?: ReadFileOptionsWithBufferEncoding | null,
1321
1345
  ): Promise<NonSharedBuffer>;
1322
- /**
1323
- * Asynchronously reads the entire contents of a file.
1324
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1325
- * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
1326
- * @param options An object that may contain an optional flag.
1327
- * If a flag is not provided, it defaults to `'r'`.
1328
- */
1329
1346
  function readFile(
1330
1347
  path: PathLike | FileHandle,
1331
- options:
1332
- | ({
1333
- encoding: BufferEncoding;
1334
- flag?: OpenMode | undefined;
1335
- } & Abortable)
1336
- | BufferEncoding,
1348
+ options: ReadFileOptionsWithStringEncoding | BufferEncoding,
1337
1349
  ): Promise<string>;
1338
- /**
1339
- * Asynchronously reads the entire contents of a file.
1340
- * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
1341
- * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically.
1342
- * @param options An object that may contain an optional flag.
1343
- * If a flag is not provided, it defaults to `'r'`.
1344
- */
1345
1350
  function readFile(
1346
1351
  path: PathLike | FileHandle,
1347
- options?:
1348
- | (
1349
- & ObjectEncodingOptions
1350
- & Abortable
1351
- & {
1352
- flag?: OpenMode | undefined;
1353
- }
1354
- )
1355
- | BufferEncoding
1356
- | null,
1352
+ options: ReadFileOptions | BufferEncoding | null,
1357
1353
  ): Promise<string | NonSharedBuffer>;
1358
1354
  /**
1359
1355
  * Asynchronously open a directory for iterative scanning. See the POSIX [`opendir(3)`](http://man7.org/linux/man-pages/man3/opendir.3.html) documentation for more detail.