@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.
Files changed (81) hide show
  1. package/README.md +353 -56
  2. package/dist/index.min.js +7 -29
  3. package/dist/src/index.d.ts +384 -69
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +345 -77
  6. package/dist/src/index.js.map +1 -1
  7. package/dist/src/singleton.d.ts +3 -0
  8. package/dist/src/singleton.d.ts.map +1 -0
  9. package/dist/src/singleton.js +15 -0
  10. package/dist/src/singleton.js.map +1 -0
  11. package/dist/src/types.d.ts +2 -0
  12. package/dist/src/types.d.ts.map +1 -0
  13. package/dist/src/types.js +2 -0
  14. package/dist/src/types.js.map +1 -0
  15. package/dist/src/utils/dag-cbor-to-safe-json.d.ts +7 -0
  16. package/dist/src/utils/dag-cbor-to-safe-json.d.ts.map +1 -0
  17. package/dist/src/utils/dag-cbor-to-safe-json.js +25 -0
  18. package/dist/src/utils/dag-cbor-to-safe-json.js.map +1 -0
  19. package/dist/src/utils/get-content-disposition-filename.d.ts +6 -0
  20. package/dist/src/utils/get-content-disposition-filename.d.ts.map +1 -0
  21. package/dist/src/utils/get-content-disposition-filename.js +16 -0
  22. package/dist/src/utils/get-content-disposition-filename.js.map +1 -0
  23. package/dist/src/utils/get-e-tag.d.ts +28 -0
  24. package/dist/src/utils/get-e-tag.d.ts.map +1 -0
  25. package/dist/src/utils/get-e-tag.js +18 -0
  26. package/dist/src/utils/get-e-tag.js.map +1 -0
  27. package/dist/src/utils/get-stream-from-async-iterable.d.ts +10 -0
  28. package/dist/src/utils/get-stream-from-async-iterable.d.ts.map +1 -0
  29. package/dist/src/utils/{get-stream-and-content-type.js → get-stream-from-async-iterable.js} +11 -11
  30. package/dist/src/utils/get-stream-from-async-iterable.js.map +1 -0
  31. package/dist/src/utils/get-tar-stream.d.ts +4 -0
  32. package/dist/src/utils/get-tar-stream.d.ts.map +1 -0
  33. package/dist/src/utils/get-tar-stream.js +46 -0
  34. package/dist/src/utils/get-tar-stream.js.map +1 -0
  35. package/dist/src/utils/parse-resource.d.ts +6 -1
  36. package/dist/src/utils/parse-resource.d.ts.map +1 -1
  37. package/dist/src/utils/parse-resource.js +2 -2
  38. package/dist/src/utils/parse-resource.js.map +1 -1
  39. package/dist/src/utils/parse-url-string.d.ts +10 -3
  40. package/dist/src/utils/parse-url-string.d.ts.map +1 -1
  41. package/dist/src/utils/parse-url-string.js +8 -4
  42. package/dist/src/utils/parse-url-string.js.map +1 -1
  43. package/dist/src/utils/responses.d.ts +5 -0
  44. package/dist/src/utils/responses.d.ts.map +1 -0
  45. package/dist/src/utils/responses.js +27 -0
  46. package/dist/src/utils/responses.js.map +1 -0
  47. package/dist/src/utils/select-output-type.d.ts +12 -0
  48. package/dist/src/utils/select-output-type.d.ts.map +1 -0
  49. package/dist/src/utils/select-output-type.js +148 -0
  50. package/dist/src/utils/select-output-type.js.map +1 -0
  51. package/dist/src/utils/walk-path.d.ts +2 -1
  52. package/dist/src/utils/walk-path.d.ts.map +1 -1
  53. package/dist/src/utils/walk-path.js +1 -3
  54. package/dist/src/utils/walk-path.js.map +1 -1
  55. package/dist/src/verified-fetch.d.ts +24 -27
  56. package/dist/src/verified-fetch.d.ts.map +1 -1
  57. package/dist/src/verified-fetch.js +297 -150
  58. package/dist/src/verified-fetch.js.map +1 -1
  59. package/dist/typedoc-urls.json +25 -18
  60. package/package.json +58 -116
  61. package/src/index.ts +391 -72
  62. package/src/singleton.ts +20 -0
  63. package/src/types.ts +1 -0
  64. package/src/utils/dag-cbor-to-safe-json.ts +27 -0
  65. package/src/utils/get-content-disposition-filename.ts +18 -0
  66. package/src/utils/get-e-tag.ts +36 -0
  67. package/src/utils/{get-stream-and-content-type.ts → get-stream-from-async-iterable.ts} +10 -9
  68. package/src/utils/get-tar-stream.ts +68 -0
  69. package/src/utils/parse-url-string.ts +17 -3
  70. package/src/utils/responses.ts +29 -0
  71. package/src/utils/select-output-type.ts +167 -0
  72. package/src/utils/walk-path.ts +4 -5
  73. package/src/verified-fetch.ts +340 -153
  74. package/dist/src/utils/get-content-type.d.ts +0 -11
  75. package/dist/src/utils/get-content-type.d.ts.map +0 -1
  76. package/dist/src/utils/get-content-type.js +0 -43
  77. package/dist/src/utils/get-content-type.js.map +0 -1
  78. package/dist/src/utils/get-stream-and-content-type.d.ts +0 -9
  79. package/dist/src/utils/get-stream-and-content-type.d.ts.map +0 -1
  80. package/dist/src/utils/get-stream-and-content-type.js.map +0 -1
  81. package/src/utils/get-content-type.ts +0 -55
