From b10152e60ea98cbdabe6c4e45efffa3cb02f122f Mon Sep 17 00:00:00 2001 From: Rohin Bhargava Date: Fri, 26 Jul 2024 15:23:21 -0400 Subject: [PATCH 1/2] add start stream on pipe --- .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ scripts/browser-startup-test.sh | 2 -- scripts/cloudflare-startup-test.sh | 3 +-- .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ .../Node18UniversalStreamWrapper.ts | 25 +++++++++++++++++++ .../stream-wrappers/UndiciStreamWrapper.ts | 25 +++++++++++++++++++ 138 files changed, 3401 insertions(+), 4 deletions(-) diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index b6d8aaa44d2..d075a630f02 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 5a84b0c199c..2cca72bae04 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/scripts/browser-startup-test.sh b/scripts/browser-startup-test.sh index 6a18fa407be..c3babbd928e 100755 --- a/scripts/browser-startup-test.sh +++ b/scripts/browser-startup-test.sh @@ -46,7 +46,6 @@ echo "DISABLE_ESLINT_PLUGIN=true" >> .env npm install output=$(timeout 25s npm run start &) -sleep 30 echo "$output" if echo "$output" | grep -q "Compiled successfully!"; then echo "Compiled successfully" @@ -55,5 +54,4 @@ else exit 1 fi cd ../../.. -pwd rm -rf browser-test diff --git a/scripts/cloudflare-startup-test.sh b/scripts/cloudflare-startup-test.sh index 29aa237a0c9..bb8ca3be50b 100755 --- a/scripts/cloudflare-startup-test.sh +++ b/scripts/cloudflare-startup-test.sh @@ -47,8 +47,7 @@ export default { return new Response("Hello World!"); }, };' > src/index.ts -output=$(timeout 1s wrangler dev &) -sleep 1 +output=$(timeout 5s wrangler dev &) echo "$output" if echo "$output" | grep -q "SeedApiClient import was successful"; then echo "Compiled successfully" diff --git a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 7008c1799e5..9349baacf7a 100644 --- a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,6 +40,7 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { + this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -197,4 +198,28 @@ export class Node18UniversalStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } diff --git a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 9cace42e86d..12dd273a238 100644 --- a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,6 +40,7 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { + this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -184,4 +185,28 @@ export class UndiciStreamWrapper } } } + + private async _startReading(): Promise { + try { + this._emit("readable"); + while (true) { + if (this.paused) { + await new Promise((resolve) => { + this.resumeCallback = resolve; + }); + } + const { done, value } = await this.reader.read(); + if (done) { + this._emit("end"); + this._emit("close"); + break; + } + if (value) { + this._emit("data", value); + } + } + } catch (error) { + this._emit("error", error); + } + } } From 915b396f041b95ca4cfe6211234c7c0c7aab752f Mon Sep 17 00:00:00 2001 From: Rohin Bhargava Date: Fri, 26 Jul 2024 15:34:15 -0400 Subject: [PATCH 2/2] add version, changelog, and stream after event handlers are registered --- generators/typescript/sdk/CHANGELOG.md | 4 ++++ generators/typescript/sdk/VERSION | 2 +- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- .../fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts | 3 ++- .../src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts | 3 ++- 138 files changed, 277 insertions(+), 137 deletions(-) diff --git a/generators/typescript/sdk/CHANGELOG.md b/generators/typescript/sdk/CHANGELOG.md index 72d588b4928..5850440e58f 100644 --- a/generators/typescript/sdk/CHANGELOG.md +++ b/generators/typescript/sdk/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.36.3] - 2024-07-26 + +- Fix: Support starting the stream on `StreamWrapper.pipe(...)` for shorter syntax when dealing with `node:stream` primitives. + ## [0.36.2] - 2024-07-26 - Fix: This release comes with numerous improvements to streaming responses: diff --git a/generators/typescript/sdk/VERSION b/generators/typescript/sdk/VERSION index d647c8a4416..1d3b40ecfed 100644 --- a/generators/typescript/sdk/VERSION +++ b/generators/typescript/sdk/VERSION @@ -1 +1 @@ -0.36.2 +0.36.3 diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index d075a630f02..69f0581bc55 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 2cca72bae04..35b52c6afab 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/audiences/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/code-samples/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index 9349baacf7a..e274a3239de 100644 --- a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -40,7 +40,6 @@ export class Node18UniversalStreamWrapper public pipe( dest: Node18UniversalStreamWrapper | Writable | WritableStream ): Node18UniversalStreamWrapper | Writable | WritableStream { - this._startReading(); this.on("data", async (chunk) => { if (dest instanceof Node18UniversalStreamWrapper) { dest._write(chunk); @@ -74,6 +73,8 @@ export class Node18UniversalStreamWrapper } }); + this._startReading(); + return dest; } diff --git a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 12dd273a238..083edb41e0f 100644 --- a/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/seed/ts-sdk/version/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -40,7 +40,6 @@ export class UndiciStreamWrapper public pipe( dest: UndiciStreamWrapper | WritableStream ): UndiciStreamWrapper | WritableStream { - this._startReading(); this.on("data", (chunk) => { if (dest instanceof UndiciStreamWrapper) { dest._write(chunk); @@ -68,6 +67,8 @@ export class UndiciStreamWrapper } }); + this._startReading(); + return dest; }