diff --git a/package-lock.json b/package-lock.json index 0821f299..752cb0f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5906,6 +5906,17 @@ "semver": "^7.0.0" } }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/byline": { "version": "5.0.0", "dev": true, @@ -12797,6 +12808,14 @@ "node": ">= 4.0.0" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/string_decoder": { "version": "1.3.0", "license": "MIT", @@ -13527,6 +13546,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici": { + "version": "5.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz", + "integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==", + "dependencies": { + "busboy": "^1.6.0" + }, + "engines": { + "node": ">=14.0" + } + }, "node_modules/unique-filename": { "version": "1.1.1", "dev": true, @@ -14148,7 +14178,8 @@ "@aws-sdk/s3-request-presigner": "^3.226.0", "@sentry/serverless": "^7.22.0", "@web3-storage/content-claims": "^3.0.1", - "multiformats": "^11.0.2" + "multiformats": "^11.0.2", + "undici": "^5.24.0" }, "devDependencies": { "@ipld/car": "^5.1.1", @@ -17748,7 +17779,8 @@ "ava": "^4.3.3", "multiformats": "^11.0.2", "nanoid": "^4.0.0", - "testcontainers": "^8.13.0" + "testcontainers": "^8.13.0", + "undici": "*" }, "dependencies": { "@ipld/dag-pb": { @@ -18687,6 +18719,14 @@ "semver": "^7.0.0" } }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "requires": { + "streamsearch": "^1.1.0" + } + }, "byline": { "version": "5.0.0", "dev": true @@ -22900,6 +22940,11 @@ } } }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" + }, "string_decoder": { "version": "1.3.0", "requires": { @@ -23381,6 +23426,14 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici": { + "version": "5.24.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz", + "integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==", + "requires": { + "busboy": "^1.6.0" + } + }, "unique-filename": { "version": "1.1.1", "dev": true, diff --git a/roundabout/globals.js b/roundabout/globals.js new file mode 100644 index 00000000..7e1849e0 --- /dev/null +++ b/roundabout/globals.js @@ -0,0 +1,5 @@ +// CARReaderStream used by content-claims client expects global TransformStream and fetch +import { TransformStream } from 'node:stream/web' +import { fetch } from 'undici' +globalThis.TransformStream = TransformStream +globalThis.fetch = fetch diff --git a/roundabout/package.json b/roundabout/package.json index 024451b6..61c7b6ec 100644 --- a/roundabout/package.json +++ b/roundabout/package.json @@ -10,7 +10,8 @@ "@aws-sdk/s3-request-presigner": "^3.226.0", "@sentry/serverless": "^7.22.0", "@web3-storage/content-claims": "^3.0.1", - "multiformats": "^11.0.2" + "multiformats": "^11.0.2", + "undici": "^5.24.0" }, "devDependencies": { "@ipld/car": "^5.1.1", diff --git a/roundabout/piece.js b/roundabout/piece.js index 6464c6be..b711cb11 100644 --- a/roundabout/piece.js +++ b/roundabout/piece.js @@ -1,3 +1,5 @@ +// CARReaderStream used by content-claims client expects global TransformStream and fetch +import './globals.js' import { read } from '@web3-storage/content-claims/client' import * as Raw from 'multiformats/codecs/raw'