@@ -1,20 +1,27 @@
1
1
  {
2
- "CIDDetail": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CIDDetail.html",
3
- ".:CIDDetail": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CIDDetail.html",
4
- "CIDDetailError": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CIDDetailError.html",
5
- ".:CIDDetailError": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CIDDetailError.html",
6
- "CreateVerifiedFetchWithOptions": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CreateVerifiedFetchWithOptions.html",
7
- ".:CreateVerifiedFetchWithOptions": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.CreateVerifiedFetchWithOptions.html",
8
- "VerifiedFetch": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.VerifiedFetch.html",
9
- ".:VerifiedFetch": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.VerifiedFetch.html",
10
- "VerifiedFetchInit": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.VerifiedFetchInit.html",
11
- ".:VerifiedFetchInit": "https://ipfs.github.io/helia/interfaces/_helia_verified_fetch.VerifiedFetchInit.html",
12
- "BubbledProgressEvents": "https://ipfs.github.io/helia/types/_helia_verified_fetch.BubbledProgressEvents.html",
13
- ".:BubbledProgressEvents": "https://ipfs.github.io/helia/types/_helia_verified_fetch.BubbledProgressEvents.html",
14
- "Resource": "https://ipfs.github.io/helia/types/_helia_verified_fetch.Resource.html",
15
- ".:Resource": "https://ipfs.github.io/helia/types/_helia_verified_fetch.Resource.html",
16
- "VerifiedFetchProgressEvents": "https://ipfs.github.io/helia/types/_helia_verified_fetch.VerifiedFetchProgressEvents.html",
17
- ".:VerifiedFetchProgressEvents": "https://ipfs.github.io/helia/types/_helia_verified_fetch.VerifiedFetchProgressEvents.html",
18
- "createVerifiedFetch": "https://ipfs.github.io/helia/functions/_helia_verified_fetch.createVerifiedFetch.html",
19
- ".:createVerifiedFetch": "https://ipfs.github.io/helia/functions/_helia_verified_fetch.createVerifiedFetch.html"
2
+ "CIDDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/CIDDetail.html",
3
+ ".:CIDDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/CIDDetail.html",
4
+ "CIDDetailError": "https://ipfs.github.io/helia-verified-fetch/interfaces/CIDDetailError.html",
5
+ ".:CIDDetailError": "https://ipfs.github.io/helia-verified-fetch/interfaces/CIDDetailError.html",
6
+ "ContentTypeParser": "https://ipfs.github.io/helia-verified-fetch/interfaces/ContentTypeParser.html",
7
+ ".:ContentTypeParser": "https://ipfs.github.io/helia-verified-fetch/interfaces/ContentTypeParser.html",
8
+ "CreateVerifiedFetchInit": "https://ipfs.github.io/helia-verified-fetch/interfaces/CreateVerifiedFetchInit.html",
9
+ ".:CreateVerifiedFetchInit": "https://ipfs.github.io/helia-verified-fetch/interfaces/CreateVerifiedFetchInit.html",
10
+ "CreateVerifiedFetchOptions": "https://ipfs.github.io/helia-verified-fetch/interfaces/CreateVerifiedFetchOptions.html",
11
+ ".:CreateVerifiedFetchOptions": "https://ipfs.github.io/helia-verified-fetch/interfaces/CreateVerifiedFetchOptions.html",
12
+ "ResourceDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/ResourceDetail.html",
13
+ ".:ResourceDetail": "https://ipfs.github.io/helia-verified-fetch/interfaces/ResourceDetail.html",
14
+ "VerifiedFetch": "https://ipfs.github.io/helia-verified-fetch/interfaces/VerifiedFetch.html",
15
+ ".:VerifiedFetch": "https://ipfs.github.io/helia-verified-fetch/interfaces/VerifiedFetch.html",
16
+ "VerifiedFetchInit": "https://ipfs.github.io/helia-verified-fetch/interfaces/VerifiedFetchInit.html",
17
+ ".:VerifiedFetchInit": "https://ipfs.github.io/helia-verified-fetch/interfaces/VerifiedFetchInit.html",
18
+ "BubbledProgressEvents": "https://ipfs.github.io/helia-verified-fetch/types/BubbledProgressEvents.html",
19
+ ".:BubbledProgressEvents": "https://ipfs.github.io/helia-verified-fetch/types/BubbledProgressEvents.html",
20
+ "Resource": "https://ipfs.github.io/helia-verified-fetch/types/Resource.html",
21
+ ".:Resource": "https://ipfs.github.io/helia-verified-fetch/types/Resource.html",
22
+ "VerifiedFetchProgressEvents": "https://ipfs.github.io/helia-verified-fetch/types/VerifiedFetchProgressEvents.html",
23
+ ".:VerifiedFetchProgressEvents": "https://ipfs.github.io/helia-verified-fetch/types/VerifiedFetchProgressEvents.html",
24
+ "createVerifiedFetch": "https://ipfs.github.io/helia-verified-fetch/functions/createVerifiedFetch.html",
25
+ ".:createVerifiedFetch": "https://ipfs.github.io/helia-verified-fetch/functions/createVerifiedFetch.html",
26
+ "verifiedFetch": "https://ipfs.github.io/helia-verified-fetch/functions/verifiedFetch-1.html"
20
27
  }
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@helia/verified-fetch",
3
- "version": "0.0.0",
4
- "description": "A fetch-like API for obtaining verified & trustless IPFS content on the web.",
3
+ "version": "1.0.1",
4
+ "description": "A fetch-like API for obtaining verified & trustless IPFS content on the web",
5
5
  "license": "Apache-2.0 OR MIT",
