From 50bf6cbc5258d2f35997abf658a0ddbe97d2f3ac Mon Sep 17 00:00:00 2001 From: Deep Singhvi Date: Fri, 25 Oct 2024 18:41:59 -0400 Subject: [PATCH] fix(cli): improve error messages for node 17 or below incompatibility (#4997) --- .../fetcher/src/fetcher/Fetcher.ts | 2 +- .../fetcher/src/fetcher/getResponseBody.ts | 2 ++ packages/cli/cli/package.json | 3 +- .../cli/cli/src/cli-context/CliContext.ts | 8 ++++- packages/cli/cli/src/cli.ts | 17 +++++++--- packages/cli/cli/tsconfig.json | 3 +- packages/cli/cli/versions.yml | 6 ++++ packages/cli/docs-preview/package.json | 5 ++- .../src/downloadLocalDocsBundle.ts | 32 +++++++++++++++---- .../cli/docs-preview/src/runPreviewServer.ts | 9 +++--- packages/cli/docs-preview/tsconfig.json | 3 +- pnpm-lock.yaml | 12 +++++++ .../alias-extends/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ seed/ts-sdk/alias/src/core/fetcher/Fetcher.ts | 2 +- .../alias/src/core/fetcher/getResponseBody.ts | 2 ++ .../any-auth/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../basic-auth/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ seed/ts-sdk/bytes/src/core/fetcher/Fetcher.ts | 2 +- .../bytes/src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../custom-auth/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ seed/ts-sdk/enum/src/core/fetcher/Fetcher.ts | 2 +- .../enum/src/core/fetcher/getResponseBody.ts | 2 ++ .../union-utils/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../bigint/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../bundle/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../jsr/src/core/fetcher/Fetcher.ts | 2 +- .../jsr/src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../extends/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../folders/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../grpc-proto/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../noScripts/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../literal/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../optional/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../package-yml/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../pagination/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../plain-text/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../simple-fhir/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../exhaustive/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../no-zurg-trace/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../ts-sdk/unions/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../validation/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../variables/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ .../version/src/core/fetcher/Fetcher.ts | 2 +- .../src/core/fetcher/getResponseBody.ts | 2 ++ 172 files changed, 321 insertions(+), 101 deletions(-) diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/Fetcher.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/Fetcher.ts index f0e4184867a..ed8a4603905 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/Fetcher.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/getResponseBody.ts b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/getResponseBody.ts index d673f729158..d00c8faefe0 100644 --- a/generators/typescript/utils/core-utilities/fetcher/src/fetcher/getResponseBody.ts +++ b/generators/typescript/utils/core-utilities/fetcher/src/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/packages/cli/cli/package.json b/packages/cli/cli/package.json index d59c8e28302..376b229bd8d 100644 --- a/packages/cli/cli/package.json +++ b/packages/cli/cli/package.json @@ -76,6 +76,7 @@ "@fern-api/workspace-loader": "workspace:*", "@fern-fern/fiddle-sdk": "0.0.584", "@fern-fern/generators-sdk": "0.114.0-5745f9e74", + "@fern-typescript/fetcher": "workspace:*", "@types/axios": "^0.14.0", "@types/boxen": "^3.0.1", "@types/get-port": "^4.2.0", @@ -113,5 +114,5 @@ "vitest": "^2.0.5", "yaml": "^2.4.5", "yargs": "^17.4.1" - } + } } \ No newline at end of file diff --git a/packages/cli/cli/src/cli-context/CliContext.ts b/packages/cli/cli/src/cli-context/CliContext.ts index c3ddd2d115f..e82c6b845f9 100644 --- a/packages/cli/cli/src/cli-context/CliContext.ts +++ b/packages/cli/cli/src/cli-context/CliContext.ts @@ -174,6 +174,7 @@ export class CliContext { return context; } + private readonly USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above."; private async runTaskWithInit( init: TaskContextImpl.Init, run: (context: TaskContext) => T | Promise @@ -183,7 +184,12 @@ export class CliContext { try { result = await run(context); } catch (error) { - context.failWithoutThrowing(undefined, error); + if ((error as Error).message.includes("globalThis")) { + context.logger.error(this.USE_NODE_18_OR_ABOVE_MESSAGE); + context.failWithoutThrowing(); + } else { + context.failWithoutThrowing(undefined, error); + } throw new FernCliError(); } finally { context.finish(); diff --git a/packages/cli/cli/src/cli.ts b/packages/cli/cli/src/cli.ts index 19ac9680876..5330be39d24 100644 --- a/packages/cli/cli/src/cli.ts +++ b/packages/cli/cli/src/cli.ts @@ -44,19 +44,25 @@ import { rerunFernCliAtVersion } from "./rerunFernCliAtVersion"; import { isURL } from "./utils/isUrl"; import { generateJsonschemaForWorkspaces } from "./commands/jsonschema/generateJsonschemaForWorkspace"; import { generateDynamicIrForWorkspaces } from "./commands/generate-dynamic-ir/generateDynamicIrForWorkspaces"; -import { setGlobalDispatcher, Agent } from "undici"; import { writeDocsDefinitionForProject } from "./commands/write-docs-definition/writeDocsDefinitionForProject"; - -setGlobalDispatcher(new Agent({ connect: { timeout: 5_000 } })); +import { RUNTIME } from "@fern-typescript/fetcher"; void runCli(); +const USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above."; + async function runCli() { const cliContext = new CliContext(process.stdout); const exit = async () => { await cliContext.exit(); }; + + if (RUNTIME.type === "node" && RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { + const { setGlobalDispatcher, Agent } = await import("undici"); + setGlobalDispatcher(new Agent({ connect: { timeout: 5_000 } })); + } + // eslint-disable-next-line @typescript-eslint/no-misused-promises process.on("SIGINT", async () => { cliContext.suppressUpgradeMessage(); @@ -85,7 +91,10 @@ async function runCli() { error } }); - if (error instanceof FernCliError) { + if ((error as Error)?.message.includes("globalThis")) { + cliContext.logger.error(USE_NODE_18_OR_ABOVE_MESSAGE); + cliContext.failWithoutThrowing(); + } else if (error instanceof FernCliError) { // thrower is responsible for logging, so we generally don't need to log here. cliContext.failWithoutThrowing(); } else if (error instanceof LoggableFernCliError) { diff --git a/packages/cli/cli/tsconfig.json b/packages/cli/cli/tsconfig.json index 6b0d9f50b75..8e332edbf8d 100644 --- a/packages/cli/cli/tsconfig.json +++ b/packages/cli/cli/tsconfig.json @@ -37,6 +37,7 @@ { "path": "../cli-migrations" }, { "path": "../fern-definition/schema" }, { "path": "../fern-definition/ir-to-jsonschema" }, - { "path": "../docs-resolver" } + { "path": "../docs-resolver" }, + { "path": "../../../generators/typescript/utils/commons"} ] } diff --git a/packages/cli/cli/versions.yml b/packages/cli/cli/versions.yml index 59efb57dde5..55cd172578e 100644 --- a/packages/cli/cli/versions.yml +++ b/packages/cli/cli/versions.yml @@ -1,3 +1,9 @@ +- changelogEntry: + - summary: | + `fern docs dev` now runs in Node 16 - Node 22 environments. + type: fix + irVersion: 53 + version: 0.45.0-rc24 - changelogEntry: - summary: | diff --git a/packages/cli/docs-preview/package.json b/packages/cli/docs-preview/package.json index 89e873147be..f5bb2089e33 100644 --- a/packages/cli/docs-preview/package.json +++ b/packages/cli/docs-preview/package.json @@ -36,10 +36,12 @@ "@fern-api/project-loader": "workspace:*", "@fern-api/register": "workspace:*", "@fern-api/task-context": "workspace:*", + "@fern-typescript/fetcher": "workspace:*", "chalk": "^5.3.0", "cors": "^2.8.5", "decompress": "^4.2.1", "express": "^4.20.0", + "readable-stream": "^4.5.2", "tmp-promise": "^3.0.3", "uuid": "^9.0.1", "watcher": "^2.3.1", @@ -51,6 +53,7 @@ "@types/decompress": "^4.2.7", "@types/express": "^4.17.21", "@types/node": "18.7.18", + "@types/readable-stream": "^4.0.15", "@types/uuid": "^9.0.8", "@types/ws": "^8.5.10", "@types/xml2js": "^0.4.14", @@ -62,4 +65,4 @@ "typescript": "4.6.4", "vitest": "^2.0.5" } -} +} \ No newline at end of file diff --git a/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts b/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts index 9399023a2e6..93e9f5de43e 100644 --- a/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts +++ b/packages/cli/docs-preview/src/downloadLocalDocsBundle.ts @@ -1,13 +1,14 @@ import { AbsoluteFilePath, doesPathExist, join, RelativeFilePath } from "@fern-api/fs-utils"; import { Logger } from "@fern-api/logger"; import decompress from "decompress"; -import { createWriteStream } from "fs"; +import { Readable } from "readable-stream"; import { mkdir, readFile, rm, writeFile } from "fs/promises"; import { homedir } from "os"; import path from "path"; -import { pipeline } from "stream/promises"; import tmp from "tmp-promise"; import xml2js from "xml2js"; +import { fetcher } from "@fern-typescript/fetcher"; +import fs from "fs"; const ETAG_FILENAME = "etag"; const PREVIEW_FOLDER_NAME = "preview"; @@ -66,8 +67,18 @@ export async function downloadBundle({ preferCached: boolean; }): Promise { logger.debug("Setting up docs preview bundle..."); - const response = await fetch(bucketUrl); - const body = await response.text(); + const response = await fetcher({ + url: bucketUrl, + method: "GET", + responseType: "text", + duplex: "half" + }); + if (!response.ok) { + return { + type: "failure" + }; + } + const body = response.body; const parser = new xml2js.Parser(); const parsedResponse = await parser.parseStringPromise(body); const eTag = parsedResponse?.ListBucketResult?.Contents?.[0]?.ETag?.[0]; @@ -99,10 +110,15 @@ export async function downloadBundle({ logger.debug(`Downloading docs preview bundle from ${path.join(bucketUrl, key)}`); // download docs bundle - const docsBundleZipResponse = await fetch(`${path.join(bucketUrl, key)}`); + const docsBundleZipResponse = await fetcher({ + url: `${path.join(bucketUrl, key)}`, + method: "GET", + responseType: "arrayBuffer", + duplex: "half" + }); if (!docsBundleZipResponse.ok) { - logger.error(`Failed to download docs preview bundle. ${docsBundleZipResponse.statusText}`); + logger.error("Failed to download docs preview bundle."); return { type: "failure" }; @@ -115,8 +131,10 @@ export async function downloadBundle({ type: "failure" }; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any - await pipeline(contents as any, createWriteStream(outputZipPath)); + const nodeBuffer = Buffer.from(contents as any); + await writeFile(outputZipPath, nodeBuffer); logger.debug(`Wrote output.zip to ${outputZipPath}`); const absolutePathToPreviewFolder = getPathToPreviewFolder(); diff --git a/packages/cli/docs-preview/src/runPreviewServer.ts b/packages/cli/docs-preview/src/runPreviewServer.ts index 7bc5ac5e608..6b51aedbcf2 100644 --- a/packages/cli/docs-preview/src/runPreviewServer.ts +++ b/packages/cli/docs-preview/src/runPreviewServer.ts @@ -77,12 +77,13 @@ export async function runPreviewServer({ await downloadBundle({ bucketUrl: url, logger: context.logger, preferCached: true }); } catch (err) { const pathToBundle = getPathToBundleFolder(); + if (err instanceof Error) { + context.logger.debug(`Failed to download latest docs bundle: ${(err as Error).message}`); + } if (await doesPathExist(pathToBundle)) { - context.logger.warn("Failed to download latest docs application. Falling back to existing bundle."); + context.logger.warn("Falling back to cached bundle..."); } else { - context.logger.warn( - "Failed to download docs application. Please reach out to support@buildwithfern.com." - ); + context.logger.warn("Please reach out to support@buildwithfern.com."); return; } } diff --git a/packages/cli/docs-preview/tsconfig.json b/packages/cli/docs-preview/tsconfig.json index a4834e239d4..f43215db6ca 100644 --- a/packages/cli/docs-preview/tsconfig.json +++ b/packages/cli/docs-preview/tsconfig.json @@ -9,6 +9,7 @@ { "path": "../logger" }, { "path": "../project-loader" }, { "path": "../register" }, - { "path": "../task-context" } + { "path": "../task-context" }, + { "path": "../../../generators/typescript/utils/core-utilities/fetcher"} ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71013ba8436..5169efc864a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3565,6 +3565,9 @@ importers: '@fern-fern/generators-sdk': specifier: 0.114.0-5745f9e74 version: 0.114.0-5745f9e74 + '@fern-typescript/fetcher': + specifier: workspace:* + version: link:../../../generators/typescript/utils/core-utilities/fetcher '@types/axios': specifier: ^0.14.0 version: 0.14.0 @@ -4017,6 +4020,9 @@ importers: '@fern-api/task-context': specifier: workspace:* version: link:../task-context + '@fern-typescript/fetcher': + specifier: workspace:* + version: link:../../../generators/typescript/utils/core-utilities/fetcher chalk: specifier: ^5.3.0 version: 5.3.0 @@ -4029,6 +4035,9 @@ importers: express: specifier: ^4.20.0 version: 4.21.1 + readable-stream: + specifier: ^4.5.2 + version: 4.5.2 tmp-promise: specifier: ^3.0.3 version: 3.0.3 @@ -4057,6 +4066,9 @@ importers: '@types/node': specifier: 18.7.18 version: 18.7.18 + '@types/readable-stream': + specifier: ^4.0.15 + version: 4.0.15 '@types/uuid': specifier: ^9.0.8 version: 9.0.8 diff --git a/seed/ts-sdk/alias-extends/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/alias-extends/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/alias-extends/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/alias-extends/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/alias-extends/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/alias-extends/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/alias-extends/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/alias-extends/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/alias/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/alias/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/alias/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/alias/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/alias/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/alias/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/any-auth/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/any-auth/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/any-auth/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/any-auth/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/any-auth/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/any-auth/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/any-auth/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/any-auth/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/api-wide-base-path/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/api-wide-base-path/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/audiences/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/audiences/with-partner-audience/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/auth-environment-variables/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/auth-environment-variables/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/basic-auth-environment-variables/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/basic-auth/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/basic-auth/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/basic-auth/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/basic-auth/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/bearer-token-environment-variable/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/bytes/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/bytes/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/bytes/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/bytes/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/bytes/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/bytes/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/bytes/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/bytes/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/cross-package-type-names/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/cross-package-type-names/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/cross-package-type-names/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/cross-package-type-names/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/cross-package-type-names/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/cross-package-type-names/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/cross-package-type-names/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/cross-package-type-names/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/custom-auth/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/custom-auth/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/custom-auth/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/custom-auth/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/enum/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/enum/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/enum/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/enum/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/enum/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/enum/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/error-property/union-utils/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/error-property/union-utils/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/examples/examples-with-api-reference/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/examples/retain-original-casing/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/allow-extra-fields/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/bigint/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/bundle/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/custom-package-json/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/dev-dependencies/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/jsr/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/exhaustive/retain-original-casing/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/extends/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/extends/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/extends/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/extends/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/extends/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/extends/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/extends/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/extends/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/extra-properties/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/extra-properties/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/extra-properties/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/extra-properties/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/file-download/file-download-reponse-headers/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/file-download/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/file-upload/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/file-upload/wrap-file-properties/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/folders/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/folders/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/folders/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/folders/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/folders/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/folders/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/grpc-proto-exhaustive/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/grpc-proto/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/grpc-proto/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/grpc-proto/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/grpc-proto/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/grpc-proto/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/grpc-proto/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/grpc-proto/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/grpc-proto/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/idempotency-headers/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/idempotency-headers/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/idempotency-headers/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/idempotency-headers/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/imdb/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/imdb/noScripts/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/imdb/noScripts/src/core/fetcher/Fetcher.ts index f0e4184867a..ed8a4603905 100644 --- a/seed/ts-sdk/imdb/noScripts/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/imdb/noScripts/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/imdb/noScripts/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/imdb/noScripts/src/core/fetcher/getResponseBody.ts index d673f729158..d00c8faefe0 100644 --- a/seed/ts-sdk/imdb/noScripts/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/imdb/noScripts/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/imdb/omit-undefined/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/literal/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/literal/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/literal/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/literal/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/literal/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/literal/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/mixed-case/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/mixed-case/retain-original-casing/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/mixed-file-directory/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/mixed-file-directory/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/mixed-file-directory/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/mixed-file-directory/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/mixed-file-directory/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/mixed-file-directory/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/mixed-file-directory/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/mixed-file-directory/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/multi-line-docs/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/multi-line-docs/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/multi-line-docs/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/multi-line-docs/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/multi-url-environment-no-default/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/multi-url-environment/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/multi-url-environment/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/multi-url-environment/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/multi-url-environment/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/no-environment/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/no-environment/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/no-environment/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/no-environment/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/no-environment/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/oauth-client-credentials-default/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/oauth-client-credentials-environment-variables/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/never-throw-errors/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/oauth-client-credentials-nested-root/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/oauth-client-credentials/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/optional/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/optional/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/optional/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/optional/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/optional/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/optional/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/package-yml/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/package-yml/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/package-yml/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/package-yml/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/package-yml/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/pagination/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/pagination/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/pagination/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/pagination/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/pagination/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/pagination/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/plain-text/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/plain-text/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/plain-text/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/plain-text/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/plain-text/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/query-parameters/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/query-parameters/no-serde-layer-query/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/reserved-keywords/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/reserved-keywords/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/reserved-keywords/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/reserved-keywords/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/response-property/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/response-property/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/response-property/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/response-property/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/response-property/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/response-property/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/server-sent-event-examples/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/server-sent-events/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/server-sent-events/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/server-sent-events/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/server-sent-events/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/simple-fhir/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/simple-fhir/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/simple-fhir/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/simple-fhir/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/simple-fhir/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/simple-fhir/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/simple-fhir/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/simple-fhir/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/single-url-environment-default/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/single-url-environment-default/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/single-url-environment-no-default/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/streaming/allow-custom-fetcher/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/streaming/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/trace/exhaustive/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/trace/exhaustive/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/trace/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/trace/no-zurg-no-throwing/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/trace/no-zurg-trace/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/ts-express-casing/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/ts-express-casing/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/ts-express-casing/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/ts-express-casing/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/ts-express-casing/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/ts-express-casing/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/ts-express-casing/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/ts-express-casing/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/undiscriminated-unions/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/undiscriminated-unions/skip-response-validation/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/unions/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/unions/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/unions/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/unions/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/unions/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/unions/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/unknown/no-custom-config/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/unknown/unknown-as-any/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/validation/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/validation/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/validation/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/validation/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/validation/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/validation/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/variables/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/variables/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/variables/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/variables/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/variables/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/variables/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/version-no-default/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/version-no-default/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/version-no-default/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/version-no-default/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") { diff --git a/seed/ts-sdk/version/src/core/fetcher/Fetcher.ts b/seed/ts-sdk/version/src/core/fetcher/Fetcher.ts index d67bc042107..b8f23717b69 100644 --- a/seed/ts-sdk/version/src/core/fetcher/Fetcher.ts +++ b/seed/ts-sdk/version/src/core/fetcher/Fetcher.ts @@ -21,7 +21,7 @@ export declare namespace Fetcher { withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; } diff --git a/seed/ts-sdk/version/src/core/fetcher/getResponseBody.ts b/seed/ts-sdk/version/src/core/fetcher/getResponseBody.ts index a7a9c508777..d046e6ea275 100644 --- a/seed/ts-sdk/version/src/core/fetcher/getResponseBody.ts +++ b/seed/ts-sdk/version/src/core/fetcher/getResponseBody.ts @@ -3,6 +3,8 @@ import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { if (response.body != null && responseType === "blob") { return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); } else if (response.body != null && responseType === "sse") { return response.body; } else if (response.body != null && responseType === "streaming") {