From f0ba11cd23aeef62170cf178bd3c060659bd1072 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 May 2026 15:18:41 +0000 Subject: [PATCH 1/2] Initial plan From 921d20d289802a778ccb9b4b53c924f00fb95e0a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 21 May 2026 15:34:36 +0000 Subject: [PATCH 2/2] Fix RLC bytes body type for browser builds Agent-Logs-Url: https://github.com/Azure/autorest.typescript/sessions/2adb414c-3c36-49bb-9665-00c57e6b3390 Co-authored-by: siddharth9606 <199754214+siddharth9606@users.noreply.github.com> --- packages/typespec-ts/src/utils/modelUtils.ts | 2 +- .../test/unit/bytesGenerator.spec.ts | 36 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/packages/typespec-ts/src/utils/modelUtils.ts b/packages/typespec-ts/src/utils/modelUtils.ts index 71cbcebf46..2ce6eb17d9 100644 --- a/packages/typespec-ts/src/utils/modelUtils.ts +++ b/packages/typespec-ts/src/utils/modelUtils.ts @@ -85,7 +85,7 @@ import { getModelNamespaceName } from "./namespaceUtils.js"; import { reportDiagnostic } from "../lib.js"; export const BINARY_TYPE_UNION = - "string | Uint8Array | ReadableStream | NodeJS.ReadableStream"; + "string | Uint8Array | ReadableStream | AsyncIterable"; export const BINARY_AND_FILE_TYPE_UNION = `${BINARY_TYPE_UNION} | File`; diff --git a/packages/typespec-ts/test/unit/bytesGenerator.spec.ts b/packages/typespec-ts/test/unit/bytesGenerator.spec.ts index f459556b09..703a658478 100644 --- a/packages/typespec-ts/test/unit/bytesGenerator.spec.ts +++ b/packages/typespec-ts/test/unit/bytesGenerator.spec.ts @@ -30,7 +30,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream; + | AsyncIterable; } export interface UploadFileViaBodyMediaTypesParam { @@ -66,7 +66,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream; + | AsyncIterable; } export interface UploadFileViaBodyMediaTypesParam { @@ -125,7 +125,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream; + | AsyncIterable; } export type ReadParameters = ReadBodyParam & RequestParameters; @@ -201,7 +201,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -212,7 +212,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -263,7 +263,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -274,7 +274,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -370,7 +370,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -382,7 +382,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File; filename?: string; contentType?: string; @@ -391,11 +391,13 @@ describe("bytes", () => { export interface FooFilesPartDescriptor { name: "files"; body: - | string - | Uint8Array - | ReadableStream - | NodeJS.ReadableStream - | File; + | ( + | string + | Uint8Array + | ReadableStream + | AsyncIterable + | File + )[]; filename?: string; contentType?: string; } @@ -406,7 +408,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream + | AsyncIterable | File | number; filename?: string; @@ -528,7 +530,7 @@ describe("bytes", () => { export interface ReadBodyParam { /** Value may contain any sequence of octets */ - body: string | Uint8Array | ReadableStream | NodeJS.ReadableStream; + body: string | Uint8Array | ReadableStream | AsyncIterable; } export interface ReadMediaTypesParam { @@ -559,7 +561,7 @@ describe("bytes", () => { | string | Uint8Array | ReadableStream - | NodeJS.ReadableStream; + | AsyncIterable; } export interface ReadMediaTypesParam {