6
- "homepage": "https://github.com/ipfs/helia/tree/main/packages/verified-fetch#readme",
6
+ "homepage": "https://github.com/ipfs/helia-verified-fetch/tree/main/packages/verified-fetch#readme",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/ipfs/helia.git"
9
+ "url": "git+https://github.com/ipfs/helia-verified-fetch.git"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/ipfs/helia/issues"
12
+ "url": "https://github.com/ipfs/helia-verified-fetch/issues"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public",
16
+ "provenance": true
13
17
  },
14
18
  "keywords": [
15
19
  "IPFS",
@@ -37,95 +41,11 @@
37
41
  "sourceType": "module"
38
42
  }
39
43
  },
40
- "release": {
41
- "branches": [
42
- "main"
43
- ],
44
- "plugins": [
45
- [
46
- "@semantic-release/commit-analyzer",
47
- {
48
- "preset": "conventionalcommits",
49
- "releaseRules": [
50
- {
51
- "breaking": true,
52
- "release": "major"
53
- },
54
- {
55
- "revert": true,
56
- "release": "patch"
57
- },
58
- {
59
- "type": "feat",
60
- "release": "minor"
61
- },
62
- {
63
- "type": "fix",
64
- "release": "patch"
65
- },
66
- {
67
- "type": "docs",
68
- "release": "patch"
69
- },
70
- {
71
- "type": "test",
72
- "release": "patch"
73
- },
74
- {
75
- "type": "deps",
76
- "release": "patch"
77
- },
78
- {
79
- "scope": "no-release",
80
- "release": false
81
- }
82
- ]
83
- }
84
- ],
85
- [
86
- "@semantic-release/release-notes-generator",
87
- {
88
- "preset": "conventionalcommits",
89
- "presetConfig": {
90
- "types": [
91
- {
92
- "type": "feat",
93
- "section": "Features"
94
- },
95
- {
96
- "type": "fix",
97
- "section": "Bug Fixes"
98
- },
99
- {
100
- "type": "chore",
101
- "section": "Trivial Changes"
102
- },
103
- {
104
- "type": "docs",
105
- "section": "Documentation"
106
- },
107
- {
108
- "type": "deps",
109
- "section": "Dependencies"
110
- },
111
- {
112
- "type": "test",
113
- "section": "Tests"
114
- }
115
- ]
116
- }
117
- }
118
- ],
119
- "@semantic-release/changelog",
120
- "@semantic-release/npm",
121
- "@semantic-release/github",
122
- "@semantic-release/git"
123
- ]
124
- },
125
44
  "scripts": {
126
45
  "clean": "aegir clean",
127
46
  "lint": "aegir lint",
128
47
  "dep-check": "aegir dep-check",
48
+ "doc-check": "aegir doc-check",
129
49
  "build": "aegir build",
130
50
  "test": "aegir test",
131
51
  "test:chrome": "aegir test -t browser --cov",
@@ -137,35 +57,57 @@
137
57
  "release": "aegir release"
138
58
  },
