@helia/verified-fetch 7.2.16 → 8.0.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.
- package/README.md +8 -12
- package/dist/index.min.js +70 -59
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +18 -16
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +38 -34
- package/dist/src/index.js.map +1 -1
- package/dist/src/plugins/plugin-handle-ipns-record.d.ts.map +1 -1
- package/dist/src/plugins/plugin-handle-ipns-record.js +20 -6
- package/dist/src/plugins/plugin-handle-ipns-record.js.map +1 -1
- package/dist/src/plugins/plugin-handle-unixfs.d.ts.map +1 -1
- package/dist/src/plugins/plugin-handle-unixfs.js +7 -4
- package/dist/src/plugins/plugin-handle-unixfs.js.map +1 -1
- package/dist/src/url-resolver.d.ts.map +1 -1
- package/dist/src/url-resolver.js +27 -9
- package/dist/src/url-resolver.js.map +1 -1
- package/dist/src/utils/convert-output.d.ts +2 -2
- package/dist/src/utils/convert-output.d.ts.map +1 -1
- package/dist/src/utils/convert-output.js +11 -5
- package/dist/src/utils/convert-output.js.map +1 -1
- package/dist/src/utils/ipfs-path-to-cid.d.ts +6 -0
- package/dist/src/utils/ipfs-path-to-cid.d.ts.map +1 -0
- package/dist/src/utils/ipfs-path-to-cid.js +9 -0
- package/dist/src/utils/ipfs-path-to-cid.js.map +1 -0
- package/dist/src/utils/libp2p-defaults.browser.js +1 -1
- package/dist/src/utils/libp2p-defaults.browser.js.map +1 -1
- package/dist/src/utils/libp2p-defaults.d.ts.map +1 -1
- package/dist/src/utils/libp2p-defaults.js +2 -10
- package/dist/src/utils/libp2p-defaults.js.map +1 -1
- package/package.json +28 -31
- package/src/index.ts +53 -40
- package/src/plugins/plugin-handle-ipns-record.ts +25 -6
- package/src/plugins/plugin-handle-unixfs.ts +7 -4
- package/src/url-resolver.ts +35 -9
- package/src/utils/convert-output.ts +13 -7
- package/src/utils/ipfs-path-to-cid.ts +9 -0
- package/src/utils/libp2p-defaults.browser.ts +2 -2
- package/src/utils/libp2p-defaults.ts +3 -11
package/README.md
CHANGED
|
@@ -130,23 +130,19 @@ The [helia](https://www.npmjs.com/package/helia) module is configured with a lib
|
|
|
130
130
|
You can see variations of Helia and js-libp2p configuration options at <https://ipfs.github.io/helia/interfaces/helia.HeliaInit.html>.
|
|
131
131
|
|
|
132
132
|
```typescript
|
|
133
|
-
import {
|
|
134
|
-
import {
|
|
133
|
+
import { createHeliaLight } from 'helia'
|
|
134
|
+
import { withHTTP } from '@helia/http'
|
|
135
135
|
import { delegatedHTTPRouting, httpGatewayRouting } from '@helia/routers'
|
|
136
136
|
import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
137
137
|
|
|
138
138
|
const fetch = await createVerifiedFetch(
|
|
139
|
-
await
|
|
140
|
-
|
|
141
|
-
|
|
139
|
+
await withHTTP(createHeliaLight(), {
|
|
140
|
+
delegatedRouters: [
|
|
141
|
+
'http://delegated-ipfs.dev'
|
|
142
142
|
],
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}),
|
|
147
|
-
httpGatewayRouting({
|
|
148
|
-
gateways: ['https://mygateway.example.net', 'https://trustless-gateway.link']
|
|
149
|
-
})
|
|
143
|
+
recursiveGateways: [
|
|
144
|
+
'https://mygateway.example.net',
|
|
145
|
+
'https://trustless-gateway.link'
|
|
150
146
|
]
|
|
151
147
|
})
|
|
152
148
|
)
|