From 5a3999fae480d65f9eaa0b5d00a994fecf18aabb Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Thu, 18 Apr 2024 11:14:43 +0100 Subject: [PATCH] feat: add blob protocol to infra integration tests --- filecoin/package.json | 4 +- package-lock.json | 653 +++++++----------------------------- package.json | 8 +- test/blob.test.js | 91 +++++ test/helpers/blob-client.js | 256 ++++++++++++++ test/helpers/context.js | 8 + test/helpers/up-client.js | 39 ++- test/integration.test.js | 2 +- upload-api/package.json | 6 +- upload-api/scheduler.js | 2 + 10 files changed, 531 insertions(+), 538 deletions(-) create mode 100644 test/blob.test.js create mode 100644 test/helpers/blob-client.js diff --git a/filecoin/package.json b/filecoin/package.json index 149e5a8f..b8dea6ec 100644 --- a/filecoin/package.json +++ b/filecoin/package.json @@ -17,8 +17,8 @@ "@ucanto/principal": "^9.0.1", "@ucanto/transport": "^9.1.1", "@web3-storage/data-segment": "^5.1.0", - "@web3-storage/filecoin-api": "^5.0.0", - "@web3-storage/filecoin-client": "^3.3.1", + "@web3-storage/filecoin-api": "^5.0.1", + "@web3-storage/filecoin-client": "^3.3.2", "fr32-sha2-256-trunc254-padded-binary-tree-multihash": "^3.3.0", "multiformats": "^13.1.0", "p-retry": "^6.2.0", diff --git a/package-lock.json b/package-lock.json index b27e57b9..59dd1f34 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,9 +37,11 @@ "@ucanto/validator": "^9.0.2", "@web-std/blob": "^3.0.4", "@web-std/fetch": "^4.1.0", - "@web3-storage/data-segment": "5.0.0", - "@web3-storage/filecoin-client": "3.0.1", - "@web3-storage/w3up-client": "^12.4.1", + "@web3-storage/capabilities": "14.0.2", + "@web3-storage/content-claims": "^4.0.5", + "@web3-storage/data-segment": "5.1.0", + "@web3-storage/filecoin-client": "3.3.2", + "@web3-storage/w3up-client": "^12.5.3", "ava": "^4.3.3", "chalk": "4.1.2", "constructs": "10.3.0", @@ -85,58 +87,6 @@ "node": ">=16.15" } }, - "billing/node_modules/@ucanto/server": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-10.0.0.tgz", - "integrity": "sha512-JMDMT3tFRE0S1cdtx/Hhh7v9FizV6IS0fPrh6pcli7AzKvXVy8Xu6EQ/66Fax4AQM2tkGxNNxjj2wHM7P4CqAg==", - "dependencies": { - "@ucanto/core": "^10.0.0", - "@ucanto/interface": "^10.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/validator": "^9.0.1" - } - }, - "billing/node_modules/@web3-storage/capabilities": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-14.0.0.tgz", - "integrity": "sha512-i57wEzIjBsz5iCdBJJZCCAN/j0Vknns2NDFEpV732Vo/VxW2PbYqVb0eqEKegDwxdAmkZwyTT6iZQfsebgK7hw==", - "dependencies": { - "@ucanto/core": "^10.0.1", - "@ucanto/interface": "^10.0.1", - "@ucanto/principal": "^9.0.1", - "@ucanto/transport": "^9.1.1", - "@ucanto/validator": "^9.0.2", - "@web3-storage/data-segment": "^3.2.0", - "uint8arrays": "^5.0.3" - } - }, - "billing/node_modules/@web3-storage/capabilities/node_modules/uint8arrays": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.3.tgz", - "integrity": "sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ==", - "dependencies": { - "multiformats": "^13.0.0" - } - }, - "billing/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "billing/node_modules/@web3-storage/data-segment/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "carpark": { "name": "@web3-storage/w3infra-carpark", "version": "0.0.0", @@ -169,8 +119,8 @@ "@ucanto/principal": "^9.0.1", "@ucanto/transport": "^9.1.1", "@web3-storage/data-segment": "^5.1.0", - "@web3-storage/filecoin-api": "^5.0.0", - "@web3-storage/filecoin-client": "^3.3.1", + "@web3-storage/filecoin-api": "^5.0.1", + "@web3-storage/filecoin-client": "^3.3.2", "fr32-sha2-256-trunc254-padded-binary-tree-multihash": "^3.3.0", "multiformats": "^13.1.0", "p-retry": "^6.2.0", @@ -187,38 +137,6 @@ "testcontainers": "^10.7.1" } }, - "filecoin/node_modules/@web3-storage/data-segment": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.1.0.tgz", - "integrity": "sha512-FYdmtKvNiVz+maZ++k4PdD43rfJW5DeagLpstq2y84CyOKNRBWbHLCZ/Ec5zT9iGI+0WgsCGbpC/WlG0jlrnhA==", - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "filecoin/node_modules/@web3-storage/data-segment/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "filecoin/node_modules/@web3-storage/filecoin-client": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-client/-/filecoin-client-3.3.1.tgz", - "integrity": "sha512-GLJW32stM0zhW6Tv9RX2QhXNaJpa3kBsNYyDeYn/VWqTHEhenruSdtseWBnyCi1Y3NGQ2xL/JojOCD94EXA4Yw==", - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/client": "^9.0.1", - "@ucanto/core": "^10.0.1", - "@ucanto/interface": "^10.0.1", - "@ucanto/transport": "^9.1.1", - "@web3-storage/capabilities": "^13.2.1" - } - }, "filecoin/node_modules/uint8arrays": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.6.tgz", @@ -5499,44 +5417,14 @@ } }, "node_modules/@ucanto/server": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-9.0.1.tgz", - "integrity": "sha512-EGhgKLjPgvM39j86WxSD7UoR0rr7jpTMclCOcpOEVC9r91sob8BReW2i7cm1zPvhSNFqS8rLjlGEgUIAhdAxmg==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-10.0.0.tgz", + "integrity": "sha512-JMDMT3tFRE0S1cdtx/Hhh7v9FizV6IS0fPrh6pcli7AzKvXVy8Xu6EQ/66Fax4AQM2tkGxNNxjj2wHM7P4CqAg==", "dependencies": { - "@ucanto/core": "^9.0.0", - "@ucanto/interface": "^9.0.0", + "@ucanto/core": "^10.0.0", + "@ucanto/interface": "^10.0.0", "@ucanto/principal": "^9.0.0", - "@ucanto/validator": "^9.0.0" - } - }, - "node_modules/@ucanto/server/node_modules/@ucanto/core": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-9.0.1.tgz", - "integrity": "sha512-SsYvKCO3FD27roTVcg8ASxnixjn+j96sPlijpVq1uBUxq7SmuNxNPYFZqpxXKj2R4gty/Oc8XTse12ebB9Kofg==", - "dependencies": { - "@ipld/car": "^5.1.0", - "@ipld/dag-cbor": "^9.0.0", - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/interface": "^9.0.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@ucanto/server/node_modules/@ucanto/interface": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-9.0.0.tgz", - "integrity": "sha512-Y9185yj+CRNpT43EAHTe9MpskCgU9DyWvmYyLMMmF40w+ujp6EYy5JVI/gVjJAsh+2Y9ruvWHOF0M+21TnLQyg==", - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@ucanto/server/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "@ucanto/validator": "^9.0.1" } }, "node_modules/@ucanto/transport": { @@ -5635,9 +5523,9 @@ } }, "node_modules/@web3-storage/access": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-18.3.1.tgz", - "integrity": "sha512-NMNBqCcw+mfabrpRqoDWKmWfkioTCTClvSkb0vCpTb0yA/yntkJYG70QIaGdtoHV2Kz1gk4Hj1x9th5nHIKSpA==", + "version": "18.3.2", + "resolved": "https://registry.npmjs.org/@web3-storage/access/-/access-18.3.2.tgz", + "integrity": "sha512-Ry+lMzWkXnr7UXSWWwSBTlbTDfLAfBiwZvocLvrTe1BdBPMI/eQfbI+SNuvMdar0cvJLaLspjkK/IVADsdlBVg==", "dependencies": { "@ipld/car": "^5.1.1", "@ipld/dag-ucan": "^3.4.0", @@ -5648,7 +5536,7 @@ "@ucanto/principal": "^9.0.1", "@ucanto/transport": "^9.1.1", "@ucanto/validator": "^9.0.2", - "@web3-storage/capabilities": "^13.3.1", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/did-mailto": "^2.1.0", "bigint-mod-arith": "^3.1.2", "conf": "11.0.2", @@ -5669,9 +5557,9 @@ } }, "node_modules/@web3-storage/capabilities": { - "version": "13.3.1", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-13.3.1.tgz", - "integrity": "sha512-oiQVsSuT4sxOHrYZz05LTCSV3xfT0ae5sixhvEZZaQAwzpv4xPBI0e5ro1SVNV/8kpCzRT2bq3VY4QlN1EfK/Q==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-14.0.2.tgz", + "integrity": "sha512-0BTzzn60S7eC2xwZjla3v2SNiyxSuVYD2bAokHuO4ztfi0O7L76R2pVDpOI67ZnIL+Cl3FX022NKt+qLxFIoSg==", "dependencies": { "@ucanto/core": "^10.0.1", "@ucanto/interface": "^10.0.1", @@ -5715,13 +5603,14 @@ "integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==" }, "node_modules/@web3-storage/content-claims": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@web3-storage/content-claims/-/content-claims-3.2.1.tgz", - "integrity": "sha512-n8YiHTazMmfLwVeGSM8Wlbp0TBesdS6o+etca5OlZvrudCKD573Ki0rGjaa5zaGk1kMoNGOiRFaTr/4C35sdAg==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/@web3-storage/content-claims/-/content-claims-4.0.5.tgz", + "integrity": "sha512-+WpCkTN8aRfUCrCm0kOMZad+FRnFymVDFvS6/+PJMPGP17cci1/c5lqYdrjFV+5MkhL+BkUJVtRTx02G31FHmQ==", "dependencies": { - "@ucanto/client": "^9.0.0", - "@ucanto/server": "^9.0.1", - "@ucanto/transport": "^9.0.0", + "@ucanto/client": "^9.0.1", + "@ucanto/interface": "^10.0.0", + "@ucanto/server": "^10.0.0", + "@ucanto/transport": "^9.1.1", "carstream": "^1.0.2", "multiformats": "^12.0.1" } @@ -5736,10 +5625,9 @@ } }, "node_modules/@web3-storage/data-segment": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.0.0.tgz", - "integrity": "sha512-5CbElsxec2DsKhEHEh3XRGISAyna+bCjKjjvFrLcYyXLCaiSt/nF3ypcllxwjpE4newMUArymGKGzzZnRWL2kg==", - "dev": true, + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.1.0.tgz", + "integrity": "sha512-FYdmtKvNiVz+maZ++k4PdD43rfJW5DeagLpstq2y84CyOKNRBWbHLCZ/Ec5zT9iGI+0WgsCGbpC/WlG0jlrnhA==", "dependencies": { "@ipld/dag-cbor": "^9.0.5", "multiformats": "^11.0.2", @@ -5750,7 +5638,6 @@ "version": "11.0.2", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "dev": true, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" @@ -5765,9 +5652,9 @@ } }, "node_modules/@web3-storage/filecoin-api": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-api/-/filecoin-api-5.0.0.tgz", - "integrity": "sha512-zKpZ9bv3EvjxH46QPVViLLu+VMxTxH64MtEgG0CZrTOlcwCXIvIgn6LsG58DdXihTZZggTL9PdpxQqPxJIEC5A==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-api/-/filecoin-api-5.0.1.tgz", + "integrity": "sha512-ka7bproL1rQizcOx6+6Dl6wlXxitisxNEasNnGf/8qCKuEL3qm+urZCCI6oXP6qxsugRk8HrzRcqLYp21f3zZA==", "dependencies": { "@ipld/dag-ucan": "^3.4.0", "@ucanto/client": "^9.0.1", @@ -5775,7 +5662,7 @@ "@ucanto/interface": "^10.0.1", "@ucanto/server": "^10.0.0", "@ucanto/transport": "^9.1.1", - "@web3-storage/capabilities": "^13.3.1", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/content-claims": "^4.0.4", "@web3-storage/data-segment": "^4.0.0", "fr32-sha2-256-trunc254-padded-binary-tree-multihash": "^3.3.0", @@ -5785,39 +5672,6 @@ "node": ">=16.15" } }, - "node_modules/@web3-storage/filecoin-api/node_modules/@ucanto/server": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-10.0.0.tgz", - "integrity": "sha512-JMDMT3tFRE0S1cdtx/Hhh7v9FizV6IS0fPrh6pcli7AzKvXVy8Xu6EQ/66Fax4AQM2tkGxNNxjj2wHM7P4CqAg==", - "dependencies": { - "@ucanto/core": "^10.0.0", - "@ucanto/interface": "^10.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/validator": "^9.0.1" - } - }, - "node_modules/@web3-storage/filecoin-api/node_modules/@web3-storage/content-claims": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@web3-storage/content-claims/-/content-claims-4.0.4.tgz", - "integrity": "sha512-zt5psR3SkLbPPHzGzhFXYSJEssDl/ELYbNhEez+tNZLZiagv3Vl0RSt+x3CFFgR5ovO6Zn+pLJJcMjpMiHw0Yw==", - "dependencies": { - "@ucanto/client": "^9.0.1", - "@ucanto/interface": "^10.0.0", - "@ucanto/server": "^10.0.0", - "@ucanto/transport": "^9.1.1", - "carstream": "^1.0.2", - "multiformats": "^12.0.1" - } - }, - "node_modules/@web3-storage/filecoin-api/node_modules/@web3-storage/content-claims/node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@web3-storage/filecoin-api/node_modules/@web3-storage/data-segment": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-4.0.0.tgz", @@ -5838,75 +5692,16 @@ } }, "node_modules/@web3-storage/filecoin-client": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-client/-/filecoin-client-3.0.1.tgz", - "integrity": "sha512-8CCdZ1DDjufrxjzG5MhcBHuunuEWB53cpSszajWLEiKmRAhD+Lyaeucb6I4R4JJpjr6YYQg/heG+TDPEowVmSg==", - "dev": true, - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/client": "^9.0.0", - "@ucanto/core": "^9.0.0", - "@ucanto/interface": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@web3-storage/capabilities": "^11.1.0" - } - }, - "node_modules/@web3-storage/filecoin-client/node_modules/@ucanto/core": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-9.0.1.tgz", - "integrity": "sha512-SsYvKCO3FD27roTVcg8ASxnixjn+j96sPlijpVq1uBUxq7SmuNxNPYFZqpxXKj2R4gty/Oc8XTse12ebB9Kofg==", - "dev": true, - "dependencies": { - "@ipld/car": "^5.1.0", - "@ipld/dag-cbor": "^9.0.0", - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/interface": "^9.0.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@web3-storage/filecoin-client/node_modules/@ucanto/interface": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-9.0.0.tgz", - "integrity": "sha512-Y9185yj+CRNpT43EAHTe9MpskCgU9DyWvmYyLMMmF40w+ujp6EYy5JVI/gVjJAsh+2Y9ruvWHOF0M+21TnLQyg==", - "dev": true, + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-client/-/filecoin-client-3.3.2.tgz", + "integrity": "sha512-cD5a6R8Vwt0vG98WO13Zy2yqnIPCEAXL0skrCliQ1GYm4S0hQQo55bKshg4m60najZwksvIHYXE9cE0Qiu6lMQ==", "dependencies": { "@ipld/dag-ucan": "^3.4.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@web3-storage/filecoin-client/node_modules/@web3-storage/capabilities": { - "version": "11.4.1", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-11.4.1.tgz", - "integrity": "sha512-PjIewEg/T3wfNavxzsZZ5MpH2WBldNz94qOQOKg5iH/4UrS8SPWWGsJx/Tu760O+PFhpTFwvi5cHCtkb08OdAA==", - "dev": true, - "dependencies": { - "@ucanto/core": "^9.0.1", - "@ucanto/interface": "^9.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@ucanto/validator": "^9.0.0", - "@web3-storage/data-segment": "^3.2.0" - } - }, - "node_modules/@web3-storage/filecoin-client/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", - "dev": true, - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "node_modules/@web3-storage/filecoin-client/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "dev": true, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" + "@ucanto/client": "^9.0.1", + "@ucanto/core": "^10.0.1", + "@ucanto/interface": "^10.0.1", + "@ucanto/transport": "^9.1.1", + "@web3-storage/capabilities": "^14.0.2" } }, "node_modules/@web3-storage/multipart-parser": { @@ -5924,9 +5719,9 @@ } }, "node_modules/@web3-storage/upload-api": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/upload-api/-/upload-api-10.0.0.tgz", - "integrity": "sha512-aYC7iFv+WJt8rEDjkptZNvL03oo3g9xatm3PqcZPb9kOIIsoKrUjx1DUP3IsOZv3jTjeuhgGY+hzFWsg8ZII4Q==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/@web3-storage/upload-api/-/upload-api-10.0.1.tgz", + "integrity": "sha512-8HG+QkmTIxaMQPBH8llpiIv9nIfUNHqf0NZ2KtgCVekANVUZgPVTvGYdeTa+kqoDs5Fh01Fhhm6OfVMF8NlZKA==", "dependencies": { "@ucanto/client": "^9.0.1", "@ucanto/interface": "^10.0.1", @@ -5934,11 +5729,11 @@ "@ucanto/server": "^10.0.0", "@ucanto/transport": "^9.1.1", "@ucanto/validator": "^9.0.2", - "@web3-storage/access": "^18.3.1", - "@web3-storage/capabilities": "^14.0.0", + "@web3-storage/access": "^18.3.2", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/content-claims": "^4.0.4", "@web3-storage/did-mailto": "^2.1.0", - "@web3-storage/filecoin-api": "^5.0.0", + "@web3-storage/filecoin-api": "^5.0.1", "multiformats": "^12.1.2", "p-retry": "^5.1.2", "uint8arrays": "^5.0.3" @@ -5952,63 +5747,6 @@ "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.1.tgz", "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==" }, - "node_modules/@web3-storage/upload-api/node_modules/@ucanto/server": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-10.0.0.tgz", - "integrity": "sha512-JMDMT3tFRE0S1cdtx/Hhh7v9FizV6IS0fPrh6pcli7AzKvXVy8Xu6EQ/66Fax4AQM2tkGxNNxjj2wHM7P4CqAg==", - "dependencies": { - "@ucanto/core": "^10.0.0", - "@ucanto/interface": "^10.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/validator": "^9.0.1" - } - }, - "node_modules/@web3-storage/upload-api/node_modules/@web3-storage/capabilities": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-14.0.0.tgz", - "integrity": "sha512-i57wEzIjBsz5iCdBJJZCCAN/j0Vknns2NDFEpV732Vo/VxW2PbYqVb0eqEKegDwxdAmkZwyTT6iZQfsebgK7hw==", - "dependencies": { - "@ucanto/core": "^10.0.1", - "@ucanto/interface": "^10.0.1", - "@ucanto/principal": "^9.0.1", - "@ucanto/transport": "^9.1.1", - "@ucanto/validator": "^9.0.2", - "@web3-storage/data-segment": "^3.2.0", - "uint8arrays": "^5.0.3" - } - }, - "node_modules/@web3-storage/upload-api/node_modules/@web3-storage/content-claims": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@web3-storage/content-claims/-/content-claims-4.0.4.tgz", - "integrity": "sha512-zt5psR3SkLbPPHzGzhFXYSJEssDl/ELYbNhEez+tNZLZiagv3Vl0RSt+x3CFFgR5ovO6Zn+pLJJcMjpMiHw0Yw==", - "dependencies": { - "@ucanto/client": "^9.0.1", - "@ucanto/interface": "^10.0.0", - "@ucanto/server": "^10.0.0", - "@ucanto/transport": "^9.1.1", - "carstream": "^1.0.2", - "multiformats": "^12.0.1" - } - }, - "node_modules/@web3-storage/upload-api/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "node_modules/@web3-storage/upload-api/node_modules/@web3-storage/data-segment/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@web3-storage/upload-api/node_modules/multiformats": { "version": "12.1.3", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", @@ -6047,24 +5785,24 @@ "integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==" }, "node_modules/@web3-storage/upload-client": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-13.0.1.tgz", - "integrity": "sha512-vfAtp1qIIgcoNQ21X/+jrHZjQU28af516YWWkYWbGV68dBzBd9c7r+8KjQwRDIV8kSl0Pmho6Dy1OWlhpZfE6g==", + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/@web3-storage/upload-client/-/upload-client-13.2.2.tgz", + "integrity": "sha512-dtedxw9azYUG5LTbZ37CnjggCRIuSsi0nD8phpWjWN20v3pqlrMCCh4cwl0z1bDk/GnYmOxDBViE19paEaYPBw==", "dev": true, "dependencies": { "@ipld/car": "^5.2.2", "@ipld/dag-cbor": "^9.0.6", "@ipld/dag-ucan": "^3.4.0", "@ipld/unixfs": "^2.1.1", - "@ucanto/client": "^9.0.0", - "@ucanto/interface": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@web3-storage/capabilities": "^13.1.1", - "fr32-sha2-256-trunc254-padded-binary-tree-multihash": "^3.3.0", + "@ucanto/client": "^9.0.1", + "@ucanto/interface": "^10.0.1", + "@ucanto/transport": "^9.1.1", + "@web3-storage/capabilities": "^14.0.2", + "@web3-storage/data-segment": "^5.1.0", + "@web3-storage/filecoin-client": "^3.3.2", "ipfs-utils": "^9.0.14", "multiformats": "^12.1.2", "p-retry": "^5.1.2", - "parallel-transform-web": "^1.0.1", "varint": "^6.0.0" } }, @@ -6074,26 +5812,6 @@ "integrity": "sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==", "dev": true }, - "node_modules/@web3-storage/upload-client/node_modules/@ucanto/interface": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-9.0.0.tgz", - "integrity": "sha512-Y9185yj+CRNpT43EAHTe9MpskCgU9DyWvmYyLMMmF40w+ujp6EYy5JVI/gVjJAsh+2Y9ruvWHOF0M+21TnLQyg==", - "dev": true, - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@web3-storage/upload-client/node_modules/@ucanto/interface/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "dev": true, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@web3-storage/upload-client/node_modules/multiformats": { "version": "12.1.3", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", @@ -6149,99 +5867,27 @@ "link": true }, "node_modules/@web3-storage/w3up-client": { - "version": "12.4.1", - "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-12.4.1.tgz", - "integrity": "sha512-Ti4k5UScn5kdF0A5rz0WkDefD0LofUCUJNDGRYQFudw17FmaZHfQGSQvZ0CozYrCJg8K7JPTbU4/m3joWu0ufQ==", + "version": "12.5.3", + "resolved": "https://registry.npmjs.org/@web3-storage/w3up-client/-/w3up-client-12.5.3.tgz", + "integrity": "sha512-tpkjSU6amVDojiBRK6l43bIPQYcwx63T3uO3jNMMyOo9khzru+wBV2P0mTsMd1VkaBMdxo8ylzLdDPp8m2X5rQ==", "dev": true, "dependencies": { "@ipld/dag-ucan": "^3.4.0", - "@ucanto/client": "^9.0.0", - "@ucanto/core": "^9.0.1", - "@ucanto/interface": "^9.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@web3-storage/access": "^18.2.0", - "@web3-storage/capabilities": "^13.1.1", + "@ucanto/client": "^9.0.1", + "@ucanto/core": "^10.0.1", + "@ucanto/interface": "^10.0.1", + "@ucanto/principal": "^9.0.1", + "@ucanto/transport": "^9.1.1", + "@web3-storage/access": "^18.3.2", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/did-mailto": "^2.1.0", - "@web3-storage/filecoin-client": "^3.2.0", - "@web3-storage/upload-client": "^13.0.1" + "@web3-storage/filecoin-client": "^3.3.2", + "@web3-storage/upload-client": "^13.2.2" }, "engines": { "node": ">=18" } }, - "node_modules/@web3-storage/w3up-client/node_modules/@ucanto/core": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-9.0.1.tgz", - "integrity": "sha512-SsYvKCO3FD27roTVcg8ASxnixjn+j96sPlijpVq1uBUxq7SmuNxNPYFZqpxXKj2R4gty/Oc8XTse12ebB9Kofg==", - "dev": true, - "dependencies": { - "@ipld/car": "^5.1.0", - "@ipld/dag-cbor": "^9.0.0", - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/interface": "^9.0.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@web3-storage/w3up-client/node_modules/@ucanto/interface": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-9.0.0.tgz", - "integrity": "sha512-Y9185yj+CRNpT43EAHTe9MpskCgU9DyWvmYyLMMmF40w+ujp6EYy5JVI/gVjJAsh+2Y9ruvWHOF0M+21TnLQyg==", - "dev": true, - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "multiformats": "^11.0.2" - } - }, - "node_modules/@web3-storage/w3up-client/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", - "dev": true, - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "node_modules/@web3-storage/w3up-client/node_modules/@web3-storage/filecoin-client": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/filecoin-client/-/filecoin-client-3.2.0.tgz", - "integrity": "sha512-4kSyXcN7jPAnpO2U8afheYBRJ4E/8aRJvCvPgHF+HZEtEaLHYuuQzU72Aro94qV0bm5ZRxXPNh6wRSlz/XZLlg==", - "dev": true, - "dependencies": { - "@ipld/dag-ucan": "^3.4.0", - "@ucanto/client": "^9.0.0", - "@ucanto/core": "^9.0.1", - "@ucanto/interface": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@web3-storage/capabilities": "^12.1.0" - } - }, - "node_modules/@web3-storage/w3up-client/node_modules/@web3-storage/filecoin-client/node_modules/@web3-storage/capabilities": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-12.1.0.tgz", - "integrity": "sha512-SlYdPqCokDHb55zlZOvh+n8uEMOrEU413Z1MzQ8HvULpbzfcEtGyOiDgrAhdNEZtPnWHqaUEtU7o829Yw2Ra5w==", - "dev": true, - "dependencies": { - "@ucanto/core": "^9.0.1", - "@ucanto/interface": "^9.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/transport": "^9.0.0", - "@ucanto/validator": "^9.0.1", - "@web3-storage/data-segment": "^3.2.0" - } - }, - "node_modules/@web3-storage/w3up-client/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "dev": true, - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/@whatwg-node/events": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@whatwg-node/events/-/events-0.0.2.tgz", @@ -14572,12 +14218,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/parallel-transform-web": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parallel-transform-web/-/parallel-transform-web-1.0.1.tgz", - "integrity": "sha512-RtPU/7IuwPZ4ePcqoPxNCpjtaXYOkCVtnhh5tW3O78wy9jqVoV2hQHms17kUeu8DTYoOP+mykFLg2agwVKlwBw==", - "dev": true - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -18285,22 +17925,63 @@ "testcontainers": "^10.7.1" } }, - "roundabout/node_modules/@web3-storage/data-segment": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.1.0.tgz", - "integrity": "sha512-FYdmtKvNiVz+maZ++k4PdD43rfJW5DeagLpstq2y84CyOKNRBWbHLCZ/Ec5zT9iGI+0WgsCGbpC/WlG0jlrnhA==", - "dev": true, + "roundabout/node_modules/@ucanto/core": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@ucanto/core/-/core-9.0.1.tgz", + "integrity": "sha512-SsYvKCO3FD27roTVcg8ASxnixjn+j96sPlijpVq1uBUxq7SmuNxNPYFZqpxXKj2R4gty/Oc8XTse12ebB9Kofg==", "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" + "@ipld/car": "^5.1.0", + "@ipld/dag-cbor": "^9.0.0", + "@ipld/dag-ucan": "^3.4.0", + "@ucanto/interface": "^9.0.0", + "multiformats": "^11.0.2" + } + }, + "roundabout/node_modules/@ucanto/interface": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@ucanto/interface/-/interface-9.0.0.tgz", + "integrity": "sha512-Y9185yj+CRNpT43EAHTe9MpskCgU9DyWvmYyLMMmF40w+ujp6EYy5JVI/gVjJAsh+2Y9ruvWHOF0M+21TnLQyg==", + "dependencies": { + "@ipld/dag-ucan": "^3.4.0", + "multiformats": "^11.0.2" + } + }, + "roundabout/node_modules/@ucanto/server": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-9.0.1.tgz", + "integrity": "sha512-EGhgKLjPgvM39j86WxSD7UoR0rr7jpTMclCOcpOEVC9r91sob8BReW2i7cm1zPvhSNFqS8rLjlGEgUIAhdAxmg==", + "dependencies": { + "@ucanto/core": "^9.0.0", + "@ucanto/interface": "^9.0.0", + "@ucanto/principal": "^9.0.0", + "@ucanto/validator": "^9.0.0" + } + }, + "roundabout/node_modules/@web3-storage/content-claims": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@web3-storage/content-claims/-/content-claims-3.2.1.tgz", + "integrity": "sha512-n8YiHTazMmfLwVeGSM8Wlbp0TBesdS6o+etca5OlZvrudCKD573Ki0rGjaa5zaGk1kMoNGOiRFaTr/4C35sdAg==", + "dependencies": { + "@ucanto/client": "^9.0.0", + "@ucanto/server": "^9.0.1", + "@ucanto/transport": "^9.0.0", + "carstream": "^1.0.2", + "multiformats": "^12.0.1" + } + }, + "roundabout/node_modules/@web3-storage/content-claims/node_modules/multiformats": { + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", + "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", + "engines": { + "node": ">=16.0.0", + "npm": ">=7.0.0" } }, "roundabout/node_modules/multiformats": { "version": "11.0.2", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "dev": true, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" @@ -18339,25 +18020,10 @@ "sade": "^1.8.1" } }, - "tools/node_modules/@web3-storage/capabilities": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-14.0.0.tgz", - "integrity": "sha512-i57wEzIjBsz5iCdBJJZCCAN/j0Vknns2NDFEpV732Vo/VxW2PbYqVb0eqEKegDwxdAmkZwyTT6iZQfsebgK7hw==", - "dev": true, - "dependencies": { - "@ucanto/core": "^10.0.1", - "@ucanto/interface": "^10.0.1", - "@ucanto/principal": "^9.0.1", - "@ucanto/transport": "^9.1.1", - "@ucanto/validator": "^9.0.2", - "@web3-storage/data-segment": "^3.2.0", - "uint8arrays": "^5.0.3" - } - }, - "tools/node_modules/@web3-storage/capabilities/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", + "tools/node_modules/@web3-storage/data-segment": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-5.0.0.tgz", + "integrity": "sha512-5CbElsxec2DsKhEHEh3XRGISAyna+bCjKjjvFrLcYyXLCaiSt/nF3ypcllxwjpE4newMUArymGKGzzZnRWL2kg==", "dev": true, "dependencies": { "@ipld/dag-cbor": "^9.0.5", @@ -18375,21 +18041,6 @@ "npm": ">=7.0.0" } }, - "tools/node_modules/uint8arrays": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.3.tgz", - "integrity": "sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ==", - "dev": true, - "dependencies": { - "multiformats": "^13.0.0" - } - }, - "tools/node_modules/uint8arrays/node_modules/multiformats": { - "version": "13.1.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.1.0.tgz", - "integrity": "sha512-HzdtdBwxsIkzpeXzhQ5mAhhuxcHbjEHH+JQoxt7hG/2HGFjjwyolLo7hbaexcnhoEuV4e0TNJ8kkpMjiEYY4VQ==", - "dev": true - }, "upload-api": { "name": "@web3-storage/w3infra-upload-api", "version": "3.0.0", @@ -18409,10 +18060,10 @@ "@ucanto/transport": "^9.1.1", "@ucanto/validator": "^9.0.2", "@web-std/fetch": "^4.1.0", - "@web3-storage/access": "^18.3.1", - "@web3-storage/capabilities": "^14.0.0", + "@web3-storage/access": "^18.3.2", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/did-mailto": "^2.1.0", - "@web3-storage/upload-api": "^10.0.0", + "@web3-storage/upload-api": "^10.0.1", "multiformats": "^13.1.0", "nanoid": "^5.0.2", "preact": "^10.14.1", @@ -18440,17 +18091,6 @@ "node": ">=16.15" } }, - "upload-api/node_modules/@ucanto/server": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/@ucanto/server/-/server-10.0.0.tgz", - "integrity": "sha512-JMDMT3tFRE0S1cdtx/Hhh7v9FizV6IS0fPrh6pcli7AzKvXVy8Xu6EQ/66Fax4AQM2tkGxNNxjj2wHM7P4CqAg==", - "dependencies": { - "@ucanto/core": "^10.0.0", - "@ucanto/interface": "^10.0.0", - "@ucanto/principal": "^9.0.0", - "@ucanto/validator": "^9.0.1" - } - }, "upload-api/node_modules/@web-std/blob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@web-std/blob/-/blob-3.0.4.tgz", @@ -18470,47 +18110,6 @@ "web-streams-polyfill": "^3.1.1" } }, - "upload-api/node_modules/@web3-storage/capabilities": { - "version": "14.0.0", - "resolved": "https://registry.npmjs.org/@web3-storage/capabilities/-/capabilities-14.0.0.tgz", - "integrity": "sha512-i57wEzIjBsz5iCdBJJZCCAN/j0Vknns2NDFEpV732Vo/VxW2PbYqVb0eqEKegDwxdAmkZwyTT6iZQfsebgK7hw==", - "dependencies": { - "@ucanto/core": "^10.0.1", - "@ucanto/interface": "^10.0.1", - "@ucanto/principal": "^9.0.1", - "@ucanto/transport": "^9.1.1", - "@ucanto/validator": "^9.0.2", - "@web3-storage/data-segment": "^3.2.0", - "uint8arrays": "^5.0.3" - } - }, - "upload-api/node_modules/@web3-storage/capabilities/node_modules/uint8arrays": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.3.tgz", - "integrity": "sha512-6LBuKji28kHjgPJMkQ6GDaBb1lRwIhyOYq6pDGwYMoDPfImE9SkuYENVmR0yu9yGgs2clHUSY9fKDukR+AXfqQ==", - "dependencies": { - "multiformats": "^13.0.0" - } - }, - "upload-api/node_modules/@web3-storage/data-segment": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@web3-storage/data-segment/-/data-segment-3.2.0.tgz", - "integrity": "sha512-SM6eNumXzrXiQE2/J59+eEgCRZNYPxKhRoHX2QvV3/scD4qgcf4g+paWBc3UriLEY1rCboygGoPsnqYJNyZyfA==", - "dependencies": { - "@ipld/dag-cbor": "^9.0.5", - "multiformats": "^11.0.2", - "sync-multihash-sha2": "^1.0.0" - } - }, - "upload-api/node_modules/@web3-storage/data-segment/node_modules/multiformats": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-11.0.2.tgz", - "integrity": "sha512-b5mYMkOkARIuVZCpvijFj9a6m5wMVLC7cf/jIPd5D/ARDOfLC5+IFkbgDXQgcU2goIsTD/O9NY4DI/Mt4OGvlg==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "upload-api/node_modules/nanoid": { "version": "5.0.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.6.tgz", diff --git a/package.json b/package.json index 6226e9b7..d76a5bc1 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,11 @@ "@ucanto/validator": "^9.0.2", "@web-std/blob": "^3.0.4", "@web-std/fetch": "^4.1.0", - "@web3-storage/data-segment": "5.0.0", - "@web3-storage/filecoin-client": "3.0.1", - "@web3-storage/w3up-client": "^12.4.1", + "@web3-storage/content-claims": "^4.0.5", + "@web3-storage/capabilities": "14.0.2", + "@web3-storage/data-segment": "5.1.0", + "@web3-storage/filecoin-client": "3.3.2", + "@web3-storage/w3up-client": "^12.5.3", "ava": "^4.3.3", "chalk": "4.1.2", "constructs": "10.3.0", diff --git a/test/blob.test.js b/test/blob.test.js new file mode 100644 index 00000000..2c72ba0f --- /dev/null +++ b/test/blob.test.js @@ -0,0 +1,91 @@ +import { testBlob as test } from './helpers/context.js' + +import { base58btc } from 'multiformats/bases/base58' +import { HeadObjectCommand } from '@aws-sdk/client-s3' +import { Assert } from '@web3-storage/content-claims/capability' +import { useReceiptsStorage } from '../upload-api/stores/receipts.js' + +import { + getStage, + getApiEndpoint, + getAwsBucketClient, + getCloudflareBucketClient, + getCarparkBucketInfo, +} from './helpers/deployment.js' +import { randomFile } from './helpers/random.js' +import { createMailSlurpInbox, setupNewClientWithBlob } from './helpers/up-client.js' + +test.before(t => { + t.context = { + apiEndpoint: getApiEndpoint(), + } +}) + +// Integration test for all flow from uploading a blob, to all the reads pipelines to work. +test('blob integration flow', async t => { + const stage = getStage() + const inbox = await createMailSlurpInbox() + const { client, blobClient } = await setupNewClientWithBlob(t.context.apiEndpoint, { inbox }) + const spaceDid = client.currentSpace()?.did() + if (!spaceDid) { + throw new Error('Testing space DID must be set') + } + + // Prepare data + const file = await randomFile(100) + const data = new Uint8Array(await file.arrayBuffer()) + + // Add blob + // TODO: Rely on new client + const res = await blobClient.add(data) + t.truthy(res) + + // Get bucket clients + const s3Client = getAwsBucketClient() + const r2Client = getCloudflareBucketClient() + + const encodedMultihash = base58btc.encode(res.multihash.bytes) + // Check blob exists in R2, but not S3 + const r2Request = await r2Client.send( + new HeadObjectCommand({ + // Env var + Bucket: 'carpark-staging-0', + Key: `${encodedMultihash}/${encodedMultihash}.blob`, + }) + ) + t.is(r2Request.$metadata.httpStatusCode, 200) + try { + await s3Client.send( + new HeadObjectCommand({ + Bucket: (getCarparkBucketInfo()).Bucket, + Key: `${encodedMultihash}/${encodedMultihash}.blob`, + }) + ) + } catch (cause) { + t.is(cause?.$metadata?.httpStatusCode, 404) + } + + // Check receipts were written + const receiptsStorage = useReceiptsStorage(s3Client, `task-store-${stage}-0`, `invocation-store-${stage}-0`, `workflow-store-${stage}-0`) + const getPutTaskReceipt = await receiptsStorage.get(res.next.put.task.link()) + t.truthy(getPutTaskReceipt.ok?.out.ok) + t.deepEqual(getPutTaskReceipt.ok?.out.ok, {}) + + const getAcceptTaskReceipt = await receiptsStorage.get(res.next.accept.task.link()) + t.truthy(getAcceptTaskReceipt.ok?.out.ok) + t.truthy(getAcceptTaskReceipt.ok?.out.ok.site) + + // Check delegation + const acceptForks = getAcceptTaskReceipt.ok?.fx.fork + if (!acceptForks) { + throw new Error('must have a fork') + } + t.is(acceptForks?.length, 1) + t.truthy(acceptForks?.find(f => f.capabilities[0].can === Assert.location.can)) + + // Read from Roundabout + + // Read from bitswap + + // Check Filecoin offer +}) diff --git a/test/helpers/blob-client.js b/test/helpers/blob-client.js new file mode 100644 index 00000000..c73d6c3c --- /dev/null +++ b/test/helpers/blob-client.js @@ -0,0 +1,256 @@ +import * as BlobCapabilities from '@web3-storage/capabilities/blob' +import * as W3sBlobCapabilities from '@web3-storage/capabilities/web3.storage/blob' +import * as HTTPCapabilities from '@web3-storage/capabilities/http' +import * as UCANCapabilities from '@web3-storage/capabilities/ucan' +import { Receipt } from '@ucanto/core' +import { ed25519 } from '@ucanto/principal' +import { sha256 } from 'multiformats/hashes/sha2' +import { SpaceDID } from '@web3-storage/capabilities/utils' +import pRetry from 'p-retry' + +/** + * @typedef {import('@ucanto/interface').Failure} Failure + * @typedef {import('@web3-storage/capabilities/types').BlobAddSuccess} BlobAddSuccess + * @typedef {import('@web3-storage/capabilities/types').BlobAddFailure} BlobAddFailure + * @typedef {import('@web3-storage/capabilities/types').BlobAllocateSuccess} BlobAllocateSuccess + * @typedef {import('@web3-storage/capabilities/types').BlobAllocateFailure} BlobAllocateFailure + * @typedef {import('@web3-storage/capabilities/types').BlobAcceptSuccess} BlobAcceptSuccess + * @typedef {import('@web3-storage/capabilities/types').BlobAcceptFailure} BlobAcceptFailure + * @typedef {import('@ucanto/interface').Receipt } BlobAddReceipt + * @typedef {import('@ucanto/interface').Receipt } BlobAllocateReceipt + * @typedef {import('@ucanto/interface').Receipt } BlobAcceptReceipt + * @typedef {import('@ucanto/interface').Receipt<{}, Failure> } HTTPPutReceipt + */ + +export async function add( + { issuer, with: resource, proofs, audience }, + data, + options +) { + // prepare data + const multihash = await sha256.digest(data) + const digest = multihash.bytes + const size = data.byteLength + + const conn = options.connection + const blobAddInvocation = BlobCapabilities.add + .invoke({ + issuer, + /* c8 ignore next */ + audience, + with: SpaceDID.from(resource), + nb: { + blob: { + digest, + size, + }, + }, + proofs, + }) + const blobAddresult = await blobAddInvocation.execute(conn) + + if (!blobAddresult.out.ok) { + throw new Error(`failed ${BlobCapabilities.add.can} invocation`, { + cause: blobAddresult.out.error, + }) + } + + // Alocate if there is an address to allocate + const next = parseBlobAddReceiptNext(blobAddresult) + /** @type {import('@web3-storage/capabilities/types').BlobAddress} */ + // @ts-expect-error receipt type is unknown + const address = next.allocate.receipt.out.ok.address + + // Already is uploaded, so we should skip + if (!address || next.accept.receipt || next.put.receipt) { + return { + multihash, + next + } + } + + // Store the blob to the address + const res = await pRetry( + async () => { + const res = await fetch(address.url, { + method: 'PUT', + mode: 'cors', + body: data, + headers: address.headers, + }) + + if (res.status !== 200) { + throw new Error('failed to PUT data') + } + return res + }, + { + onFailedAttempt: console.warn, + retries: options.retries ?? 5, + } + ) + + if (!res.ok) { + throw new Error(`upload failed: ${res.status}`) + } + + // Create `http/put` receipt + const keys = next.put.task.facts[0].keys + // @ts-expect-error Argument of type 'unknown' is not assignable to parameter of type 'SignerArchive<`did:${string}:${string}`, SigAlg>' + const blobProvider = ed25519.from(keys) + + const httpPut = HTTPCapabilities.put.invoke({ + issuer: blobProvider, + audience: blobProvider, + with: blobProvider.toDIDKey(), + nb: { + body: { + digest, + size, + }, + url: { + 'ucan/await': ['.out.ok.address.url', next.allocate.task.link()], + }, + headers: { + 'ucan/await': [ + '.out.ok.address.headers', + next.allocate.task.link(), + ], + }, + }, + facts: next.put.task.facts, + expiration: Infinity, + }) + const httpPutDelegation = await httpPut.delegate() + const httpPutReceipt = await Receipt.issue({ + issuer: blobProvider, + ran: httpPutDelegation.cid, + result: { + ok: {}, + }, + }) + const httpPutConcludeInvocation = createConcludeInvocation( + issuer, + audience, + httpPutReceipt + ) + const ucanConclude = await httpPutConcludeInvocation.execute(conn) + if (!ucanConclude.out.ok) { + throw new Error('invocation failed', { cause: ucanConclude.out.error }) + } + + return { + multihash, + next + } +} + +/** + * @param {import('@ucanto/interface').Receipt} receipt + */ +export function parseBlobAddReceiptNext(receipt) { + // Get invocations next + /** + * @type {import('@ucanto/interface').Invocation[]} + **/ + // @ts-expect-error read only effect + const forkInvocations = receipt.fx.fork + const allocateTask = forkInvocations.find( + (fork) => fork.capabilities[0].can === W3sBlobCapabilities.allocate.can + ) + const concludefxs = forkInvocations.filter( + (fork) => fork.capabilities[0].can === UCANCapabilities.conclude.can + ) + const putTask = forkInvocations.find( + (fork) => fork.capabilities[0].can === HTTPCapabilities.put.can + ) + const acceptTask = receipt.fx.join + if (!allocateTask || !concludefxs.length || !putTask || !acceptTask) { + throw new Error('mandatory effects not received') + } + + // Decode receipts available + const nextReceipts = concludefxs.map((fx) => getConcludeReceipt(fx)) + /** @type {BlobAllocateReceipt | undefined} */ + // @ts-expect-error types unknown for next + const allocateReceipt = nextReceipts.find((receipt) => + receipt.ran.link().equals(allocateTask.cid) + ) + /** @type {HTTPPutReceipt | undefined} */ + // @ts-expect-error types unknown for next + const putReceipt = nextReceipts.find((receipt) => + receipt.ran.link().equals(putTask.cid) + ) + /** @type {BlobAcceptReceipt | undefined} */ + // @ts-expect-error types unknown for next + const acceptReceipt = nextReceipts.find((receipt) => + receipt.ran.link().equals(acceptTask.link()) + ) + + if (!allocateReceipt) { + throw new Error('mandatory effects not received') + } + + return { + allocate: { + task: allocateTask, + receipt: allocateReceipt, + }, + put: { + task: putTask, + receipt: putReceipt, + }, + accept: { + task: acceptTask, + receipt: acceptReceipt, + }, + } +} + +/** + * @param {import('@ucanto/interface').Invocation} concludeFx + */ +export function getConcludeReceipt(concludeFx) { + const receiptBlocks = new Map() + for (const block of concludeFx.iterateIPLDBlocks()) { + receiptBlocks.set(`${block.cid}`, block) + } + return Receipt.view({ + // @ts-expect-error object of type unknown + root: concludeFx.capabilities[0].nb.receipt, + blocks: receiptBlocks, + }) +} + +/** + * @param {import('@ucanto/interface').Signer} id + * @param {import('@ucanto/interface').Verifier} serviceDid + * @param {import('@ucanto/interface').Receipt} receipt + */ +export function createConcludeInvocation(id, serviceDid, receipt) { + const receiptBlocks = [] + const receiptCids = [] + for (const block of receipt.iterateIPLDBlocks()) { + receiptBlocks.push(block) + receiptCids.push(block.cid) + } + const concludeAllocatefx = UCANCapabilities.conclude.invoke({ + issuer: id, + audience: serviceDid, + with: id.toDIDKey(), + nb: { + receipt: receipt.link(), + }, + expiration: Infinity, + facts: [ + { + ...receiptCids, + }, + ], + }) + for (const block of receiptBlocks) { + concludeAllocatefx.attach(block) + } + + return concludeAllocatefx +} diff --git a/test/helpers/context.js b/test/helpers/context.js index 6565a658..204a4e91 100644 --- a/test/helpers/context.js +++ b/test/helpers/context.js @@ -24,10 +24,14 @@ dotenv.config({ * @typedef {object} FilecoinContext * @property {Dynamo} pieceDynamo * @property {string} apiEndpoint + * + * @typedef {object} BlobContext + * @property {string} apiEndpoint * * @typedef {import("ava").TestFn>} TestContextFn * @typedef {import("ava").TestFn>} TestRoundaboutContextFn * @typedef {import("ava").TestFn>} TestFilecoinContextFn + * @typedef {import("ava").TestFn>} TestBlobContextFn */ // eslint-disable-next-line unicorn/prefer-export-from @@ -38,3 +42,7 @@ export const testRoundabout = /** @type {TestRoundaboutContextFn} */ (anyTest) // eslint-disable-next-line unicorn/prefer-export-from export const testFilecoin = /** @type {TestFilecoinContextFn} */ (anyTest) + +// eslint-disable-next-line unicorn/prefer-export-from +export const testBlob = /** @type {TestBlobContextFn} */ (anyTest) + diff --git a/test/helpers/up-client.js b/test/helpers/up-client.js index 2156da1b..779847de 100644 --- a/test/helpers/up-client.js +++ b/test/helpers/up-client.js @@ -8,6 +8,10 @@ import { MailSlurp } from "mailslurp-client" import { fileURLToPath } from 'node:url' import dotenv from 'dotenv' +import * as BlobCapabilities from '@web3-storage/capabilities/blob' + +import { add } from './blob-client.js' + dotenv.config({ path: fileURLToPath(new URL('../../.env', import.meta.url)) }) /** @@ -51,13 +55,15 @@ export async function setupNewClient (uploadServiceUrl, options = {}) { // create an inbox const { mailslurp, id: inboxId, email } = options.inbox || await createMailSlurpInbox() const client = await createNewClient(uploadServiceUrl) - const timeoutMs = process.env.MAILSLURP_TIMEOUT ? parseInt(process.env.MAILSLURP_TIMEOUT) : 60_000 const authorizePromise = client.login(email) // click link in email const latestEmail = await mailslurp.waitForLatestEmail(inboxId, timeoutMs) const authLink = getAuthLinkFromEmail(latestEmail.body, uploadServiceUrl) - await fetch(authLink, { method: 'POST' }) + const res = await fetch(authLink, { method: 'POST' }) + if (!res.ok) { + throw new Error('failed to authenticate by clickling on auth link from e-mail') + } const account = await authorizePromise if (!client.currentSpace()) { const space = await client.createSpace("test space") @@ -68,6 +74,35 @@ export async function setupNewClient (uploadServiceUrl, options = {}) { return client } +export async function setupNewClientWithBlob (uploadServiceUrl, options = {}) { + const client = await setupNewClient(uploadServiceUrl, options) + + // Get invocation config + const resource = client.agent.currentSpace() + if (!resource) { + throw new Error( + 'missing current space: use createSpace() or setCurrentSpace()' + ) + } + + const connection = getUploadServiceConnection(uploadServiceUrl) + const conf = { + issuer: client.agent.issuer, + with: resource, + proofs: client.agent.proofs( + [BlobCapabilities.add.can].map((can) => ({ can, with: resource })) + ), + audience: DID.parse('did:web:staging.web3.storage') + } + + return { + client, + blobClient: { + add: (data) => add(conf, data, { connection }) + } + } +} + /** * @param {string} serviceUrl */ diff --git a/test/integration.test.js b/test/integration.test.js index e744db6b..d4584938 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -114,7 +114,7 @@ test('authorizations can be blocked by email or domain', async t => { }) // Integration test for all flow from uploading a file to Kinesis events consumers and replicator -test('w3infra integration flow', async t => { +test('w3infra store/upload integration flow', async t => { const stage = getStage() const inbox = await createMailSlurpInbox() const client = await setupNewClient(t.context.apiEndpoint, { inbox }) diff --git a/upload-api/package.json b/upload-api/package.json index 436c1e1f..4a96e440 100644 --- a/upload-api/package.json +++ b/upload-api/package.json @@ -22,10 +22,10 @@ "@ucanto/transport": "^9.1.1", "@ucanto/validator": "^9.0.2", "@web-std/fetch": "^4.1.0", - "@web3-storage/access": "^18.3.1", - "@web3-storage/capabilities": "^14.0.0", + "@web3-storage/access": "^18.3.2", + "@web3-storage/capabilities": "^14.0.2", "@web3-storage/did-mailto": "^2.1.0", - "@web3-storage/upload-api": "^10.0.0", + "@web3-storage/upload-api": "^10.0.1", "multiformats": "^13.1.0", "nanoid": "^5.0.2", "preact": "^10.14.1", diff --git a/upload-api/scheduler.js b/upload-api/scheduler.js index a756a4af..1f3599ca 100644 --- a/upload-api/scheduler.js +++ b/upload-api/scheduler.js @@ -36,6 +36,8 @@ export class TasksScheduler { // receipts on the server. const [res] = await connection.execute(invocation) + console.log('invo', (await invocation.delegate()).cid.toString()) + console.log('schedule', res.out.ok) if (res.out.error) { return res.out }