139
59
  "dependencies": {
140
- "@helia/block-brokers": "^2.0.1",
141
- "@helia/dag-cbor": "^3.0.0",
142
- "@helia/dag-json": "^3.0.0",
143
- "@helia/http": "^1.0.1",
144
- "@helia/interface": "^4.0.0",
145
- "@helia/ipns": "^6.0.0",
146
- "@helia/json": "^3.0.0",
147
- "@helia/routers": "^1.0.0",
148
- "@helia/unixfs": "^3.0.0",
149
- "@ipld/dag-cbor": "^9.1.0",
150
- "@ipld/dag-json": "^10.1.7",
151
- "@ipld/dag-pb": "^4.0.8",
152
- "@libp2p/interface": "^1.1.2",
153
- "@libp2p/peer-id": "^4.0.5",
60
+ "@helia/block-brokers": "^2.0.2",
61
+ "@helia/car": "^3.1.0",
62
+ "@helia/http": "^1.0.2",
63
+ "@helia/interface": "^4.0.1",
64
+ "@helia/ipns": "^6.0.1",
65
+ "@helia/routers": "^1.0.1",
66
+ "@helia/unixfs": "^3.0.1",
67
+ "@ipld/dag-cbor": "^9.2.0",
68
+ "@ipld/dag-json": "^10.2.0",
69
+ "@ipld/dag-pb": "^4.1.0",
70
+ "@libp2p/interface": "^1.1.4",
71
+ "@libp2p/kad-dht": "^12.0.8",
72
+ "@libp2p/peer-id": "^4.0.7",
73
+ "cborg": "^4.0.9",
154
74
  "hashlru": "^2.3.0",
155
- "ipfs-unixfs-exporter": "^13.4.0",
156
- "mime-types": "^2.1.35",
157
- "multiformats": "^13.0.0",
158
- "progress-events": "^1.0.0"
75
+ "interface-blockstore": "^5.2.10",
76
+ "interface-datastore": "^8.2.11",
77
+ "ipfs-unixfs-exporter": "^13.5.0",
78
+ "it-map": "^3.0.5",
79
+ "it-pipe": "^3.0.1",
80
+ "it-tar": "^6.0.5",
81
+ "it-to-browser-readablestream": "^2.0.6",
82
+ "multiformats": "^13.1.0",
83
+ "progress-events": "^1.0.0",
84
+ "uint8arrays": "^5.0.2"
159
85
  },
160
86
  "devDependencies": {
161
- "@libp2p/logger": "^4.0.5",
162
- "@libp2p/peer-id-factory": "^4.0.5",
163
- "@types/mime-types": "^2.1.4",
164
- "@types/sinon": "^17.0.2",
165
- "aegir": "^42.1.0",
166
- "helia": "^4.0.1",
167
- "interface-blockstore": "^5.2.9",
87
+ "@helia/car": "^3.1.0",
88
+ "@helia/dag-cbor": "^3.0.1",
89
+ "@helia/dag-json": "^3.0.1",
90
+ "@helia/json": "^3.0.1",
91
+ "@helia/utils": "^0.0.2",
92
+ "@ipld/car": "^5.3.0",
93
+ "@libp2p/logger": "^4.0.7",
94
+ "@libp2p/peer-id-factory": "^4.0.7",
95
+ "@sgtpooki/file-type": "^1.0.1",
96
+ "@types/sinon": "^17.0.3",
97
+ "aegir": "^42.2.5",
98
+ "blockstore-core": "^4.4.0",
99
+ "browser-readablestream-to-it": "^2.0.5",
100
+ "datastore-core": "^9.2.9",
101
+ "helia": "^4.0.2",
102
+ "ipfs-unixfs-importer": "^15.2.4",
103
+ "ipns": "^9.0.0",
104
+ "it-all": "^3.0.4",
105
+ "it-last": "^3.0.4",
106
+ "it-to-buffer": "^4.0.5",
107
+ "magic-bytes.js": "^1.8.0",
108
+ "p-defer": "^4.0.0",
168
109
  "sinon": "^17.0.1",
169
110
  "sinon-ts": "^2.0.0"
170
- }
111
+ },
112
+ "sideEffects": false
171
113
  }