fix: storage S3 stream conversion, API client FormData support, and attachment API
Fix S3 provider to use async generator for web stream conversion instead of Readable.fromWeb, add postForm helper and attachment API methods to the UI client, and add local disk storage provider tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -40,7 +40,15 @@ async function toReadableStream(body: unknown): Promise<Readable> {
|
||||
};
|
||||
|
||||
if (typeof candidate.transformToWebStream === "function") {
|
||||
return Readable.fromWeb(candidate.transformToWebStream() as globalThis.ReadableStream<any>);
|
||||
const webStream = candidate.transformToWebStream();
|
||||
const reader = webStream.getReader();
|
||||
return Readable.from((async function* () {
|
||||
while (true) {
|
||||
const { done, value } = await reader.read();
|
||||
if (done) break;
|
||||
if (value) yield value;
|
||||
}
|
||||
})());
|
||||
}
|
||||
|
||||
if (typeof candidate.arrayBuffer === "function") {
|
||||
|
||||
Reference in New Issue
Block a user