@helia/verified-fetch 2.3.0 → 2.4.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 (47) hide show
  1. package/README.md +8 -0
  2. package/dist/index.min.js +28 -31
  3. package/dist/src/index.d.ts +22 -11
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +9 -0
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/types.d.ts +17 -0
  8. package/dist/src/types.d.ts.map +1 -1
  9. package/dist/src/utils/parse-resource.d.ts +2 -1
  10. package/dist/src/utils/parse-resource.d.ts.map +1 -1
  11. package/dist/src/utils/parse-resource.js +4 -3
  12. package/dist/src/utils/parse-resource.js.map +1 -1
  13. package/dist/src/utils/parse-url-string.d.ts +8 -3
  14. package/dist/src/utils/parse-url-string.d.ts.map +1 -1
  15. package/dist/src/utils/parse-url-string.js +30 -4
  16. package/dist/src/utils/parse-url-string.js.map +1 -1
  17. package/dist/src/utils/server-timing.d.ts +13 -0
  18. package/dist/src/utils/server-timing.d.ts.map +1 -0
  19. package/dist/src/utils/server-timing.js +19 -0
  20. package/dist/src/utils/server-timing.js.map +1 -0
  21. package/dist/src/utils/set-content-type.d.ts +12 -0
  22. package/dist/src/utils/set-content-type.d.ts.map +1 -0
  23. package/dist/src/utils/set-content-type.js +28 -0
  24. package/dist/src/utils/set-content-type.js.map +1 -0
  25. package/dist/src/utils/type-guards.d.ts +2 -0
  26. package/dist/src/utils/type-guards.d.ts.map +1 -0
  27. package/dist/src/utils/type-guards.js +4 -0
  28. package/dist/src/utils/type-guards.js.map +1 -0
  29. package/dist/src/utils/walk-path.d.ts +0 -1
  30. package/dist/src/utils/walk-path.d.ts.map +1 -1
  31. package/dist/src/utils/walk-path.js +1 -1
  32. package/dist/src/utils/walk-path.js.map +1 -1
  33. package/dist/src/verified-fetch.d.ts +9 -1
  34. package/dist/src/verified-fetch.d.ts.map +1 -1
  35. package/dist/src/verified-fetch.js +50 -46
  36. package/dist/src/verified-fetch.js.map +1 -1
  37. package/dist/typedoc-urls.json +0 -1
  38. package/package.json +2 -2
  39. package/src/index.ts +24 -11
  40. package/src/types.ts +19 -0
  41. package/src/utils/parse-resource.ts +5 -4
  42. package/src/utils/parse-url-string.ts +38 -7
  43. package/src/utils/server-timing.ts +37 -0
  44. package/src/utils/set-content-type.ts +38 -0
  45. package/src/utils/type-guards.ts +3 -0
  46. package/src/utils/walk-path.ts +1 -1
  47. package/src/verified-fetch.ts +59 -51
package/README.md CHANGED
@@ -635,6 +635,14 @@ Some known header specifications:
635
635
  - <https://specs.ipfs.tech/http-gateways/trustless-gateway/#response-headers>
636
636
  - <https://specs.ipfs.tech/http-gateways/subdomain-gateway/#response-headers>
637
637
 
638
+ #### Server Timing headers
639
+
640
+ By default, we do not include [Server Timing](https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Server_timing) headers in responses. If you want to include them, you can pass an
641
+ `withServerTiming` option to the `createVerifiedFetch` function to include them in all future responses. You can
642
+ also pass the `withServerTiming` option to each fetch call to include them only for that specific response.
643
+
644
+ See PR where this was added, <https://github.com/ipfs/helia-verified-fetch/pull/164>, for more information.
645
+
638
646
  ### Possible Scenarios that could cause confusion
639
647
 
640
648
  #### Attempting to fetch the CID for content that does not make sense