@helia/verified-fetch 0.0.0 → 1.0.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.
- package/README.md +353 -56
- package/dist/index.min.js +7 -29
- package/dist/src/index.d.ts +384 -69
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +345 -77
- package/dist/src/index.js.map +1 -1
- package/dist/src/singleton.d.ts +3 -0
- package/dist/src/singleton.d.ts.map +1 -0
- package/dist/src/singleton.js +15 -0
- package/dist/src/singleton.js.map +1 -0
- package/dist/src/types.d.ts +2 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/utils/dag-cbor-to-safe-json.d.ts +7 -0
- package/dist/src/utils/dag-cbor-to-safe-json.d.ts.map +1 -0
- package/dist/src/utils/dag-cbor-to-safe-json.js +25 -0
- package/dist/src/utils/dag-cbor-to-safe-json.js.map +1 -0
- package/dist/src/utils/get-content-disposition-filename.d.ts +6 -0
- package/dist/src/utils/get-content-disposition-filename.d.ts.map +1 -0
- package/dist/src/utils/get-content-disposition-filename.js +16 -0
- package/dist/src/utils/get-content-disposition-filename.js.map +1 -0
- package/dist/src/utils/get-e-tag.d.ts +28 -0
- package/dist/src/utils/get-e-tag.d.ts.map +1 -0
- package/dist/src/utils/get-e-tag.js +18 -0
- package/dist/src/utils/get-e-tag.js.map +1 -0
- package/dist/src/utils/get-stream-from-async-iterable.d.ts +10 -0
- package/dist/src/utils/get-stream-from-async-iterable.d.ts.map +1 -0
- package/dist/src/utils/{get-stream-and-content-type.js → get-stream-from-async-iterable.js} +11 -11
- package/dist/src/utils/get-stream-from-async-iterable.js.map +1 -0
- package/dist/src/utils/get-tar-stream.d.ts +4 -0
- package/dist/src/utils/get-tar-stream.d.ts.map +1 -0
- package/dist/src/utils/get-tar-stream.js +46 -0
- package/dist/src/utils/get-tar-stream.js.map +1 -0
- package/dist/src/utils/parse-resource.d.ts +6 -1
- package/dist/src/utils/parse-resource.d.ts.map +1 -1
- package/dist/src/utils/parse-resource.js +2 -2
- package/dist/src/utils/parse-resource.js.map +1 -1
- package/dist/src/utils/parse-url-string.d.ts +10 -3
- package/dist/src/utils/parse-url-string.d.ts.map +1 -1
- package/dist/src/utils/parse-url-string.js +8 -4
- package/dist/src/utils/parse-url-string.js.map +1 -1
- package/dist/src/utils/responses.d.ts +5 -0
- package/dist/src/utils/responses.d.ts.map +1 -0
- package/dist/src/utils/responses.js +27 -0
- package/dist/src/utils/responses.js.map +1 -0
- package/dist/src/utils/select-output-type.d.ts +12 -0
- package/dist/src/utils/select-output-type.d.ts.map +1 -0
- package/dist/src/utils/select-output-type.js +148 -0
- package/dist/src/utils/select-output-type.js.map +1 -0
- package/dist/src/utils/walk-path.d.ts +2 -1
- package/dist/src/utils/walk-path.d.ts.map +1 -1
- package/dist/src/utils/walk-path.js +1 -3
- package/dist/src/utils/walk-path.js.map +1 -1
- package/dist/src/verified-fetch.d.ts +24 -27
- package/dist/src/verified-fetch.d.ts.map +1 -1
- package/dist/src/verified-fetch.js +297 -150
- package/dist/src/verified-fetch.js.map +1 -1
- package/dist/typedoc-urls.json +25 -18
- package/package.json +58 -116
- package/src/index.ts +391 -72
- package/src/singleton.ts +20 -0
- package/src/types.ts +1 -0
- package/src/utils/dag-cbor-to-safe-json.ts +27 -0
- package/src/utils/get-content-disposition-filename.ts +18 -0
- package/src/utils/get-e-tag.ts +36 -0
- package/src/utils/{get-stream-and-content-type.ts → get-stream-from-async-iterable.ts} +10 -9
- package/src/utils/get-tar-stream.ts +68 -0
- package/src/utils/parse-url-string.ts +17 -3
- package/src/utils/responses.ts +29 -0
- package/src/utils/select-output-type.ts +167 -0
- package/src/utils/walk-path.ts +4 -5
- package/src/verified-fetch.ts +340 -153
- package/dist/src/utils/get-content-type.d.ts +0 -11
- package/dist/src/utils/get-content-type.d.ts.map +0 -1
- package/dist/src/utils/get-content-type.js +0 -43
- package/dist/src/utils/get-content-type.js.map +0 -1
- package/dist/src/utils/get-stream-and-content-type.d.ts +0 -9
- package/dist/src/utils/get-stream-and-content-type.d.ts.map +0 -1
- package/dist/src/utils/get-stream-and-content-type.js.map +0 -1
- package/src/utils/get-content-type.ts +0 -55
package/dist/src/index.d.ts
CHANGED
|
@@ -1,86 +1,94 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
*
|
|
4
|
-
* `@helia/verified-fetch`
|
|
5
|
-
* verifying it.
|
|
4
|
+
* `@helia/verified-fetch` provides a [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)-like API for retrieving content from the [IPFS](https://ipfs.tech/) network.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
* [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object that can be used in a similar manner
|
|
9
|
-
* to the `fetch()` API. This means browser and HTTP caching inside browser main threads, web-workers, and service
|
|
10
|
-
* workers, as well as other features of the `fetch()` API should work in a way familiar to developers.
|
|
6
|
+
* All content is retrieved in a [trustless manner](https://www.techopedia.com/definition/trustless), and the integrity of all bytes are verified by comparing hashes of the data. By default, CIDs are retrieved over HTTP from [trustless gateways](https://specs.ipfs.tech/http-gateways/trustless-gateway/).
|
|
11
7
|
*
|
|
12
|
-
*
|
|
8
|
+
* This is a marked improvement over `fetch` which offers no such protections and is vulnerable to all sorts of attacks like [Content Spoofing](https://owasp.org/www-community/attacks/Content_Spoofing), [DNS Hijacking](https://en.wikipedia.org/wiki/DNS_hijacking), etc.
|
|
9
|
+
*
|
|
10
|
+
* A `verifiedFetch` function is exported to get up and running quickly, and a `createVerifiedFetch` function is also available that allows customizing the underlying [Helia](https://helia.io/) node for complete control over how content is retrieved.
|
|
11
|
+
*
|
|
12
|
+
* Browser-cache-friendly [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) objects are returned which should be instantly familiar to web developers.
|
|
13
13
|
*
|
|
14
14
|
* You may use any supported resource argument to fetch content:
|
|
15
15
|
*
|
|
16
|
-
* - CID instance
|
|
16
|
+
* - [CID](https://multiformats.github.io/js-multiformats/classes/cid.CID.html) instance
|
|
17
17
|
* - IPFS URL
|
|
18
18
|
* - IPNS URL
|
|
19
19
|
*
|
|
20
|
-
* @example
|
|
20
|
+
* @example Getting started
|
|
21
21
|
*
|
|
22
22
|
* ```typescript
|
|
23
|
-
* import {
|
|
24
|
-
*
|
|
25
|
-
* const fetch = await createVerifiedFetch({
|
|
26
|
-
* gateways: ['https://mygateway.example.net', 'https://trustless-gateway.link']
|
|
27
|
-
*})
|
|
23
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
28
24
|
*
|
|
29
|
-
* const resp = await
|
|
25
|
+
* const resp = await verifiedFetch('ipfs://bafy...')
|
|
30
26
|
*
|
|
31
27
|
* const json = await resp.json()
|
|
32
28
|
*```
|
|
33
29
|
*
|
|
34
|
-
*
|
|
35
30
|
* @example Using a CID instance to fetch JSON
|
|
36
31
|
*
|
|
37
32
|
* ```typescript
|
|
38
|
-
* import {
|
|
33
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
39
34
|
* import { CID } from 'multiformats/cid'
|
|
40
35
|
*
|
|
41
|
-
* const
|
|
42
|
-
*
|
|
43
|
-
* })
|
|
44
|
-
*
|
|
45
|
-
* const cid = CID.parse('bafyFoo') // some image file
|
|
46
|
-
* const response = await fetch(cid)
|
|
36
|
+
* const cid = CID.parse('bafyFoo') // some json file
|
|
37
|
+
* const response = await verifiedFetch(cid)
|
|
47
38
|
* const json = await response.json()
|
|
48
39
|
* ```
|
|
49
40
|
*
|
|
50
|
-
* @example Using
|
|
41
|
+
* @example Using IPFS protocol to fetch an image
|
|
51
42
|
*
|
|
52
43
|
* ```typescript
|
|
53
|
-
* import {
|
|
44
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
54
45
|
*
|
|
55
|
-
* const
|
|
56
|
-
* gateways: ['https://mygateway.example.net', 'https://trustless-gateway.link']
|
|
57
|
-
* })
|
|
58
|
-
* const response = await fetch('ipfs://bafyFoo') // CID for some image file
|
|
46
|
+
* const response = await verifiedFetch('ipfs://bafyFoo') // CID for some image file
|
|
59
47
|
* const blob = await response.blob()
|
|
60
48
|
* const image = document.createElement('img')
|
|
61
49
|
* image.src = URL.createObjectURL(blob)
|
|
62
50
|
* document.body.appendChild(image)
|
|
63
51
|
* ```
|
|
64
52
|
*
|
|
65
|
-
* @example Using
|
|
53
|
+
* @example Using IPNS protocol to stream a big file
|
|
54
|
+
*
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
57
|
+
*
|
|
58
|
+
* const response = await verifiedFetch('ipns://mydomain.com/path/to/very-long-file.log')
|
|
59
|
+
* const bigFileStreamReader = await response.body?.getReader()
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* ## Configuration
|
|
63
|
+
*
|
|
64
|
+
* ### Custom HTTP gateways and routers
|
|
65
|
+
*
|
|
66
|
+
* Out of the box `@helia/verified-fetch` uses a default set of [trustless gateways](https://specs.ipfs.tech/http-gateways/trustless-gateway/) for fetching blocks and [HTTP delegated routers](https://specs.ipfs.tech/routing/http-routing-v1/) for performing routing tasks - looking up peers, resolving/publishing [IPNS](https://docs.ipfs.tech/concepts/ipns/) names, etc.
|
|
67
|
+
*
|
|
68
|
+
* It's possible to override these by passing `gateways` and `routers` keys to the `createVerifiedFetch` function:
|
|
69
|
+
*
|
|
70
|
+
* @example Configuring gateways and routers
|
|
66
71
|
*
|
|
67
72
|
* ```typescript
|
|
68
73
|
* import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
69
74
|
*
|
|
70
75
|
* const fetch = await createVerifiedFetch({
|
|
71
|
-
*
|
|
76
|
+
* gateways: ['https://trustless-gateway.link'],
|
|
77
|
+
* routers: ['http://delegated-ipfs.dev']
|
|
72
78
|
* })
|
|
73
|
-
* const response = await fetch('ipns://mydomain.com/path/to/very-long-file.log')
|
|
74
|
-
* const bigFileStreamReader = await response.body.getReader()
|
|
75
|
-
* ```
|
|
76
79
|
*
|
|
77
|
-
*
|
|
80
|
+
* const resp = await fetch('ipfs://bafy...')
|
|
78
81
|
*
|
|
79
|
-
*
|
|
82
|
+
* const json = await resp.json()
|
|
83
|
+
*```
|
|
80
84
|
*
|
|
81
|
-
*
|
|
85
|
+
* ### Usage with customized Helia
|
|
86
|
+
*
|
|
87
|
+
* For full control of how `@helia/verified-fetch` fetches content from the distributed web you can pass a preconfigured Helia node to `createVerifiedFetch`.
|
|
82
88
|
*
|
|
83
|
-
* The
|
|
89
|
+
* The [helia](https://www.npmjs.com/package/helia) module is configured with a libp2p node that is suited for decentralized applications, alternatively [@helia/http](https://www.npmjs.com/package/@helia/http) is available which uses HTTP gateways for all network operations.
|
|
90
|
+
*
|
|
91
|
+
* You can see variations of Helia and js-libp2p configuration options at https://helia.io/interfaces/helia.index.HeliaInit.html.
|
|
84
92
|
*
|
|
85
93
|
* ```typescript
|
|
86
94
|
* import { trustlessGateway } from '@helia/block-brokers'
|
|
@@ -90,13 +98,13 @@
|
|
|
90
98
|
*
|
|
91
99
|
* const fetch = await createVerifiedFetch(
|
|
92
100
|
* await createHeliaHTTP({
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
101
|
+
* blockBrokers: [
|
|
102
|
+
* trustlessGateway({
|
|
103
|
+
* gateways: ['https://mygateway.example.net', 'https://trustless-gateway.link']
|
|
104
|
+
* })
|
|
105
|
+
* ],
|
|
106
|
+
* routers: ['http://delegated-ipfs.dev'].map((routerUrl) => delegatedHTTPRouting(routerUrl))
|
|
107
|
+
* })
|
|
100
108
|
* )
|
|
101
109
|
*
|
|
102
110
|
* const resp = await fetch('ipfs://bafy...')
|
|
@@ -104,30 +112,297 @@
|
|
|
104
112
|
* const json = await resp.json()
|
|
105
113
|
* ```
|
|
106
114
|
*
|
|
107
|
-
* ###
|
|
115
|
+
* ### Custom content-type parsing
|
|
116
|
+
*
|
|
117
|
+
* By default, if the response can be parsed as JSON, `@helia/verified-fetch` sets the `Content-Type` header as `application/json`, otherwise it sets it as `application/octet-stream` - this is because the `.json()`, `.text()`, `.blob()`, and `.arrayBuffer()` methods will usually work as expected without a detailed content type.
|
|
118
|
+
*
|
|
119
|
+
* If you require an accurate content-type you can provide a `contentTypeParser` function as an option to `createVerifiedFetch` to handle parsing the content type.
|
|
120
|
+
*
|
|
121
|
+
* The function you provide will be called with the first chunk of bytes from the file and should return a string or a promise of a string.
|
|
122
|
+
*
|
|
123
|
+
* @example Customizing content-type parsing
|
|
124
|
+
*
|
|
125
|
+
* ```typescript
|
|
126
|
+
* import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
127
|
+
* import { fileTypeFromBuffer } from '@sgtpooki/file-type'
|
|
128
|
+
*
|
|
129
|
+
* const fetch = await createVerifiedFetch({
|
|
130
|
+
* gateways: ['https://trustless-gateway.link'],
|
|
131
|
+
* routers: ['http://delegated-ipfs.dev']
|
|
132
|
+
* }, {
|
|
133
|
+
* contentTypeParser: async (bytes) => {
|
|
134
|
+
* // call to some magic-byte recognition library like magic-bytes, file-type, or your own custom byte recognition
|
|
135
|
+
* const result = await fileTypeFromBuffer(bytes)
|
|
136
|
+
* return result?.mime
|
|
137
|
+
* }
|
|
138
|
+
* })
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* ### Custom DNS resolvers
|
|
142
|
+
*
|
|
143
|
+
* If you don't want to leak DNS queries to the default resolvers, you can provide your own list of DNS resolvers to `createVerifiedFetch`.
|
|
144
|
+
*
|
|
145
|
+
* Note that you do not need to provide both a DNS-over-HTTPS and a DNS-over-JSON resolver, and you should prefer `dnsJsonOverHttps` resolvers for usage in the browser for a smaller bundle size. See https://github.com/ipfs/helia/tree/main/packages/ipns#example---using-dns-json-over-https for more information.
|
|
146
|
+
*
|
|
147
|
+
* @example Customizing DNS resolvers
|
|
148
|
+
*
|
|
149
|
+
* ```typescript
|
|
150
|
+
* import { createVerifiedFetch } from '@helia/verified-fetch'
|
|
151
|
+
* import { dnsJsonOverHttps, dnsOverHttps } from '@helia/ipns/dns-resolvers'
|
|
152
|
+
*
|
|
153
|
+
* const fetch = await createVerifiedFetch({
|
|
154
|
+
* gateways: ['https://trustless-gateway.link'],
|
|
155
|
+
* routers: ['http://delegated-ipfs.dev'],
|
|
156
|
+
* dnsResolvers: [
|
|
157
|
+
* dnsJsonOverHttps('https://my-dns-resolver.example.com/dns-json'),
|
|
158
|
+
* dnsOverHttps('https://my-dns-resolver.example.com/dns-query')
|
|
159
|
+
* ]
|
|
160
|
+
* })
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* ### IPLD codec handling
|
|
164
|
+
*
|
|
165
|
+
* IPFS supports several data formats (typically referred to as codecs) which are included in the CID. `@helia/verified-fetch` attempts to abstract away some of the details for easier consumption.
|
|
166
|
+
*
|
|
167
|
+
* #### DAG-PB
|
|
168
|
+
*
|
|
169
|
+
* [DAG-PB](https://ipld.io/docs/codecs/known/dag-pb/) is the codec we are most likely to encounter, it is what [UnixFS](https://github.com/ipfs/specs/blob/main/UNIXFS.md) uses under the hood.
|
|
170
|
+
*
|
|
171
|
+
* ##### Using the DAG-PB codec as a Blob
|
|
172
|
+
*
|
|
173
|
+
* ```typescript
|
|
174
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
175
|
+
*
|
|
176
|
+
* const res = await verifiedFetch('ipfs://Qmfoo')
|
|
177
|
+
* const blob = await res.blob()
|
|
178
|
+
*
|
|
179
|
+
* console.info(blob) // Blob { size: x, type: 'application/octet-stream' }
|
|
180
|
+
* ```
|
|
181
|
+
*
|
|
182
|
+
* ##### Using the DAG-PB codec as an ArrayBuffer
|
|
108
183
|
*
|
|
109
|
-
*
|
|
184
|
+
* ```typescript
|
|
185
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
186
|
+
*
|
|
187
|
+
* const res = await verifiedFetch('ipfs://Qmfoo')
|
|
188
|
+
* const buf = await res.arrayBuffer()
|
|
189
|
+
*
|
|
190
|
+
* console.info(buf) // ArrayBuffer { [Uint8Contents]: < ... >, byteLength: x }
|
|
191
|
+
* ```
|
|
192
|
+
*
|
|
193
|
+
* ##### Using the DAG-PB codec as a stream
|
|
194
|
+
*
|
|
195
|
+
* ```typescript
|
|
196
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
197
|
+
*
|
|
198
|
+
* const res = await verifiedFetch('ipfs://Qmfoo')
|
|
199
|
+
* const reader = res.body?.getReader()
|
|
200
|
+
*
|
|
201
|
+
* if (reader == null) {
|
|
202
|
+
* throw new Error('Could not create reader from response body')
|
|
203
|
+
* }
|
|
204
|
+
*
|
|
205
|
+
* while (true) {
|
|
206
|
+
* const next = await reader.read()
|
|
207
|
+
*
|
|
208
|
+
* if (next?.done === true) {
|
|
209
|
+
* break
|
|
210
|
+
* }
|
|
211
|
+
*
|
|
212
|
+
* if (next?.value != null) {
|
|
213
|
+
* console.info(next.value) // Uint8Array(x) [ ... ]
|
|
214
|
+
* }
|
|
215
|
+
* }
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* ##### Content-Type
|
|
219
|
+
*
|
|
220
|
+
* When fetching `DAG-PB` data, the content type will be set to `application/octet-stream` unless a custom content-type parser is configured.
|
|
221
|
+
*
|
|
222
|
+
* #### JSON
|
|
223
|
+
*
|
|
224
|
+
* The JSON codec is a very simple codec, a block parseable with this codec is a JSON string encoded into a `Uint8Array`.
|
|
225
|
+
*
|
|
226
|
+
* ##### Using the JSON codec
|
|
227
|
+
*
|
|
228
|
+
* ```typescript
|
|
229
|
+
* import * as json from 'multiformats/codecs/json'
|
|
230
|
+
*
|
|
231
|
+
* const block = new TextEncoder().encode('{ "hello": "world" }')
|
|
232
|
+
* const obj = json.decode(block)
|
|
233
|
+
*
|
|
234
|
+
* console.info(obj) // { hello: 'world' }
|
|
235
|
+
* ```
|
|
236
|
+
*
|
|
237
|
+
* ##### Content-Type
|
|
238
|
+
*
|
|
239
|
+
* When the `JSON` codec is encountered, the `Content-Type` header of the response will be set to `application/json`.
|
|
240
|
+
*
|
|
241
|
+
* ### DAG-JSON
|
|
242
|
+
*
|
|
243
|
+
* [DAG-JSON](https://ipld.io/docs/codecs/known/dag-json/) expands on the `JSON` codec, adding the ability to contain [CID](https://docs.ipfs.tech/concepts/content-addressing/)s which act as links to other blocks, and byte arrays.
|
|
244
|
+
*
|
|
245
|
+
* `CID`s and byte arrays are represented using special object structures with a single `"/"` property.
|
|
246
|
+
*
|
|
247
|
+
* Using `DAG-JSON` has two important caveats:
|
|
248
|
+
*
|
|
249
|
+
* 1. Your `JSON` structure cannot contain an object with only a `"/"` property, as it will be interpreted as a special type.
|
|
250
|
+
* 2. Since `JSON` has no technical limit on number sizes, `DAG-JSON` also allows numbers larger than `Number.MAX_SAFE_INTEGER`. JavaScript requires use of `BigInt`s to represent numbers larger than this, and `JSON.parse` does not support them, so precision will be lost.
|
|
251
|
+
*
|
|
252
|
+
* Otherwise this codec follows the same rules as the `JSON` codec.
|
|
253
|
+
*
|
|
254
|
+
* ##### Using the DAG-JSON codec
|
|
255
|
+
*
|
|
256
|
+
* ```typescript
|
|
257
|
+
* import * as dagJson from '@ipld/dag-json'
|
|
258
|
+
*
|
|
259
|
+
* const block = new TextEncoder().encode(`{
|
|
260
|
+
* "hello": "world",
|
|
261
|
+
* "cid": {
|
|
262
|
+
* "/": "baeaaac3imvwgy3zao5xxe3de"
|
|
263
|
+
* },
|
|
264
|
+
* "buf": {
|
|
265
|
+
* "/": {
|
|
266
|
+
* "bytes": "AAECAwQ"
|
|
267
|
+
* }
|
|
268
|
+
* }
|
|
269
|
+
* }`)
|
|
270
|
+
*
|
|
271
|
+
* const obj = dagJson.decode(block)
|
|
272
|
+
*
|
|
273
|
+
* console.info(obj)
|
|
274
|
+
* // {
|
|
275
|
+
* // hello: 'world',
|
|
276
|
+
* // cid: CID(baeaaac3imvwgy3zao5xxe3de),
|
|
277
|
+
* // buf: Uint8Array(5) [ 0, 1, 2, 3, 4 ]
|
|
278
|
+
* // }
|
|
279
|
+
* ```
|
|
280
|
+
*
|
|
281
|
+
* ##### Content-Type
|
|
282
|
+
*
|
|
283
|
+
* When the `DAG-JSON` codec is encountered in the requested CID, the `Content-Type` header of the response will be set to `application/json`.
|
|
284
|
+
*
|
|
285
|
+
* `DAG-JSON` data can be parsed from the response by using the `.json()` function, which will return `CID`s/byte arrays as plain `{ "/": ... }` objects:
|
|
286
|
+
*
|
|
287
|
+
* ```typescript
|
|
288
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
289
|
+
* import * as dagJson from '@ipld/dag-json'
|
|
290
|
+
*
|
|
291
|
+
* const res = await verifiedFetch('ipfs://bafyDAGJSON')
|
|
292
|
+
*
|
|
293
|
+
* // either:
|
|
294
|
+
* const obj = await res.json()
|
|
295
|
+
* console.info(obj.cid) // { "/": "baeaaac3imvwgy3zao5xxe3de" }
|
|
296
|
+
* console.info(obj.buf) // { "/": { "bytes": "AAECAwQ" } }
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* Alternatively, it can be decoded using the `@ipld/dag-json` module and the `.arrayBuffer()` method, in which case you will get `CID` objects and `Uint8Array`s:
|
|
300
|
+
*
|
|
301
|
+
*```typescript
|
|
302
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
303
|
+
* import * as dagJson from '@ipld/dag-json'
|
|
304
|
+
*
|
|
305
|
+
* const res = await verifiedFetch('ipfs://bafyDAGJSON')
|
|
306
|
+
*
|
|
307
|
+
* // or:
|
|
308
|
+
* const obj = dagJson.decode<any>(await res.arrayBuffer())
|
|
309
|
+
* console.info(obj.cid) // CID(baeaaac3imvwgy3zao5xxe3de)
|
|
310
|
+
* console.info(obj.buf) // Uint8Array(5) [ 0, 1, 2, 3, 4 ]
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
* #### DAG-CBOR
|
|
314
|
+
*
|
|
315
|
+
* [DAG-CBOR](https://ipld.io/docs/codecs/known/dag-cbor/) uses the [Concise Binary Object Representation](https://cbor.io/) format for serialization instead of JSON.
|
|
316
|
+
*
|
|
317
|
+
* This supports more datatypes in a safer way than JSON and is smaller on the wire to boot so is usually preferable to JSON or DAG-JSON.
|
|
318
|
+
*
|
|
319
|
+
* ##### Content-Type
|
|
320
|
+
*
|
|
321
|
+
* Not all data types supported by `DAG-CBOR` can be successfully turned into JSON and back into the same binary form.
|
|
322
|
+
*
|
|
323
|
+
* When a decoded block can be round-tripped to JSON, the `Content-Type` will be set to `application/json`. In this case the `.json()` method on the `Response` object can be used to obtain an object representation of the response.
|
|
324
|
+
*
|
|
325
|
+
* When it cannot, the `Content-Type` will be `application/octet-stream` - in this case the `@ipld/dag-json` module must be used to deserialize the return value from `.arrayBuffer()`.
|
|
326
|
+
*
|
|
327
|
+
* ##### Detecting JSON-safe DAG-CBOR
|
|
328
|
+
*
|
|
329
|
+
* If the `Content-Type` header of the response is `application/json`, the `.json()` method may be used to access the response body in object form, otherwise the `.arrayBuffer()` method must be used to decode the raw bytes using the `@ipld/dag-cbor` module.
|
|
330
|
+
*
|
|
331
|
+
* ```typescript
|
|
332
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
333
|
+
* import * as dagCbor from '@ipld/dag-cbor'
|
|
334
|
+
*
|
|
335
|
+
* const res = await verifiedFetch('ipfs://bafyDagCborCID')
|
|
336
|
+
* let obj
|
|
337
|
+
*
|
|
338
|
+
* if (res.headers.get('Content-Type') === 'application/json') {
|
|
339
|
+
* // DAG-CBOR data can be safely decoded as JSON
|
|
340
|
+
* obj = await res.json()
|
|
341
|
+
* } else {
|
|
342
|
+
* // response contains non-JSON friendly data types
|
|
343
|
+
* obj = dagCbor.decode(await res.arrayBuffer())
|
|
344
|
+
* }
|
|
345
|
+
*
|
|
346
|
+
* console.info(obj) // ...
|
|
347
|
+
* ```
|
|
348
|
+
*
|
|
349
|
+
* ## The `Accept` header
|
|
350
|
+
*
|
|
351
|
+
* The `Accept` header can be passed to override certain response processing, or to ensure that the final `Content-Type` of the response is the one that is expected.
|
|
352
|
+
*
|
|
353
|
+
* If the final `Content-Type` does not match the `Accept` header, or if the content cannot be represented in the format dictated by the `Accept` header, or you have configured a custom content type parser, and that parser returns a value that isn't in the accept header, a [406: Not Acceptable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406) response will be returned:
|
|
354
|
+
*
|
|
355
|
+
* ```typescript
|
|
356
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
357
|
+
*
|
|
358
|
+
* const res = await verifiedFetch('ipfs://bafyJPEGImageCID', {
|
|
359
|
+
* headers: {
|
|
360
|
+
* accept: 'image/png'
|
|
361
|
+
* }
|
|
362
|
+
* })
|
|
363
|
+
*
|
|
364
|
+
* console.info(res.status) // 406 - the image was a JPEG but we specified PNG as the accept header
|
|
365
|
+
* ```
|
|
366
|
+
*
|
|
367
|
+
* It can also be used to skip processing the data from some formats such as `DAG-CBOR` if you wish to handle decoding it yourself:
|
|
368
|
+
*
|
|
369
|
+
* ```typescript
|
|
370
|
+
* import { verifiedFetch } from '@helia/verified-fetch'
|
|
371
|
+
*
|
|
372
|
+
* const res = await verifiedFetch('ipfs://bafyDAGCBORCID', {
|
|
373
|
+
* headers: {
|
|
374
|
+
* accept: 'application/octet-stream'
|
|
375
|
+
* }
|
|
376
|
+
* })
|
|
377
|
+
*
|
|
378
|
+
* console.info(res.headers.get('accept')) // application/octet-stream
|
|
379
|
+
* const buf = await res.arrayBuffer() // raw bytes, not processed as JSON
|
|
380
|
+
* ```
|
|
381
|
+
*
|
|
382
|
+
* ## Comparison to fetch
|
|
383
|
+
*
|
|
384
|
+
* This module attempts to act as similarly to the `fetch()` API as possible.
|
|
110
385
|
*
|
|
111
386
|
* [The `fetch()` API](https://developer.mozilla.org/en-US/docs/Web/API/fetch) takes two parameters:
|
|
112
387
|
*
|
|
113
388
|
* 1. A [resource](https://developer.mozilla.org/en-US/docs/Web/API/fetch#resource)
|
|
114
389
|
* 2. An [options object](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options)
|
|
115
390
|
*
|
|
116
|
-
*
|
|
391
|
+
* ### Resource argument
|
|
117
392
|
*
|
|
118
|
-
* This library
|
|
393
|
+
* This library supports the following methods of fetching web3 content from IPFS:
|
|
119
394
|
*
|
|
120
395
|
* 1. IPFS protocol: `ipfs://<cidv0>` & `ipfs://<cidv0>`
|
|
121
396
|
* 2. IPNS protocol: `ipns://<peerId>` & `ipns://<publicKey>` & `ipns://<hostUri_Supporting_DnsLink_TxtRecords>`
|
|
122
397
|
* 3. CID instances: An actual CID instance `CID.parse('bafy...')`
|
|
123
398
|
*
|
|
124
|
-
* As well as support for pathing & params for
|
|
399
|
+
* As well as support for pathing & params for items 1 & 2 above according to [IPFS - Path Gateway Specification](https://specs.ipfs.tech/http-gateways/path-gateway) & [IPFS - Trustless Gateway Specification](https://specs.ipfs.tech/http-gateways/trustless-gateway/). Further refinement of those specifications specifically for web-based scenarios can be found in the [Web Pathing Specification IPIP](https://github.com/ipfs/specs/pull/453).
|
|
125
400
|
*
|
|
126
|
-
* If you pass a CID instance,
|
|
401
|
+
* If you pass a CID instance, it assumes you want the content for that specific CID only, and does not support pathing or params for that CID.
|
|
127
402
|
*
|
|
128
|
-
*
|
|
403
|
+
* ### Options argument
|
|
129
404
|
*
|
|
130
|
-
* This library
|
|
405
|
+
* This library does not plan to support the exact Fetch API options object, as some of the arguments don't make sense. Instead, it will only support options necessary to meet [IPFS specs](https://specs.ipfs.tech/) related to specifying the resultant shape of desired content.
|
|
131
406
|
*
|
|
132
407
|
* Some of those header specifications are:
|
|
133
408
|
*
|
|
@@ -150,7 +425,6 @@
|
|
|
150
425
|
* 5. `body` - An object that specifies the body of the request. Best effort to adhere to the [Fetch API body](https://developer.mozilla.org/en-US/docs/Web/API/fetch#body) parameter.
|
|
151
426
|
* 6. `cache` - Will basically act as `force-cache` for the request. Best effort to adhere to the [Fetch API cache](https://developer.mozilla.org/en-US/docs/Web/API/fetch#cache) parameter.
|
|
152
427
|
*
|
|
153
|
-
*
|
|
154
428
|
* Non-Fetch API options that will be supported:
|
|
155
429
|
*
|
|
156
430
|
* 1. `onProgress` - Similar to Helia `onProgress` options, this will be a function that will be called with a progress event. Supported progress events are:
|
|
@@ -163,7 +437,7 @@
|
|
|
163
437
|
* - `helia:verified-fetch:response:complete` - The response stream has completed.
|
|
164
438
|
* - `helia:verified-fetch:response:error` - An error occurred while building the response.
|
|
165
439
|
*
|
|
166
|
-
* Some in-flight specs (IPIPs) that will affect the options object this library supports in the future can be seen at https://specs.ipfs.tech/ipips,
|
|
440
|
+
* Some in-flight specs (IPIPs) that will affect the options object this library supports in the future can be seen at https://specs.ipfs.tech/ipips, a subset are:
|
|
167
441
|
*
|
|
168
442
|
* 1. [IPIP-0412: Signaling Block Order in CARs on HTTP Gateways](https://specs.ipfs.tech/ipips/ipip-0412/)
|
|
169
443
|
* 2. [IPIP-0402: Partial CAR Support on Trustless Gateways](https://specs.ipfs.tech/ipips/ipip-0402/)
|
|
@@ -171,7 +445,7 @@
|
|
|
171
445
|
* 4. [IPIP-0328: JSON and CBOR Response Formats on HTTP Gateways](https://specs.ipfs.tech/ipips/ipip-0328/)
|
|
172
446
|
* 5. [IPIP-0288: TAR Response Format on HTTP Gateways](https://specs.ipfs.tech/ipips/ipip-0288/)
|
|
173
447
|
*
|
|
174
|
-
*
|
|
448
|
+
* ### Response types
|
|
175
449
|
*
|
|
176
450
|
* This library's purpose is to return reasonably representable content from IPFS. In other words, fetching content is intended for leaf-node content -- such as images/videos/audio & other assets, or other IPLD content (with link) -- that can be represented by https://developer.mozilla.org/en-US/docs/Web/API/Response#instance_methods. The content type you receive back will depend upon the CID you request as well as the `Accept` header value you provide.
|
|
177
451
|
*
|
|
@@ -179,7 +453,7 @@
|
|
|
179
453
|
*
|
|
180
454
|
* If your content doesn't have a mime-type or an [IPFS spec](https://specs.ipfs.tech), this library will not support it, but you can use the [`helia`](https://github.com/ipfs/helia) library directly for those use cases. See [Unsupported response types](#unsupported-response-types) for more information.
|
|
181
455
|
*
|
|
182
|
-
*
|
|
456
|
+
* #### Handling response types
|
|
183
457
|
*
|
|
184
458
|
* For handling responses we want to follow conventions/abstractions from Fetch API where possible:
|
|
185
459
|
*
|
|
@@ -188,12 +462,12 @@
|
|
|
188
462
|
* - For plain text in utf-8, you would call `.text()`
|
|
189
463
|
* - For streaming response data, use something like `response.body.getReader()` to get a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API/Using_readable_streams#consuming_a_fetch_as_a_stream).
|
|
190
464
|
*
|
|
191
|
-
*
|
|
465
|
+
* #### Unsupported response types
|
|
192
466
|
*
|
|
193
467
|
* * Returning IPLD nodes or DAGs as JS objects is not supported, as there is no currently well-defined structure for representing this data in an [HTTP Response](https://developer.mozilla.org/en-US/docs/Web/API/Response). Instead, users should request `aplication/vnd.ipld.car` or use the [`helia`](https://github.com/ipfs/helia) library directly for this use case.
|
|
194
468
|
* * Others? Open an issue or PR!
|
|
195
469
|
*
|
|
196
|
-
*
|
|
470
|
+
* ### Response headers
|
|
197
471
|
*
|
|
198
472
|
* This library will set the [HTTP Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) headers to the appropriate values for the content type according to the appropriate [IPFS Specifications](https://specs.ipfs.tech/).
|
|
199
473
|
*
|
|
@@ -203,13 +477,13 @@
|
|
|
203
477
|
* * https://specs.ipfs.tech/http-gateways/trustless-gateway/#response-headers
|
|
204
478
|
* * https://specs.ipfs.tech/http-gateways/subdomain-gateway/#response-headers
|
|
205
479
|
*
|
|
206
|
-
*
|
|
480
|
+
* ### Possible Scenarios that could cause confusion
|
|
207
481
|
*
|
|
208
|
-
*
|
|
482
|
+
* #### Attempting to fetch the CID for content that does not make sense
|
|
209
483
|
*
|
|
210
484
|
* If you request `bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze`, which points to the root of the en.wikipedia.org mirror, a response object does not make sense.
|
|
211
485
|
*
|
|
212
|
-
*
|
|
486
|
+
* ### Errors
|
|
213
487
|
*
|
|
214
488
|
* Known Errors that can be thrown:
|
|
215
489
|
*
|
|
@@ -219,7 +493,7 @@
|
|
|
219
493
|
* 4. `AbortError` - If the content request is aborted due to user aborting provided AbortSignal.
|
|
220
494
|
*/
|
|
221
495
|
import type { Helia } from '@helia/interface';
|
|
222
|
-
import type { IPNSRoutingEvents, ResolveDnsLinkProgressEvents, ResolveProgressEvents } from '@helia/ipns';
|
|
496
|
+
import type { DNSResolver, IPNSRoutingEvents, ResolveDnsLinkProgressEvents, ResolveProgressEvents } from '@helia/ipns';
|
|
223
497
|
import type { GetEvents } from '@helia/unixfs';
|
|
224
498
|
import type { CID } from 'multiformats/cid';
|
|
225
499
|
import type { ProgressEvent, ProgressOptions } from 'progress-events';
|
|
@@ -227,8 +501,11 @@ import type { ProgressEvent, ProgressOptions } from 'progress-events';
|
|
|
227
501
|
* The types for the first argument of the `verifiedFetch` function.
|
|
228
502
|
*/
|
|
229
503
|
export type Resource = string | CID;
|
|
504
|
+
export interface ResourceDetail {
|
|
505
|
+
resource: Resource;
|
|
506
|
+
}
|
|
230
507
|
export interface CIDDetail {
|
|
231
|
-
cid:
|
|
508
|
+
cid: CID;
|
|
232
509
|
path: string;
|
|
233
510
|
}
|
|
234
511
|
export interface CIDDetailError extends CIDDetail {
|
|
@@ -240,24 +517,62 @@ export interface VerifiedFetch {
|
|
|
240
517
|
stop(): Promise<void>;
|
|
241
518
|
}
|
|
242
519
|
/**
|
|
243
|
-
* Instead of passing a Helia instance, you can pass a list of gateways and
|
|
520
|
+
* Instead of passing a Helia instance, you can pass a list of gateways and
|
|
521
|
+
* routers, and a HeliaHTTP instance will be created for you.
|
|
244
522
|
*/
|
|
245
|
-
export interface
|
|
523
|
+
export interface CreateVerifiedFetchInit {
|
|
246
524
|
gateways: string[];
|
|
247
525
|
routers?: string[];
|
|
526
|
+
/**
|
|
527
|
+
* In order to parse DNSLink records, we need to resolve DNS queries. You can
|
|
528
|
+
* pass a list of DNS resolvers that we will provide to the @helia/ipns
|
|
529
|
+
* instance for you. You must construct them using the `dnsJsonOverHttps` or
|
|
530
|
+
* `dnsOverHttps` functions exported from `@helia/ipns/dns-resolvers`.
|
|
531
|
+
*
|
|
532
|
+
* We use cloudflare and google's dnsJsonOverHttps resolvers by default.
|
|
533
|
+
*
|
|
534
|
+
* @default [dnsJsonOverHttps('https://mozilla.cloudflare-dns.com/dns-query'),dnsJsonOverHttps('https://dns.google/resolve')]
|
|
535
|
+
*/
|
|
536
|
+
dnsResolvers?: DNSResolver[];
|
|
537
|
+
}
|
|
538
|
+
export interface CreateVerifiedFetchOptions {
|
|
539
|
+
/**
|
|
540
|
+
* A function to handle parsing content type from bytes. The function you
|
|
541
|
+
* provide will be passed the first set of bytes we receive from the network,
|
|
542
|
+
* and should return a string that will be used as the value for the
|
|
543
|
+
* `Content-Type` header in the response.
|
|
544
|
+
*
|
|
545
|
+
* @default undefined
|
|
546
|
+
*/
|
|
547
|
+
contentTypeParser?: ContentTypeParser;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* A ContentTypeParser attempts to return the mime type of a given file. It
|
|
551
|
+
* receives the first chunk of the file data and the file name, if it is
|
|
552
|
+
* available. The function can be sync or async and if it returns/resolves to
|
|
553
|
+
* `undefined`, `application/octet-stream` will be used.
|
|
554
|
+
*/
|
|
555
|
+
export interface ContentTypeParser {
|
|
556
|
+
/**
|
|
557
|
+
* Attempt to determine a mime type, either via of the passed bytes or the
|
|
558
|
+
* filename if it is available.
|
|
559
|
+
*/
|
|
560
|
+
(bytes: Uint8Array, fileName?: string): Promise<string | undefined> | string | undefined;
|
|
248
561
|
}
|
|
249
562
|
export type BubbledProgressEvents = GetEvents | ResolveProgressEvents | ResolveDnsLinkProgressEvents | IPNSRoutingEvents;
|
|
250
563
|
export type VerifiedFetchProgressEvents = ProgressEvent<'verified-fetch:request:start', CIDDetail> | ProgressEvent<'verified-fetch:request:info', string> | ProgressEvent<'verified-fetch:request:progress:chunk', CIDDetail> | ProgressEvent<'verified-fetch:request:end', CIDDetail> | ProgressEvent<'verified-fetch:request:error', CIDDetailError>;
|
|
251
564
|
/**
|
|
252
565
|
* Options for the `fetch` function returned by `createVerifiedFetch`.
|
|
253
566
|
*
|
|
254
|
-
* This
|
|
255
|
-
* listen for
|
|
567
|
+
* This interface contains all the same fields as the [options object](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options)
|
|
568
|
+
* passed to `fetch` in browsers, plus an `onProgress` option to listen for
|
|
569
|
+
* progress events.
|
|
256
570
|
*/
|
|
257
571
|
export interface VerifiedFetchInit extends RequestInit, ProgressOptions<BubbledProgressEvents | VerifiedFetchProgressEvents> {
|
|
258
572
|
}
|
|
259
573
|
/**
|
|
260
574
|
* Create and return a Helia node
|
|
261
575
|
*/
|
|
262
|
-
export declare function createVerifiedFetch(init
|
|
576
|
+
export declare function createVerifiedFetch(init?: Helia | CreateVerifiedFetchInit, options?: CreateVerifiedFetchOptions): Promise<VerifiedFetch>;
|
|
577
|
+
export { verifiedFetch } from './singleton.js';
|
|
263
578
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}
|