@le-space/orbitdb-storage-bridge 0.25.0 → 0.26.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 +1 -1
- package/lib/gateway-fetch.js +15 -15
- package/package.json +3 -4
- package/dist/components/StorachaAuth.svelte +0 -801
- package/dist/components/StorachaIntegration.svelte +0 -965
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ entry is the Storacha-era class and the helpers it grew.
|
|
|
74
74
|
| `/backends/encryption` | `withEncryption`: the service holds ciphertext |
|
|
75
75
|
| `/backends/choose` | `createBackendFromChoice`: a backend from a name and a key, for a page's form |
|
|
76
76
|
| `/backends/resolve` | `resolveBackend`: the options-to-backend step the older functions share |
|
|
77
|
-
| `/
|
|
77
|
+
| `/storacha-backup`, `/components/*` | the JavaScript of the old browser widget: `storacha-backup.js`, `WebAuthnDIDProvider.js`, `theme.js`. The two `.svelte` components were dropped — they imported four files no release ever contained ([docs/STORACHA-UI-HISTORY.md](docs/STORACHA-UI-HISTORY.md)) |
|
|
78
78
|
|
|
79
79
|
## Install
|
|
80
80
|
|
package/lib/gateway-fetch.js
CHANGED
|
@@ -116,21 +116,6 @@ const backoffFor = (response, attempt) => {
|
|
|
116
116
|
return 2000 * (attempt + 1);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
/**
|
|
120
|
-
* Fetch the bytes behind a CID, trying each gateway in turn.
|
|
121
|
-
*
|
|
122
|
-
* @param {string} cid
|
|
123
|
-
* @param {Object} [options]
|
|
124
|
-
* @param {string[]} [options.gateways]
|
|
125
|
-
* @param {number} [options.timeout] per request, in ms
|
|
126
|
-
* @param {AbortSignal} [options.signal]
|
|
127
|
-
* @param {string} [options.accept] sent as `Accept`; `RAW_BLOCK` for a single
|
|
128
|
-
* block from a trustless gateway
|
|
129
|
-
* @param {number} [options.maxBackoff] longest 429 wait to honour, in ms
|
|
130
|
-
* @param {(ms: number) => Promise<void>} [options.sleep] injectable for tests
|
|
131
|
-
* @param {typeof fetch} [options.fetchImpl] injectable for tests
|
|
132
|
-
* @returns {Promise<Uint8Array>}
|
|
133
|
-
*/
|
|
134
119
|
/**
|
|
135
120
|
* True unless the CID is a raw sha-256 block whose digest the bytes miss.
|
|
136
121
|
* Anything this cannot check (another codec, another hash, an unparsable
|
|
@@ -157,6 +142,21 @@ export async function matchesRawCid(cid, bytes) {
|
|
|
157
142
|
return true;
|
|
158
143
|
}
|
|
159
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Fetch the bytes behind a CID, trying each gateway in turn.
|
|
147
|
+
*
|
|
148
|
+
* @param {string} cid
|
|
149
|
+
* @param {Object} [options]
|
|
150
|
+
* @param {string[]} [options.gateways]
|
|
151
|
+
* @param {number} [options.timeout] per request, in ms
|
|
152
|
+
* @param {AbortSignal} [options.signal]
|
|
153
|
+
* @param {string} [options.accept] sent as `Accept`; `RAW_BLOCK` for a single
|
|
154
|
+
* block from a trustless gateway
|
|
155
|
+
* @param {number} [options.maxBackoff] longest 429 wait to honour, in ms
|
|
156
|
+
* @param {(ms: number) => Promise<void>} [options.sleep] injectable for tests
|
|
157
|
+
* @param {typeof fetch} [options.fetchImpl] injectable for tests
|
|
158
|
+
* @returns {Promise<Uint8Array>}
|
|
159
|
+
*/
|
|
160
160
|
export async function fetchFromGateways(
|
|
161
161
|
cid,
|
|
162
162
|
{
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/orbitdb-storage-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Back up, restore and replicate OrbitDB databases through pluggable storage backends, with hash and identity preservation",
|
|
5
5
|
"main": "lib/orbitdb-storacha-bridge.js",
|
|
6
|
-
"svelte": "dist/components/",
|
|
7
6
|
"type": "module",
|
|
8
7
|
"exports": {
|
|
9
8
|
".": "./lib/orbitdb-storacha-bridge.js",
|
|
@@ -29,8 +28,6 @@
|
|
|
29
28
|
"./backends/choose": "./lib/backends/choose.js",
|
|
30
29
|
"./backends/resolve": "./lib/backends/resolve.js",
|
|
31
30
|
"./memory-courier": "./lib/memory-courier.js",
|
|
32
|
-
"./StorachaIntegration.svelte": "./dist/components/StorachaIntegration.svelte",
|
|
33
|
-
"./StorachaAuth.svelte": "./dist/components/StorachaAuth.svelte",
|
|
34
31
|
"./storacha-backup": "./dist/components/storacha-backup.js",
|
|
35
32
|
"./components/*": "./dist/components/*"
|
|
36
33
|
},
|
|
@@ -76,6 +73,8 @@
|
|
|
76
73
|
"files": [
|
|
77
74
|
"lib",
|
|
78
75
|
"dist",
|
|
76
|
+
"!dist/components/StorachaAuth.svelte",
|
|
77
|
+
"!dist/components/StorachaIntegration.svelte",
|
|
79
78
|
"!dist/components/StorachaTest.svelte",
|
|
80
79
|
"!dist/components/StorachaTestWithReplication.svelte",
|
|
81
80
|
"!dist/components/StorachaTestWithWebAuthn.svelte",
|