From b6dcb0482055a182b2545803b4c8d618fca6cfe8 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Thu, 28 Nov 2024 19:30:28 +0800 Subject: [PATCH 01/71] [http-spec] add link case of server driven pagination test (#5211) only cover next link scenario for pagination. more complex case could be added later. --- ...list_operation_test-2024-10-27-18-41-40.md | 7 +++ packages/http-specs/spec-summary.md | 37 +++++++++++ .../specs/payload/pageable/main.tsp | 61 +++++++++++++++++++ .../specs/payload/pageable/mockapi.ts | 53 ++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 .chronus/changes/list_operation_test-2024-10-27-18-41-40.md create mode 100644 packages/http-specs/specs/payload/pageable/main.tsp create mode 100644 packages/http-specs/specs/payload/pageable/mockapi.ts diff --git a/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md b/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md new file mode 100644 index 0000000000..f542056d7f --- /dev/null +++ b/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/http-specs" +--- + +add link case of server driven pagination test \ No newline at end of file diff --git a/packages/http-specs/spec-summary.md b/packages/http-specs/spec-summary.md index 86b49c1983..9fbaa6e661 100644 --- a/packages/http-specs/spec-summary.md +++ b/packages/http-specs/spec-summary.md @@ -1661,6 +1661,43 @@ Content-Type: application/octet-stream --abcde12345-- ``` +### Payload_Pageable_ServerDrivenPagination_link + +- Endpoint: `get /payload/pageable/server-driven-pagination/link` + +Test case for using link as pagination. + +Two requests need to be tested. + +1. Initial request: + Expected route: /payload/pageable/server-driven-pagination/link + Expected response body: + +```json +{ + "pets": [ + { "id": "1", "name": "dog" }, + { "id": "2", "name": "cat" } + ], + "links": { + "next": "http://[host]:[port]/payload/pageable/server-driven-pagination/link/nextPage" + } +} +``` + +2. Next page request: + Expected route: /payload/pageable/server-driven-pagination/link/nextPage + Expected response body: + +```json +{ + "pets": [ + { "id": "3", "name": "bird" }, + { "id": "4", "name": "fish" } + ] +} +``` + ### Payload_Xml_ModelWithArrayOfModelValue_get - Endpoint: `get /payload/xml/modelWithArrayOfModel` diff --git a/packages/http-specs/specs/payload/pageable/main.tsp b/packages/http-specs/specs/payload/pageable/main.tsp new file mode 100644 index 0000000000..b170d7e663 --- /dev/null +++ b/packages/http-specs/specs/payload/pageable/main.tsp @@ -0,0 +1,61 @@ +import "@typespec/http"; +import "@typespec/spector"; + +using Http; +using Spector; + +/** + * Test for pageable payload. + */ +@scenarioService("/payload/pageable") +namespace Payload.Pageable; + +model Pet { + id: string; + name: string; +} + +@route("/server-driven-pagination") +namespace ServerDrivenPagination { + @scenario + @scenarioDoc(""" + Test case for using link as pagination. + + Two requests need to be tested. + 1. Initial request: + Expected route: /payload/pageable/server-driven-pagination/link + Expected response body: + ```json + { "pets": [ + { "id": "1", "name": "dog" }, + { "id": "2", "name": "cat" } + ], + "links": { + "next": "http://[host]:[port]/payload/pageable/server-driven-pagination/link/nextPage" + } + } + ``` + 2. Next page request: + Expected route: /payload/pageable/server-driven-pagination/link/nextPage + Expected response body: + ```json + { "pets": [ + { "id": "3", "name": "bird" }, + { "id": "4", "name": "fish" } + ] + } + ``` + """) + @route("/link") + op link(): { + @pageItems + pets: Pet[]; + + links: { + @nextLink next?: url; + @prevLink prev?: url; + @firstLink first?: url; + @lastLink last?: url; + }; + }; +} diff --git a/packages/http-specs/specs/payload/pageable/mockapi.ts b/packages/http-specs/specs/payload/pageable/mockapi.ts new file mode 100644 index 0000000000..16be648a81 --- /dev/null +++ b/packages/http-specs/specs/payload/pageable/mockapi.ts @@ -0,0 +1,53 @@ +import { json, MockRequest, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api"; + +export const Scenarios: Record = {}; + +Scenarios.Payload_Pageable_ServerDrivenPagination_link = passOnSuccess([ + { + uri: "/payload/pageable/server-driven-pagination/link", + method: "get", + request: {}, + response: { + status: 200, + body: json({ + pets: [ + { id: "1", name: "dog" }, + { id: "2", name: "cat" }, + ], + links: { + next: "/payload/pageable/server-driven-pagination/link/nextPage", + }, + }), + }, + handler: (req: MockRequest) => { + return { + status: 200, + body: json({ + pets: [ + { id: "1", name: "dog" }, + { id: "2", name: "cat" }, + ], + links: { + next: `${req.baseUrl}/payload/pageable/server-driven-pagination/link/nextPage`, + }, + }), + }; + }, + kind: "MockApiDefinition", + }, + { + uri: "/payload/pageable/server-driven-pagination/link/nextPage", + method: "get", + request: {}, + response: { + status: 200, + body: json({ + pets: [ + { id: "3", name: "bird" }, + { id: "4", name: "fish" }, + ], + }), + }, + kind: "MockApiDefinition", + }, +]); From b9e5648e0bc106c47f66b9146562f2ba1341b62a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 29 Nov 2024 16:18:34 +0800 Subject: [PATCH 02/71] http-client-java, upgrade tcgc 0.48.3 (#5230) For now, ignore pageable in unbranded. --- .../emitter/src/code-model-builder.ts | 11 ++++++++--- .../http-client-generator-test/package.json | 4 ++-- packages/http-client-java/package-lock.json | 15 ++++++++------- packages/http-client-java/package.json | 6 +++--- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index 055f8eed70..fdc9394b20 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -167,8 +167,8 @@ export class CodeModelBuilder { private program: Program; private typeNameOptions: TypeNameOptions; private namespace: string; - private baseJavaNamespace: string = ""; // it will be set at the start of "build" function - private legacyJavaNamespace: boolean = false; // backward-compatible mode, that emitter ignores clientNamespace from TCGC + private baseJavaNamespace!: string; + private legacyJavaNamespace!: boolean; // backward-compatible mode, that emitter ignores clientNamespace from TCGC private sdkContext!: SdkContext; private options: EmitterOptions; private codeModel: CodeModel; @@ -386,7 +386,7 @@ export class CodeModelBuilder { } private isBranded(): boolean { - return !this.options["flavor"] || this.options["flavor"].toLocaleLowerCase() === "azure"; + return this.options["flavor"]?.toLocaleLowerCase() === "azure"; } private processModels() { @@ -957,6 +957,11 @@ export class CodeModelBuilder { responses: SdkHttpResponse[], sdkMethod: SdkMethod, ) { + if (!this.isBranded()) { + // TODO: currently unbranded does not support paged operation + return; + } + if (sdkMethod.kind === "paging" || sdkMethod.kind === "lropaging") { for (const response of responses) { const bodyType = response.type; diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json index b739514b8d..cd83e88b41 100644 --- a/packages/http-client-java/generator/http-client-generator-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-test/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@azure-tools/cadl-ranch-specs": "0.39.4", - "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.1.tgz", + "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.2.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { @@ -24,7 +24,7 @@ "@typespec/openapi": "~0.62.0", "@typespec/xml": "~0.62.0", "@azure-tools/typespec-azure-core": "~0.48.0", - "@azure-tools/typespec-client-generator-core": "~0.48.0", + "@azure-tools/typespec-client-generator-core": "~0.48.3", "@azure-tools/typespec-azure-resource-manager": "~0.48.0", "@azure-tools/typespec-autorest": "~0.48.0" }, diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index bb5face440..e9e2e54d1d 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-java", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-java", - "version": "0.1.1", + "version": "0.1.2", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", @@ -20,7 +20,7 @@ "@azure-tools/typespec-azure-core": "0.48.0", "@azure-tools/typespec-azure-resource-manager": "0.48.0", "@azure-tools/typespec-azure-rulesets": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.2", + "@azure-tools/typespec-client-generator-core": "0.48.3", "@microsoft/api-extractor": "^7.47.11", "@microsoft/api-extractor-model": "^7.29.8", "@types/js-yaml": "~4.0.9", @@ -44,7 +44,7 @@ "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.2 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.48.3 <1.0.0", "@typespec/compiler": ">=0.62.0 <1.0.0", "@typespec/http": ">=0.62.0 <1.0.0", "@typespec/openapi": ">=0.62.0 <1.0.0", @@ -289,10 +289,11 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.2", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.2.tgz", - "integrity": "sha512-5hb+J703pgn6tA3NwPCn2zJ1kWn/YJUkmDC+wfXcWmikp9sEZRE1etMktR0MekJHNO3crDHAK3egsjttnds9nw==", + "version": "0.48.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.3.tgz", + "integrity": "sha512-EWyET1EXCee6TYfxway57L+SQdQurRZ8NuOWgenRjQf/Ja/0+Ht3IYfbFoqIYS2+/uFpLeotYCd4hUPjsW0Jwg==", "dev": true, + "license": "MIT", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json index 2caaaec9d8..e0954ed289 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-java", - "version": "0.1.1", + "version": "0.1.2", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" @@ -44,7 +44,7 @@ "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.2 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.48.3 <1.0.0", "@typespec/compiler": ">=0.62.0 <1.0.0", "@typespec/http": ">=0.62.0 <1.0.0", "@typespec/openapi": ">=0.62.0 <1.0.0", @@ -63,7 +63,7 @@ "@azure-tools/typespec-azure-core": "0.48.0", "@azure-tools/typespec-azure-resource-manager": "0.48.0", "@azure-tools/typespec-azure-rulesets": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.2", + "@azure-tools/typespec-client-generator-core": "0.48.3", "@microsoft/api-extractor": "^7.47.11", "@microsoft/api-extractor-model": "^7.29.8", "@types/js-yaml": "~4.0.9", From 0147e3057fca9bd4460917853ecac08a3a3fa264 Mon Sep 17 00:00:00 2001 From: Wei Hu Date: Mon, 2 Dec 2024 10:54:10 +0800 Subject: [PATCH 03/71] Remove unnecessary lazy for InputLibrary (#5232) Before this PR, `InputLibrary` depends on `Instance.Configuration`, and `Instance` is the current `CodeModelPlugin` instance being constructed. https://github.com/microsoft/typespec/blob/b9e5648e0bc106c47f66b9146562f2ba1341b62a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs#L48 This introduces circular dependency of `InputLibrary` on `Instance`, but `InputLirabry` can just depend on `Configuration`, which is in the same class, which breaks the circular dependency. Therefore, `lazy` is unnecessary in this case. --- .../Microsoft.Generator.CSharp/src/CodeModelPlugin.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs index 857e22aa7f..b03488f93a 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/CodeModelPlugin.cs @@ -45,7 +45,7 @@ internal static CodeModelPlugin Instance public CodeModelPlugin(GeneratorContext context) { Configuration = context.Configuration; - _inputLibrary = new(() => new InputLibrary(Instance.Configuration.OutputDirectory)); + _inputLibrary = new InputLibrary(Configuration.OutputDirectory); TypeFactory = new TypeFactory(); } @@ -57,14 +57,14 @@ protected CodeModelPlugin() } internal bool IsNewProject { get; set; } - private Lazy _inputLibrary; + private InputLibrary _inputLibrary; // Extensibility points to be implemented by a plugin public virtual TypeFactory TypeFactory { get; } public virtual SourceInputModel SourceInputModel => _sourceInputModel ?? throw new InvalidOperationException($"SourceInputModel has not been initialized yet"); public virtual string LicenseString => string.Empty; public virtual OutputLibrary OutputLibrary { get; } = new(); - public virtual InputLibrary InputLibrary => _inputLibrary.Value; + public virtual InputLibrary InputLibrary => _inputLibrary; public virtual TypeProviderWriter GetWriter(TypeProvider provider) => new(provider); public IReadOnlyList AdditionalMetadataReferences => _additionalMetadataReferences; From 7cde053d532e45538c3cf178480d5a511d29c6d3 Mon Sep 17 00:00:00 2001 From: Pan Shao <97225342+pshao25@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:15:46 +0800 Subject: [PATCH 04/71] Remove self dependency and fix security issue (#5229) Fix https://github.com/Azure/autorest.csharp/issues/5187 Co-authored-by: Pan Shao --- packages/http-client-csharp/package-lock.json | 12 ++++-------- packages/http-client-csharp/package.json | 1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/http-client-csharp/package-lock.json b/packages/http-client-csharp/package-lock.json index f2a72f2af8..367625b668 100644 --- a/packages/http-client-csharp/package-lock.json +++ b/packages/http-client-csharp/package-lock.json @@ -9,7 +9,6 @@ "version": "0.1.9", "license": "MIT", "dependencies": { - "@typespec/http-client-csharp": "file:", "json-serialize-refs": "0.1.0-0" }, "devDependencies": { @@ -1804,10 +1803,6 @@ } } }, - "node_modules/@typespec/http-client-csharp": { - "resolved": "", - "link": true - }, "node_modules/@typespec/json-schema": { "version": "0.62.0", "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-0.62.0.tgz", @@ -2637,10 +2632,11 @@ "dev": true }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", diff --git a/packages/http-client-csharp/package.json b/packages/http-client-csharp/package.json index e2d4426101..0288ea2c50 100644 --- a/packages/http-client-csharp/package.json +++ b/packages/http-client-csharp/package.json @@ -43,7 +43,6 @@ "dist/**" ], "dependencies": { - "@typespec/http-client-csharp": "file:", "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { From ba8c12b7823d7d08c060f5b6151b076f683aeba2 Mon Sep 17 00:00:00 2001 From: Christopher Radek <14189820+chrisradek@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:38:58 -0800 Subject: [PATCH 05/71] Fix typeChangedFrom of template/union to catch invalid versioning (#5191) Fixes #4752 --------- Co-authored-by: Christopher Radek --- ...rsioning-typechanged-2024-10-25-16-56-3.md | 7 ++ packages/versioning/src/validate.ts | 12 +++ .../test/incompatible-versioning.test.ts | 100 ++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 .chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md diff --git a/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md b/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md new file mode 100644 index 0000000000..20eddbe575 --- /dev/null +++ b/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/versioning" +--- + +Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template or union. \ No newline at end of file diff --git a/packages/versioning/src/validate.ts b/packages/versioning/src/validate.ts index bfce834dba..63aeb82c5b 100644 --- a/packages/versioning/src/validate.ts +++ b/packages/versioning/src/validate.ts @@ -226,6 +226,18 @@ function validateMultiTypeReference(program: Program, source: Type, options?: Ty const availMap = getAvailabilityMap(program, type); const availability = availMap?.get(version.name) ?? Availability.Available; if ([Availability.Added, Availability.Available].includes(availability)) { + // Check if there are any indexed/template arguments that are validated... + if (isTemplateInstance(type)) { + for (const arg of type.templateMapper.args) { + if (isType(arg)) { + validateReference(program, source, arg); + } + } + } else if (type.kind === "Union") { + for (const variant of type.variants.values()) { + validateReference(program, source, variant.type); + } + } continue; } reportDiagnostic(program, { diff --git a/packages/versioning/test/incompatible-versioning.test.ts b/packages/versioning/test/incompatible-versioning.test.ts index dd8159d34b..5be97ccdd7 100644 --- a/packages/versioning/test/incompatible-versioning.test.ts +++ b/packages/versioning/test/incompatible-versioning.test.ts @@ -387,6 +387,106 @@ describe("versioning: validate incompatible references", () => { }); }); + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in arrays", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Original[]) + prop: Updated; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in records", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Record) + prop: Updated; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in unions", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Original | string) + prop: Updated; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in template", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + model Template { + prop: T; + } + + @test + model Test { + @typeChangedFrom(Versions.v2, Template) + prop: Updated; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", + }); + }); + it("succeed if version are compatible in model", async () => { const diagnostics = await runner.diagnose(` @added(Versions.v2) From 799abe423a245a9eb5a741450e37ad520383381d Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 3 Dec 2024 14:18:36 +0800 Subject: [PATCH 06/71] http-client-java, remove throw whenever possible (#5243) --- .../emitter/src/code-model-builder.ts | 27 +++++++++++++------ .../http-client-java/emitter/src/emitter.ts | 8 +++--- .../http-client-java/emitter/src/utils.ts | 10 +++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index fdc9394b20..1940dcf5b2 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -155,6 +155,7 @@ import { } from "./type-utils.js"; import { getNamespace, + logError, logWarning, pascalCase, removeClientSuffix, @@ -201,7 +202,7 @@ export class CodeModelBuilder { const service = listServices(this.program)[0]; if (!service) { - throw Error("TypeSpec for HTTP must define a service."); + this.logError("TypeSpec for HTTP must define a service."); } this.serviceNamespace = service.type; @@ -555,7 +556,7 @@ export class CodeModelBuilder { } else { this.apiVersion = versions.find((it: string) => it === this.sdkContext.apiVersion); if (!this.apiVersion) { - throw new Error("Unrecognized api-version: " + this.sdkContext.apiVersion); + this.logError("Unrecognized api-version: " + this.sdkContext.apiVersion); } } @@ -587,7 +588,7 @@ export class CodeModelBuilder { } } } else if (initializationProperty.type.variantTypes.length > 2) { - throw new Error("Multiple server url defined for one client is not supported yet."); + this.logError("Multiple server url defined for one client is not supported yet."); } } else if (initializationProperty.type.kind === "endpoint") { sdkPathParameters = initializationProperty.type.templateArguments; @@ -1836,7 +1837,9 @@ export class CodeModelBuilder { } } } - throw new Error(`Unrecognized type: '${type.kind}'.`); + const errorMsg = `Unrecognized type: '${type.kind}'.`; + this.logError(errorMsg); + throw new Error(errorMsg); } private processBuiltInType(type: SdkBuiltInType, nameHint: string): Schema { @@ -2263,7 +2266,7 @@ export class CodeModelBuilder { private processUnionSchema(type: SdkUnionType, name: string): Schema { if (!(type.__raw && type.__raw.kind === "Union")) { - throw new Error(`Invalid type for union: '${type.kind}'.`); + this.logError(`Invalid type for union: '${type.kind}'.`); } const rawUnionType: Union = type.__raw as Union; const namespace = getNamespace(rawUnionType); @@ -2316,7 +2319,8 @@ export class CodeModelBuilder { private getUnionVariantName(type: Type | undefined, option: any): string { if (type === undefined) { - throw new Error("type is undefined."); + this.logError("type is undefined."); + return "UnionVariant"; } switch (type.kind) { case "Scalar": { @@ -2368,7 +2372,8 @@ export class CodeModelBuilder { case "UnionVariant": return (typeof type.name === "string" ? type.name : undefined) ?? "UnionVariant"; default: - throw new Error(`Unrecognized type for union variable: '${type.kind}'.`); + this.logError(`Unrecognized type for union variable: '${type.kind}'.`); + return "UnionVariant"; } } @@ -2415,7 +2420,9 @@ export class CodeModelBuilder { }, ); } else { - throw new Error(`Invalid type for multipart form data: '${property.type.kind}'.`); + const errorMsg = `Invalid type for multipart form data: '${property.type.kind}'.`; + this.logError(errorMsg); + throw new Error(errorMsg); } } @@ -2558,6 +2565,10 @@ export class CodeModelBuilder { } } + private logError(msg: string) { + logError(this.program, msg); + } + private logWarning(msg: string) { if (this.loggingEnabled) { logWarning(this.program, msg); diff --git a/packages/http-client-java/emitter/src/emitter.ts b/packages/http-client-java/emitter/src/emitter.ts index aac783d312..c2061b0e47 100644 --- a/packages/http-client-java/emitter/src/emitter.ts +++ b/packages/http-client-java/emitter/src/emitter.ts @@ -12,6 +12,7 @@ import { dump } from "js-yaml"; import { dirname } from "path"; import { fileURLToPath } from "url"; import { CodeModelBuilder } from "./code-model-builder.js"; +import { logError } from "./utils.js"; export interface EmitterOptions { namespace?: string; @@ -136,7 +137,8 @@ export async function $onEmit(context: EmitContext) { await promises.mkdir(outputPath, { recursive: true }).catch((err) => { if (err.code !== "EISDIR" && err.code !== "EEXIST") { - throw err; + logError(program, `Failed to create output directory: ${outputPath}`); + return; } }); @@ -233,9 +235,9 @@ export async function $onEmit(context: EmitContext) { message: msg, target: NoTarget, }); - throw new Error(msg); + logError(program, msg); } else { - throw error; + logError(program, error.message); } } diff --git a/packages/http-client-java/emitter/src/utils.ts b/packages/http-client-java/emitter/src/utils.ts index f530b635c0..f54da2e7b1 100644 --- a/packages/http-client-java/emitter/src/utils.ts +++ b/packages/http-client-java/emitter/src/utils.ts @@ -1,5 +1,15 @@ import { NoTarget, Program, Type } from "@typespec/compiler"; +export function logError(program: Program, msg: string) { + trace(program, msg); + program.reportDiagnostic({ + code: "http-client-java", + severity: "error", + message: msg, + target: NoTarget, + }); +} + export function logWarning(program: Program, msg: string) { trace(program, msg); program.reportDiagnostic({ From ac7437b75a29fc157cc1d6d8174d7d6aa26d0fad Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:43:49 -0500 Subject: [PATCH 07/71] [python] remove useless object inheritance (#5249) Co-authored-by: iscai-msft --- packages/http-client-python/eng/scripts/ci/pylintrc | 2 +- .../generator/pygen/codegen/models/primitive_types.py | 2 +- .../pygen/codegen/templates/serialization.py.jinja2 | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/http-client-python/eng/scripts/ci/pylintrc b/packages/http-client-python/eng/scripts/ci/pylintrc index 0b7f1f403c..a8882fe805 100644 --- a/packages/http-client-python/eng/scripts/ci/pylintrc +++ b/packages/http-client-python/eng/scripts/ci/pylintrc @@ -17,7 +17,7 @@ enable=useless-suppression # too-many-arguments: Due to the nature of the CLI many commands have large arguments set which reflect in large arguments set in corresponding methods. # too-many-lines: Due to code generation many files end up with too many lines. # Let's black deal with bad-continuation -disable=useless-object-inheritance,missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,disallowed-name,consider-using-max-builtin +disable=missing-docstring,locally-disabled,fixme,cyclic-import,too-many-arguments,invalid-name,duplicate-code,too-few-public-methods,consider-using-f-string,super-with-arguments,redefined-builtin,import-outside-toplevel,client-suffix-needed,unnecessary-dunder-call,unnecessary-ellipsis,disallowed-name,consider-using-max-builtin [FORMAT] max-line-length=120 diff --git a/packages/http-client-python/generator/pygen/codegen/models/primitive_types.py b/packages/http-client-python/generator/pygen/codegen/models/primitive_types.py index a6e5180cdf..395f3f235c 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/primitive_types.py +++ b/packages/http-client-python/generator/pygen/codegen/models/primitive_types.py @@ -14,7 +14,7 @@ from .code_model import CodeModel -class RawString(object): +class RawString: def __init__(self, string: str) -> None: self.string = string diff --git a/packages/http-client-python/generator/pygen/codegen/templates/serialization.py.jinja2 b/packages/http-client-python/generator/pygen/codegen/templates/serialization.py.jinja2 index ed8575a5c5..37b45fffdc 100644 --- a/packages/http-client-python/generator/pygen/codegen/templates/serialization.py.jinja2 +++ b/packages/http-client-python/generator/pygen/codegen/templates/serialization.py.jinja2 @@ -309,7 +309,7 @@ def _create_xml_node(tag, prefix=None, ns=None): return ET.Element(tag) -class Model(object): +class Model: """Mixin for all client request body/response body models to support serialization and deserialization. """ @@ -562,7 +562,7 @@ def _decode_attribute_map_key(key): return key.replace("\\.", ".") -class Serializer(object): # pylint: disable=too-many-public-methods +class Serializer: # pylint: disable=too-many-public-methods """Request object model serializer.""" basic_types = {str: "str", int: "int", bool: "bool", float: "float"} @@ -1440,7 +1440,7 @@ def xml_key_extractor(attr, attr_desc, data): # pylint: disable=unused-argument return children[0] -class Deserializer(object): +class Deserializer: """Response object model deserializer. :param dict classes: Class type dictionary for deserializing complex types. From 968312e3d0d456b74981bfe244a1ee0d01a9beda Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:58:27 -0500 Subject: [PATCH 08/71] [python] bump version and add changeset (#5251) Co-authored-by: iscai-msft --- packages/http-client-python/CHANGELOG.md | 6 ++++++ packages/http-client-python/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index 3b8b027078..8248785288 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log - @typespec/http-client-python +## 0.3.12 + +### Other Changes + +- Fix `useless-object-inheritance` pylint errors + ## 0.3.11 ### Other Changes diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index d792782feb..34627e8a8d 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-python", - "version": "0.3.11", + "version": "0.3.12", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io", From ee359ef5998a6742c6bebf0df0ef604bce96786f Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:09:40 -0600 Subject: [PATCH 09/71] [http-client-csharp] Generate all req. response classifiers (#5174) This PR adds support for generating all the required response classifiers for the generated client. fixes: https://github.com/microsoft/typespec/issues/4865 contributes to: https://github.com/microsoft/typespec/issues/4903 --- .../Abstractions/StatusCodeClassifierApi.cs | 2 + .../Classifier2xxAnd4xxDefinition.cs | 104 ------- .../PipelineMessageClassifierProvider.cs | 7 +- .../src/Providers/RestClientProvider.cs | 176 +++++------ .../Classifier2xxAnd4xxDefinitionTests.cs | 61 ---- .../RestClientProviderTests.cs | 275 ++++++++++++++---- .../CanChangeClientNamespace.cs | 43 --- .../ValidateAllClientResponseClassifiers.cs | 164 +++++++++++ .../test/common/InputFactory.cs | 5 +- .../UnbrandedTypeSpecClient.RestClient.cs | 36 +-- 10 files changed, 480 insertions(+), 393 deletions(-) delete mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Classifier2xxAnd4xxDefinition.cs delete mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Definitions/Classifier2xxAnd4xxDefinitionTests.cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ValidateAllClientResponseClassifiers.cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/StatusCodeClassifierApi.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/StatusCodeClassifierApi.cs index 1414b0f97f..ed545b6ea3 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/StatusCodeClassifierApi.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/StatusCodeClassifierApi.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.Collections.Generic; using Microsoft.Generator.CSharp.Expressions; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Snippets; @@ -17,6 +18,7 @@ public StatusCodeClassifierApi(Type type, ValueExpression original) : base(type, public abstract CSharpType ResponseClassifierType { get; } public abstract ValueExpression Create(int code); + public abstract ValueExpression Create(IEnumerable codes); public abstract StatusCodeClassifierApi FromExpression(ValueExpression original); public abstract StatusCodeClassifierApi ToExpression(); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Classifier2xxAnd4xxDefinition.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Classifier2xxAnd4xxDefinition.cs deleted file mode 100644 index 81d3330b88..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Classifier2xxAnd4xxDefinition.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// cspell:ignore Retryable - -using System; -using System.ClientModel.Primitives; -using System.IO; -using Microsoft.Generator.CSharp.Expressions; -using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Providers; -using Microsoft.Generator.CSharp.Snippets; -using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; - -namespace Microsoft.Generator.CSharp.ClientModel.Providers -{ - internal class Classifier2xxAnd4xxDefinition : TypeProvider - { - public Classifier2xxAnd4xxDefinition(TypeProvider declaringType) - { - DeclaringTypeProvider = declaringType; - } - - protected override string BuildName() => "Classifier2xxAnd4xx"; - - protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{DeclaringTypeProvider!.Name}.RestClient.cs"); - - protected override TypeSignatureModifiers GetDeclarationModifiers() - => TypeSignatureModifiers.Private | TypeSignatureModifiers.Class; - - protected override MethodProvider[] BuildMethods() - { - // TODO: Is there a better way to implement the methods? - return ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType.FrameworkType == typeof(PipelineMessageClassifier) - ? [BuildTryClassifyErrorMethod(), BuildTryClassifyRetryMethod()] - : []; - } - - protected override string GetNamespace() => DeclaringTypeProvider!.Type.Namespace; - - protected override CSharpType[] BuildImplements() - { - return [ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType]; - } - - private MethodProvider BuildTryClassifyRetryMethod() - { - var messageParam = new ParameterProvider("message", FormattableStringHelpers.Empty, typeof(PipelineMessage)); - var exceptionParam = new ParameterProvider("exception", FormattableStringHelpers.Empty, typeof(Exception)); - var isRetryableParam = new ParameterProvider("isRetryable", FormattableStringHelpers.Empty, typeof(bool), isOut: true); - var signature = new MethodSignature( - "TryClassify", - FormattableStringHelpers.Empty, - MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, - typeof(bool), - null, - [messageParam, exceptionParam, isRetryableParam]); - return new MethodProvider( - signature, - new MethodBodyStatements( - [ - isRetryableParam.Assign(False).Terminate(), - Return(False) - ]), - this); - } - - private MethodProvider BuildTryClassifyErrorMethod() - { - var messageParam = new ParameterProvider("message", FormattableStringHelpers.Empty, typeof(PipelineMessage)); - var isErrorParam = new ParameterProvider("isError", FormattableStringHelpers.Empty, typeof(bool), isOut: true); - var signature = new MethodSignature( - "TryClassify", - FormattableStringHelpers.Empty, - MethodSignatureModifiers.Public | MethodSignatureModifiers.Override, - typeof(bool), - null, - [messageParam, isErrorParam]); - return new MethodProvider( - signature, - new MethodBodyStatements( - [ - isErrorParam.Assign(False).Terminate(), - new IfStatement(messageParam.Property("Response").Equal(Null)) - { - Return(False) - }, - isErrorParam.Assign(new SwitchExpression(messageParam.Property("Response").Property("Status"), - [ - new SwitchCaseExpression( - ValueExpression.Empty.GreaterThanOrEqual(Literal(200)).AndExpr(ValueExpression.Empty.LessThan(Literal(300))), - False), - new SwitchCaseExpression( - ValueExpression.Empty.GreaterThanOrEqual(Literal(400)).AndExpr(ValueExpression.Empty.LessThan(Literal(500))), - False), - SwitchCaseExpression.Default(True) - ])).Terminate(), - Return(True) - ]), - this); - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs index 2e1f4ea702..dcb3407ec3 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/PipelineMessageClassifierProvider.cs @@ -5,6 +5,8 @@ using static Microsoft.Generator.CSharp.Snippets.Snippet; using System.ClientModel.Primitives; using Microsoft.Generator.CSharp.Primitives; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.Generator.CSharp.ClientModel.Providers { @@ -20,7 +22,10 @@ public PipelineMessageClassifierProvider(ValueExpression original) : base(typeof public override CSharpType ResponseClassifierType => typeof(PipelineMessageClassifier); public override ValueExpression Create(int code) - => Static().Invoke(nameof(PipelineMessageClassifier.Create), [New.Array(typeof(ushort), true, true, [Literal(code)])]); + => Create([code]); + + public override ValueExpression Create(IEnumerable codes) + => Static().Invoke(nameof(PipelineMessageClassifier.Create), [New.Array(typeof(ushort), true, true, [.. codes.Select(Literal)])]); public override StatusCodeClassifierApi FromExpression(ValueExpression original) => new PipelineMessageClassifierProvider(original); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs index be85bdce5e..232e030537 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs @@ -6,7 +6,6 @@ using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; -using System.Net.Http; using Microsoft.Generator.CSharp.ClientModel.Primitives; using Microsoft.Generator.CSharp.ClientModel.Snippets; using Microsoft.Generator.CSharp.Expressions; @@ -31,88 +30,41 @@ public class RestClientProvider : TypeProvider private Dictionary? _methodCache; private Dictionary MethodCache => _methodCache ??= []; + private readonly Dictionary, PropertyProvider> _pipelineMessage20xClassifiers; private readonly InputClient _inputClient; - internal ClientProvider ClientProvider { get; } - - private FieldProvider _pipelineMessageClassifier200; - private FieldProvider _pipelineMessageClassifier201; - private FieldProvider _pipelineMessageClassifier202; - private FieldProvider _pipelineMessageClassifier204; - private FieldProvider _pipelineMessageClassifier2xxAnd4xx; - private TypeProvider _classifier2xxAnd4xxDefinition; - - private PropertyProvider _classifier201Property; - private PropertyProvider _classifier200Property; - private PropertyProvider _classifier202Property; - private PropertyProvider _classifier204Property; - private PropertyProvider _classifier2xxAnd4xxProperty; public RestClientProvider(InputClient inputClient, ClientProvider clientProvider) { _inputClient = inputClient; ClientProvider = clientProvider; - _pipelineMessageClassifier200 = new FieldProvider(FieldModifiers.Private | FieldModifiers.Static, ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, "_pipelineMessageClassifier200", this); - _pipelineMessageClassifier201 = new FieldProvider(FieldModifiers.Private | FieldModifiers.Static, ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, "_pipelineMessageClassifier201", this); - _pipelineMessageClassifier202 = new FieldProvider(FieldModifiers.Private | FieldModifiers.Static, ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, "_pipelineMessageClassifier202", this); - _pipelineMessageClassifier204 = new FieldProvider(FieldModifiers.Private | FieldModifiers.Static, ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, "_pipelineMessageClassifier204", this); - _classifier2xxAnd4xxDefinition = new Classifier2xxAnd4xxDefinition(this); - _pipelineMessageClassifier2xxAnd4xx = new FieldProvider(FieldModifiers.Private | FieldModifiers.Static, _classifier2xxAnd4xxDefinition.Type, "_pipelineMessageClassifier2xxAnd4xx", this); - _classifier200Property = GetResponseClassifierProperty(_pipelineMessageClassifier200, 200); - _classifier201Property = GetResponseClassifierProperty(_pipelineMessageClassifier201, 201); - _classifier202Property = GetResponseClassifierProperty(_pipelineMessageClassifier202, 202); - _classifier204Property = GetResponseClassifierProperty(_pipelineMessageClassifier204, 204); - _classifier2xxAnd4xxProperty = new PropertyProvider( - $"Gets the PipelineMessageClassifier2xxAnd4xx", - MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, - _classifier2xxAnd4xxDefinition.Type, - "PipelineMessageClassifier2xxAnd4xx", - new ExpressionPropertyBody(_pipelineMessageClassifier2xxAnd4xx.Assign(New.Instance(_classifier2xxAnd4xxDefinition.Type), true)), - this); + _pipelineMessage20xClassifiers = BuildPipelineMessage20xClassifiers(); } + internal ClientProvider ClientProvider { get; } + protected override string BuildRelativeFilePath() => Path.Combine("src", "Generated", $"{Name}.RestClient.cs"); protected override string BuildName() => _inputClient.Name.ToCleanName(); protected override PropertyProvider[] BuildProperties() { - return - [ - _classifier200Property, - _classifier201Property, - _classifier202Property, - _classifier204Property, - _classifier2xxAnd4xxProperty - ]; - } - - private PropertyProvider GetResponseClassifierProperty(FieldProvider pipelineMessageClassifier, int code) - { - return new PropertyProvider( - null, - MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, - ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, - pipelineMessageClassifier.Name.Substring(1).ToCleanName(), - new ExpressionPropertyBody( - pipelineMessageClassifier.Assign(This.ToApi().Create(code))), - this); + return [.. _pipelineMessage20xClassifiers.Values.OrderBy(v => v.Name)]; } protected override FieldProvider[] BuildFields() { - return - [ - _pipelineMessageClassifier200, - _pipelineMessageClassifier201, - _pipelineMessageClassifier202, - _pipelineMessageClassifier204, - _pipelineMessageClassifier2xxAnd4xx - ]; - } + List pipelineMessage20xClassifiersFields = new(_pipelineMessage20xClassifiers.Count); + var orderedClassifierProperties = _pipelineMessage20xClassifiers.Values.OrderBy(v => v.Name); - protected override TypeProvider[] BuildNestedTypes() - { - return [_classifier2xxAnd4xxDefinition]; + foreach (var classifierProperty in orderedClassifierProperties) + { + if (classifierProperty.BackingField != null) + { + pipelineMessage20xClassifiersFields.Add(classifierProperty.BackingField); + } + } + + return [.. pipelineMessage20xClassifiersFields]; } protected override MethodProvider[] BuildMethods() @@ -129,12 +81,6 @@ protected override MethodProvider[] BuildMethods() return [.. methods]; } - private bool IsCreateRequest(MethodProvider method) - { - var span = method.Signature.Name.AsSpan(); - return span.StartsWith("Create", StringComparison.Ordinal) && span.EndsWith("Request", StringComparison.Ordinal); - } - private MethodProvider BuildCreateRequestMethod(InputOperation operation) { var pipelineField = ClientProvider.PipelineProperty.ToApi(); @@ -186,26 +132,50 @@ private IReadOnlyList GetSetContent(HttpRequestApi request, return contentParam is null ? [] : [request.Content().Assign(contentParam).Terminate()]; } - private PropertyProvider GetClassifier(InputOperation operation) + private Dictionary, PropertyProvider> BuildPipelineMessage20xClassifiers() { - if (operation.HttpMethod == HttpMethod.Head.ToString()) - return _classifier2xxAnd4xxProperty; + // Contains a mapping of classifier status codes to their corresponding pipeline message classifier property + Dictionary, PropertyProvider> classifiers = new(new StatusCodesComparer()); - var response = operation.Responses.First(r => !r.IsErrorResponse); //should only be one of these - - if (response.StatusCodes.Count == 1) + foreach (var inputOperation in _inputClient.Operations) { - return response.StatusCodes[0] switch + var statusCodes = GetSuccessStatusCodes(inputOperation); + if (statusCodes.Count > 0 && !classifiers.ContainsKey(statusCodes)) { - 200 => _classifier200Property, - 201 => _classifier201Property, - 202 => _classifier202Property, - 204 => _classifier204Property, - _ => throw new InvalidOperationException($"Unexpected status code {response.StatusCodes[0]}") - }; + var classifierNameSuffix = string.Join(string.Empty, statusCodes); + var classifierBackingField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Static, + ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, + $"_pipelineMessageClassifier{classifierNameSuffix}", + this); + + var classifierProperty = new PropertyProvider( + null, + MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, + ClientModelPlugin.Instance.TypeFactory.StatusCodeClassifierApi.ResponseClassifierType, + classifierBackingField.Name.Substring(1).ToCleanName(), + new ExpressionPropertyBody( + classifierBackingField.Assign(This.ToApi().Create(GetSuccessStatusCodes(inputOperation)))), + this) + { + BackingField = classifierBackingField + }; + + classifiers[statusCodes] = classifierProperty; + } } - throw new InvalidOperationException("Multiple status codes not supported"); + return classifiers; + } + + private PropertyProvider GetClassifier(InputOperation operation) + { + if (_pipelineMessage20xClassifiers.TryGetValue(GetSuccessStatusCodes(operation), out var classifier)) + { + return classifier; + } + + throw new InvalidOperationException($"Unexpected status codes for operation {operation.Name}"); } private IEnumerable AppendHeaderParameters(HttpRequestApi request, InputOperation operation, Dictionary paramMap) @@ -508,6 +478,26 @@ private static bool TryGetSpecialHeaderParam(InputParameter inputParameter, [Not return false; } + private static List GetSuccessStatusCodes(InputOperation operation) + { + HashSet statusCodes = []; + foreach (var response in operation.Responses) + { + if (response.IsErrorResponse) + continue; + + foreach (var statusCode in response.StatusCodes) + { + if (statusCode >= 200 && statusCode < 300) + { + statusCodes.Add(statusCode); + } + } + } + + return [.. statusCodes.OrderBy(i => i)]; + } + internal MethodProvider GetCreateRequestMethod(InputOperation operation) { _ = Methods; // Ensure methods are built @@ -636,5 +626,23 @@ internal enum MethodType Protocol, Convenience } + + private class StatusCodesComparer : IEqualityComparer> + { + bool IEqualityComparer>.Equals(List? x, List? y) + { + return x != null && y != null && x.SequenceEqual(y); + } + + int IEqualityComparer>.GetHashCode(List obj) + { + HashCode hash = new(); + foreach (var item in obj) + { + hash.Add(item); + } + return hash.ToHashCode(); + } + } } } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Definitions/Classifier2xxAnd4xxDefinitionTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Definitions/Classifier2xxAnd4xxDefinitionTests.cs deleted file mode 100644 index 67b6ab2212..0000000000 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Definitions/Classifier2xxAnd4xxDefinitionTests.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.Tests.Common; -using NUnit.Framework; - -namespace Microsoft.Generator.CSharp.ClientModel.Tests.Providers.Definitions -{ - public class Classifier2xxAnd4xxDefinitionTests - { - [TestCaseSource(nameof(GetTypeNamespaceTestCases))] - public void TestGetTypeNamespace(string mockJson) - { - MockHelpers.LoadMockPlugin(configuration: mockJson); - var inputClient = InputFactory.Client("TestClient"); - var restClientProvider = new ClientProvider(inputClient).RestClient; - Assert.IsNotNull(restClientProvider); - - var classifier2xxAnd4xxDefinition = new Classifier2xxAnd4xxDefinition(restClientProvider); - var result = classifier2xxAnd4xxDefinition.Type.Namespace; - - Assert.AreEqual(restClientProvider.Type.Namespace, result); - } - - [Test] - public async Task TestGetTypeCustomNamespace() - { - var inputClient = InputFactory.Client("TestClient"); - var plugin = await MockHelpers.LoadMockPluginAsync( - clients: () => [inputClient], - compilation: async () => await Helpers.GetCompilationFromDirectoryAsync()); - - // Find the rest client provider - var clientProvider = plugin.Object.OutputLibrary.TypeProviders.SingleOrDefault(t => t is ClientProvider); - Assert.IsNotNull(clientProvider); - var restClientProvider = (clientProvider as ClientProvider)!.RestClient; - Assert.IsNotNull(restClientProvider); - - var classifier2xxAnd4xxDefinition = new Classifier2xxAnd4xxDefinition(restClientProvider!); - var result = classifier2xxAnd4xxDefinition.Type.Namespace; - - Assert.AreEqual(restClientProvider!.Type.Namespace, result); - } - - public static IEnumerable GetTypeNamespaceTestCases - { - get - { - yield return new TestCaseData(@"{ - ""output-folder"": ""outputFolder"", - ""library-name"": ""libraryName"", - ""namespace"": ""testNamespace"" - }"); - } - } - } -} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs index 3a1b883d6f..dc6aa4525b 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/RestClientProviderTests.cs @@ -73,26 +73,10 @@ public void ValidateFields() Assert.AreEqual("_pipelineMessageClassifier200", pipelineMessageClassifier200.Name); Assert.AreEqual(FieldModifiers.Private | FieldModifiers.Static, pipelineMessageClassifier200.Modifiers); - //validate _pipelineMessageClassifier201 - Assert.IsTrue(fieldHash.ContainsKey("_pipelineMessageClassifier201")); - var pipelineMessageClassifier201 = fieldHash["_pipelineMessageClassifier201"]; - Assert.AreEqual("PipelineMessageClassifier", pipelineMessageClassifier201.Type.Name); - Assert.AreEqual("_pipelineMessageClassifier201", pipelineMessageClassifier201.Name); - Assert.AreEqual(FieldModifiers.Private | FieldModifiers.Static, pipelineMessageClassifier201.Modifiers); - - //validate _pipelineMessageClassifier204 - Assert.IsTrue(fieldHash.ContainsKey("_pipelineMessageClassifier204")); - var pipelineMessageClassifier204 = fieldHash["_pipelineMessageClassifier204"]; - Assert.AreEqual("PipelineMessageClassifier", pipelineMessageClassifier204.Type.Name); - Assert.AreEqual("_pipelineMessageClassifier204", pipelineMessageClassifier204.Name); - Assert.AreEqual(FieldModifiers.Private | FieldModifiers.Static, pipelineMessageClassifier204.Modifiers); - - //validate _pipelineMessageClassifier2xxAnd4xx - Assert.IsTrue(fieldHash.ContainsKey("_pipelineMessageClassifier2xxAnd4xx")); - var pipelineMessageClassifier2xxAnd4xx = fieldHash["_pipelineMessageClassifier2xxAnd4xx"]; - Assert.AreEqual("Classifier2xxAnd4xx", pipelineMessageClassifier2xxAnd4xx.Type.Name); - Assert.AreEqual("_pipelineMessageClassifier2xxAnd4xx", pipelineMessageClassifier2xxAnd4xx.Name); - Assert.AreEqual(FieldModifiers.Private | FieldModifiers.Static, pipelineMessageClassifier2xxAnd4xx.Modifiers); + //validate _pipelineMessageClassifier201 isn't present + Assert.IsFalse(fieldHash.ContainsKey("_pipelineMessageClassifier201")); + //validate _pipelineMessageClassifier204 isn't present + Assert.IsFalse(fieldHash.ContainsKey("_pipelineMessageClassifier204")); } [Test] @@ -109,29 +93,10 @@ public void ValidateProperties() Assert.AreEqual(MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, pipelineMessageClassifier200.Modifiers); Assert.IsFalse(pipelineMessageClassifier200.Body.HasSetter); - //validate _pipelineMessageClassifier201 - Assert.IsTrue(propertyHash.ContainsKey("PipelineMessageClassifier201")); - var pipelineMessageClassifier201 = propertyHash["PipelineMessageClassifier201"]; - Assert.AreEqual("PipelineMessageClassifier", pipelineMessageClassifier201.Type.Name); - Assert.AreEqual("PipelineMessageClassifier201", pipelineMessageClassifier201.Name); - Assert.AreEqual(MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, pipelineMessageClassifier201.Modifiers); - Assert.IsFalse(pipelineMessageClassifier201.Body.HasSetter); - - //validate _pipelineMessageClassifier204 - Assert.IsTrue(propertyHash.ContainsKey("PipelineMessageClassifier204")); - var pipelineMessageClassifier204 = propertyHash["PipelineMessageClassifier204"]; - Assert.AreEqual("PipelineMessageClassifier", pipelineMessageClassifier204.Type.Name); - Assert.AreEqual("PipelineMessageClassifier204", pipelineMessageClassifier204.Name); - Assert.AreEqual(MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, pipelineMessageClassifier204.Modifiers); - Assert.IsFalse(pipelineMessageClassifier204.Body.HasSetter); - - //validate _pipelineMessageClassifier2xxAnd4xx - Assert.IsTrue(propertyHash.ContainsKey("PipelineMessageClassifier2xxAnd4xx")); - var pipelineMessageClassifier2xxAnd4xx = propertyHash["PipelineMessageClassifier2xxAnd4xx"]; - Assert.AreEqual("Classifier2xxAnd4xx", pipelineMessageClassifier2xxAnd4xx.Type.Name); - Assert.AreEqual("PipelineMessageClassifier2xxAnd4xx", pipelineMessageClassifier2xxAnd4xx.Name); - Assert.AreEqual(MethodSignatureModifiers.Private | MethodSignatureModifiers.Static, pipelineMessageClassifier2xxAnd4xx.Modifiers); - Assert.IsFalse(pipelineMessageClassifier2xxAnd4xx.Body.HasSetter); + //validate _pipelineMessageClassifier201 isn't present + Assert.IsFalse(propertyHash.ContainsKey("PipelineMessageClassifier201")); + //validate _pipelineMessageClassifier204 isn't present + Assert.IsFalse(propertyHash.ContainsKey("PipelineMessageClassifier204")); } [TestCaseSource(nameof(GetMethodParametersTestCases))] @@ -256,26 +221,112 @@ public void ValidateClientWithApiVersionPathParameter(InputClient inputClient) public void ValidateClientResponseClassifiers(InputClient inputClient) { var restClientProvider = new ClientProvider(inputClient).RestClient; - var method = restClientProvider.Methods.FirstOrDefault(m => m.Signature.Name == "CreateTestOperationRequest"); - Assert.IsNotNull(method); + Dictionary fieldHash = restClientProvider.Fields.ToDictionary(f => f.Name); + Dictionary propertyHash = restClientProvider.Properties.ToDictionary(p => p.Name); - var bodyStatements = method?.BodyStatements as MethodBodyStatements; - Assert.IsNotNull(bodyStatements); - /* verify that the expected classifier is present in the body */ - var inputOp = inputClient.Operations.FirstOrDefault(); - Assert.IsNotNull(inputOp); - var expectedStatusCode = inputOp!.Responses.FirstOrDefault()?.StatusCodes.FirstOrDefault(); - Assert.IsNotNull(expectedStatusCode); - if (expectedStatusCode == 201) + foreach (var inputOperation in inputClient.Operations) + { + List expectedStatusCodes = []; + foreach (var response in inputOperation.Responses) + { + if (response.IsErrorResponse) + continue; + expectedStatusCodes.AddRange(response.StatusCodes); + } + + Assert.IsTrue(expectedStatusCodes.Count > 0); + + var classifierNameSuffix = string.Join(string.Empty, expectedStatusCodes.OrderBy(s => s)); + Assert.IsNotEmpty(classifierNameSuffix); + + // validate fields + Assert.IsTrue(fieldHash.ContainsKey($"_pipelineMessageClassifier{classifierNameSuffix}")); + // validate properties + Assert.IsTrue(propertyHash.ContainsKey($"PipelineMessageClassifier{classifierNameSuffix}")); + + // verify that the expected classifier is present in the CreateRequest method body + var method = restClientProvider.Methods.FirstOrDefault(m => m.Signature.Name == $"CreateTestOperation{classifierNameSuffix}Request"); + Assert.IsNotNull(method); + + var bodyStatements = method?.BodyStatements as MethodBodyStatements; + Assert.IsNotNull(bodyStatements); + + ValidateResponseClassifier(bodyStatements!, classifierNameSuffix); + } + } + + // This test validates that all the success status codes have their respective classifiers generated. + [Test] + public void ValidateAllClientResponseClassifiers() + { + var inputClient = InputFactory.Client( + "TestClient", + operations: + [ + OperationWith204Resp, + OperationWith205Resp, + OperationWith206Resp, + OperationWith200Resp, + OperationWith202Resp, + OperationWith201Resp, + OperationWith203Resp, + OperationWith200201202Resp, + OperationWith200201202Resp_Duplicate + ]); + var restClientProvider = new ClientProvider(inputClient).RestClient; + var writer = new TypeProviderWriter(restClientProvider); + var file = writer.Write(); + + Assert.AreEqual(Helpers.GetExpectedFromFile(), file.Content); + } + + // validates no duplicate properties or fields are generated for the same status codes. + [TestCaseSource(nameof(TestResponseClassifiersDuplicationTestCases))] + public void TestResponseClassifierDuplication(InputClient inputClient) + { + var restClientProvider = new ClientProvider(inputClient).RestClient; + var classifierFields = restClientProvider.Fields.Where(f => f.Name.StartsWith("_pipelineMessageClassifier")).ToList(); + var classifierProperties = restClientProvider.Properties.Where(p => p.Name.StartsWith("PipelineMessageClassifier")).ToList(); + + Assert.AreEqual(4, classifierFields.Count); + Assert.AreEqual(4, classifierProperties.Count); + + Assert.IsTrue(classifierFields.Any(f => f.Name == "_pipelineMessageClassifier200")); + Assert.IsTrue(classifierFields.Any(f => f.Name == "_pipelineMessageClassifier201202")); + Assert.IsTrue(classifierFields.Any(f => f.Name == "_pipelineMessageClassifier201204")); + Assert.IsTrue(classifierFields.Any(f => f.Name == "_pipelineMessageClassifier200201204")); + + Assert.IsTrue(classifierProperties.Any(p => p.Name == "PipelineMessageClassifier200")); + Assert.IsTrue(classifierProperties.Any(p => p.Name == "PipelineMessageClassifier201202")); + Assert.IsTrue(classifierProperties.Any(p => p.Name == "PipelineMessageClassifier201204")); + Assert.IsTrue(classifierProperties.Any(p => p.Name == "PipelineMessageClassifier200201204")); + } + + [Test] + public void ValidateGetResponseClassifiersThrowsWhenNoSuccess() + { + var inputOp = InputFactory.Operation( + "TestOperation", + responses: [InputFactory.OperationResponse([500])]); + var inputClient = InputFactory.Client( + "TestClient", + operations: [inputOp]); + Assert.IsNotNull(inputClient); + + var restClientProvider = new ClientProvider(inputClient).RestClient; + Assert.IsNotNull(restClientProvider); + + try { - Assert.IsTrue(bodyStatements!.Statements.Any(s => s.ToDisplayString() == "message.ResponseClassifier = PipelineMessageClassifier201;\n")); - Assert.IsFalse(bodyStatements!.Statements.Any(s => s.ToDisplayString() == "message.ResponseClassifier = PipelineMessageClassifier200;\n")); + var methods = restClientProvider.Methods; } - else if (expectedStatusCode == 200) + catch (InvalidOperationException e) { - Assert.IsTrue(bodyStatements!.Statements.Any(s => s.ToDisplayString() == "message.ResponseClassifier = PipelineMessageClassifier200;\n")); - Assert.IsFalse(bodyStatements!.Statements.Any(s => s.ToDisplayString() == "message.ResponseClassifier = PipelineMessageClassifier201;\n")); + Assert.AreEqual($"Unexpected status codes for operation {inputOp.Name}", e.Message); + return; } + + Assert.Fail("Expected Exception to be thrown."); } [Test] @@ -307,6 +358,14 @@ public void TestBuildCreateRequestMethodWithQueryParameters() Assert.AreEqual(Helpers.GetExpectedFromFile(), file.Content); } + private static void ValidateResponseClassifier(MethodBodyStatements bodyStatements, string parsedStatusCodes) + { + var classifier = $"PipelineMessageClassifier{parsedStatusCodes}"; + var classifierStatement = $"message.ResponseClassifier = {classifier};\n"; + + Assert.IsTrue(bodyStatements.Statements.Any(s => s.ToDisplayString() == classifierStatement)); + } + private readonly static InputOperation BasicOperation = InputFactory.Operation( "CreateMessage", parameters: @@ -326,21 +385,75 @@ public void TestBuildCreateRequestMethodWithQueryParameters() InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) ]); + private static readonly InputOperation OperationWith200Resp = InputFactory.Operation( + "TestOperation200", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([200])]); + private static readonly InputOperation OperationWith200201202Resp = InputFactory.Operation( + "TestOperation200201202", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([201, 200, 202])]); + private static readonly InputOperation OperationWith200201202Resp_Duplicate = InputFactory.Operation( + "DuplicateTestOperation200201202", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([201, 200, 202])]); + private static readonly InputOperation OperationWith201Resp = InputFactory.Operation( - "TestOperation", + "TestOperation201", parameters: [ InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) ], responses: [InputFactory.OperationResponse([201])]); - private static readonly InputOperation OperationWith200Resp = InputFactory.Operation( - "TestOperation", + private static readonly InputOperation OperationWith202Resp = InputFactory.Operation( + "TestOperation202", parameters: [ InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) ], - responses: [InputFactory.OperationResponse([200])]); + responses: [InputFactory.OperationResponse([202])]); + + private static readonly InputOperation OperationWith203Resp = InputFactory.Operation( + "TestOperation203", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([203])]); + + private static readonly InputOperation OperationWith204Resp = InputFactory.Operation( + "TestOperation204", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([204])]); + + private static readonly InputOperation OperationWith205Resp = InputFactory.Operation( + "TestOperation205", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([205])]); + + private static readonly InputOperation OperationWith206Resp = InputFactory.Operation( + "TestOperation206", + parameters: + [ + InputFactory.Parameter("message", InputPrimitiveType.Boolean, isRequired: true) + ], + responses: [InputFactory.OperationResponse([206])]); private readonly static InputOperation OperationWithSpreadParam = InputFactory.Operation( "CreateMessageWithSpread", @@ -455,8 +568,44 @@ public void TestBuildCreateRequestMethodWithQueryParameters() private static IEnumerable ValidateClientResponseClassifiersTestCases => [ + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith200Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith200201202Resp])), new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith201Resp])), - new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith200Resp])) + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith202Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith203Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith204Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith205Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith206Resp])), + new TestCaseData(InputFactory.Client("TestClient", operations: [OperationWith203Resp, OperationWith200Resp, OperationWith202Resp])), + ]; + + private static IEnumerable TestResponseClassifiersDuplicationTestCases => + [ + new TestCaseData(InputFactory.Client("TestClient", operations: + [ + // _pipelineMessageClassifier200 + InputFactory.Operation("TestOperation200", + responses: [InputFactory.OperationResponse([200])]), + InputFactory.Operation("TestOperation200_1", + responses: [InputFactory.OperationResponse([200])]), + // _pipelineMessageClassifier201202 + InputFactory.Operation("TestOperation202201", + responses: [InputFactory.OperationResponse([201, 202])]), + InputFactory.Operation("TestOperation202201_1", + responses: [InputFactory.OperationResponse([201, 202])]), + InputFactory.Operation("TestOperation202_201", + responses: [InputFactory.OperationResponse([202]), InputFactory.OperationResponse([201])]), + InputFactory.Operation("TestOperation202_201_1", + responses: [InputFactory.OperationResponse([202]), InputFactory.OperationResponse([201])]), + // _pipelineMessageClassifier201204 + InputFactory.Operation("TestOperation204_201", + responses: [InputFactory.OperationResponse([204]), InputFactory.OperationResponse([201])]), + InputFactory.Operation("TestOperation204_201_1", + responses: [InputFactory.OperationResponse([201]), InputFactory.OperationResponse([204])]), + // _pipelineMessageClassifier200202204 + InputFactory.Operation("TestOperation200_201_204", + responses: [InputFactory.OperationResponse([204]), InputFactory.OperationResponse([201]), InputFactory.OperationResponse([200])]), + ])) ]; private static IEnumerable GetSpreadParameterModelTestCases => diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderCustomizationTests/CanChangeClientNamespace.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderCustomizationTests/CanChangeClientNamespace.cs index 3edc8fd499..04bdf42158 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderCustomizationTests/CanChangeClientNamespace.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderCustomizationTests/CanChangeClientNamespace.cs @@ -2,53 +2,10 @@ #nullable disable -using System; -using System.ClientModel.Primitives; - namespace Sample.Custom { /// public partial class TestClient { - private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier200; - private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier201; - private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier202; - private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier204; - private static global::Sample.Custom.TestClient.Classifier2xxAnd4xx _pipelineMessageClassifier2xxAnd4xx; - - private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - - private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier201 => _pipelineMessageClassifier201 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 201 }); - - private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier202 => _pipelineMessageClassifier202 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 202 }); - - private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - - private static global::Sample.Custom.TestClient.Classifier2xxAnd4xx PipelineMessageClassifier2xxAnd4xx => _pipelineMessageClassifier2xxAnd4xx ??= new global::Sample.Custom.TestClient.Classifier2xxAnd4xx(); - - private class Classifier2xxAnd4xx : global::System.ClientModel.Primitives.PipelineMessageClassifier - { - public override bool TryClassify(global::System.ClientModel.Primitives.PipelineMessage message, out bool isError) - { - isError = false; - if ((message.Response == null)) - { - return false; - } - isError = message.Response.Status switch - { - ((>= 200) and (< 300)) => false, - ((>= 400) and (< 500)) => false, - _ => true - }; - return true; - } - - public override bool TryClassify(global::System.ClientModel.Primitives.PipelineMessage message, global::System.Exception exception, out bool isRetryable) - { - isRetryable = false; - return false; - } - } } } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ValidateAllClientResponseClassifiers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ValidateAllClientResponseClassifiers.cs new file mode 100644 index 0000000000..4d7a3c184a --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/RestClientProviders/TestData/RestClientProviderTests/ValidateAllClientResponseClassifiers.cs @@ -0,0 +1,164 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; + +namespace Sample +{ + /// + public partial class TestClient + { + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier200; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier200201202; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier201; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier202; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier203; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier204; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier205; + private static global::System.ClientModel.Primitives.PipelineMessageClassifier _pipelineMessageClassifier206; + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier200201202 => _pipelineMessageClassifier200201202 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 200, 201, 202 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier201 => _pipelineMessageClassifier201 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 201 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier202 => _pipelineMessageClassifier202 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 202 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier203 => _pipelineMessageClassifier203 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 203 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier205 => _pipelineMessageClassifier205 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 205 }); + + private static global::System.ClientModel.Primitives.PipelineMessageClassifier PipelineMessageClassifier206 => _pipelineMessageClassifier206 = global::System.ClientModel.Primitives.PipelineMessageClassifier.Create(stackalloc ushort[] { 206 }); + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation204Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier204; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation205Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier205; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation206Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier206; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation200Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier200; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation202Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier202; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation201Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier201; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation203Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier203; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateTestOperation200201202Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier200201202; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + + internal global::System.ClientModel.Primitives.PipelineMessage CreateDuplicateTestOperation200201202Request(global::System.ClientModel.BinaryContent content, global::System.ClientModel.Primitives.RequestOptions options) + { + global::System.ClientModel.Primitives.PipelineMessage message = Pipeline.CreateMessage(); + message.ResponseClassifier = PipelineMessageClassifier200201202; + global::System.ClientModel.Primitives.PipelineRequest request = message.Request; + request.Method = "GET"; + global::Sample.ClientUriBuilder uri = new global::Sample.ClientUriBuilder(); + uri.Reset(_endpoint); + request.Uri = uri.ToUri(); + request.Content = content; + message.Apply(options); + return message; + } + } +} diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/common/InputFactory.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/common/InputFactory.cs index ace1acce3b..ab744e62e9 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/common/InputFactory.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/common/InputFactory.cs @@ -209,7 +209,8 @@ public static InputOperation Operation( IEnumerable? responses = null, IEnumerable? requestMediaTypes = null, string uri = "", - string path = "") + string path = "", + string httpMethod = "GET") { return new InputOperation( name, @@ -219,7 +220,7 @@ public static InputOperation Operation( access, parameters is null ? [] : [.. parameters], responses is null ? [OperationResponse()] : [.. responses], - "GET", + httpMethod, BodyMediaType.Json, uri, path, diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.RestClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.RestClient.cs index 5f6ddb7250..e5ed76fe1f 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.RestClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.RestClient.cs @@ -12,21 +12,12 @@ namespace UnbrandedTypeSpec public partial class UnbrandedTypeSpecClient { private static PipelineMessageClassifier _pipelineMessageClassifier200; - private static PipelineMessageClassifier _pipelineMessageClassifier201; - private static PipelineMessageClassifier _pipelineMessageClassifier202; private static PipelineMessageClassifier _pipelineMessageClassifier204; - private static Classifier2xxAnd4xx _pipelineMessageClassifier2xxAnd4xx; private static PipelineMessageClassifier PipelineMessageClassifier200 => _pipelineMessageClassifier200 = PipelineMessageClassifier.Create(stackalloc ushort[] { 200 }); - private static PipelineMessageClassifier PipelineMessageClassifier201 => _pipelineMessageClassifier201 = PipelineMessageClassifier.Create(stackalloc ushort[] { 201 }); - - private static PipelineMessageClassifier PipelineMessageClassifier202 => _pipelineMessageClassifier202 = PipelineMessageClassifier.Create(stackalloc ushort[] { 202 }); - private static PipelineMessageClassifier PipelineMessageClassifier204 => _pipelineMessageClassifier204 = PipelineMessageClassifier.Create(stackalloc ushort[] { 204 }); - private static Classifier2xxAnd4xx PipelineMessageClassifier2xxAnd4xx => _pipelineMessageClassifier2xxAnd4xx ??= new Classifier2xxAnd4xx(); - internal PipelineMessage CreateSayHiRequest(string headParameter, string queryParameter, string optionalQuery, RequestOptions options) { PipelineMessage message = Pipeline.CreateMessage(); @@ -314,7 +305,7 @@ internal PipelineMessage CreateStillConvenientRequest(RequestOptions options) internal PipelineMessage CreateHeadAsBooleanRequest(string id, RequestOptions options) { PipelineMessage message = Pipeline.CreateMessage(); - message.ResponseClassifier = PipelineMessageClassifier2xxAnd4xx; + message.ResponseClassifier = PipelineMessageClassifier204; PipelineRequest request = message.Request; request.Method = "HEAD"; ClientUriBuilder uri = new ClientUriBuilder(); @@ -341,30 +332,5 @@ internal PipelineMessage CreateWithApiVersionRequest(string p1, RequestOptions o message.Apply(options); return message; } - - private class Classifier2xxAnd4xx : PipelineMessageClassifier - { - public override bool TryClassify(PipelineMessage message, out bool isError) - { - isError = false; - if (message.Response == null) - { - return false; - } - isError = message.Response.Status switch - { - >= 200 and < 300 => false, - >= 400 and < 500 => false, - _ => true - }; - return true; - } - - public override bool TryClassify(PipelineMessage message, Exception exception, out bool isRetryable) - { - isRetryable = false; - return false; - } - } } } From 968f9c941c8a8052b290a5497acf6aaaaaf3d875 Mon Sep 17 00:00:00 2001 From: Christopher Radek <14189820+chrisradek@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:39:24 -0800 Subject: [PATCH 10/71] Revert "Fix typeChangedFrom of template/union to catch invalid versioning" (#5247) Reverts microsoft/typespec#5191 This introduced a new bug when validating `@typeChangedFrom` references where the 'current' versioned type is a template or union. [Example](https://cadlplayground.z22.web.core.windows.net/prs/5191/?c=aW1wb3J0ICJAdHlwZXNwZWMvdmVyc2lvbmluZyI7DQoNCnVzaW5nIFbJFsUVQHNlcnZpY2UNCkDHMGVkKMckcykNCm5hbWVzcGFjZSBTYW1wbGUuVGV4dMU6ZW51bchOcyB7DQogIHYxLMUHMiwNCn3FXmFkZMtQLnYyKQ0KbW9kZWwgQmV0dGVyUmVzdWx0VHlwZcZCYsUWRm9vOiBzdHLmAKXFSsY10C9zaeQAlNkvQ3VzdG9txjXGMeUBHkNoYW5nZWRGcm9t7ACbLCBBcnJheTzKZT4pxDRmYWlsczrHHfAAtz7lAQzfWddZd29ya3M68QEK5gDE&e=%40typespec%2Fopenapi3&options=%7B%7D) --- ...rsioning-typechanged-2024-10-25-16-56-3.md | 7 -- packages/versioning/src/validate.ts | 12 --- .../test/incompatible-versioning.test.ts | 100 ------------------ 3 files changed, 119 deletions(-) delete mode 100644 .chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md diff --git a/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md b/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md deleted file mode 100644 index 20eddbe575..0000000000 --- a/.chronus/changes/fix-versioning-typechanged-2024-10-25-16-56-3.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/versioning" ---- - -Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template or union. \ No newline at end of file diff --git a/packages/versioning/src/validate.ts b/packages/versioning/src/validate.ts index 63aeb82c5b..bfce834dba 100644 --- a/packages/versioning/src/validate.ts +++ b/packages/versioning/src/validate.ts @@ -226,18 +226,6 @@ function validateMultiTypeReference(program: Program, source: Type, options?: Ty const availMap = getAvailabilityMap(program, type); const availability = availMap?.get(version.name) ?? Availability.Available; if ([Availability.Added, Availability.Available].includes(availability)) { - // Check if there are any indexed/template arguments that are validated... - if (isTemplateInstance(type)) { - for (const arg of type.templateMapper.args) { - if (isType(arg)) { - validateReference(program, source, arg); - } - } - } else if (type.kind === "Union") { - for (const variant of type.variants.values()) { - validateReference(program, source, variant.type); - } - } continue; } reportDiagnostic(program, { diff --git a/packages/versioning/test/incompatible-versioning.test.ts b/packages/versioning/test/incompatible-versioning.test.ts index 5be97ccdd7..dd8159d34b 100644 --- a/packages/versioning/test/incompatible-versioning.test.ts +++ b/packages/versioning/test/incompatible-versioning.test.ts @@ -387,106 +387,6 @@ describe("versioning: validate incompatible references", () => { }); }); - it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in arrays", async () => { - const diagnostics = await runner.diagnose(` - @test - @added(Versions.v2) - model Original {} - - @test - @added(Versions.v2) - model Updated {} - - @test - model Test { - @typeChangedFrom(Versions.v2, Original[]) - prop: Updated; - } - `); - expectDiagnostics(diagnostics, { - code: "@typespec/versioning/incompatible-versioned-reference", - severity: "error", - message: - "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", - }); - }); - - it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in records", async () => { - const diagnostics = await runner.diagnose(` - @test - @added(Versions.v2) - model Original {} - - @test - @added(Versions.v2) - model Updated {} - - @test - model Test { - @typeChangedFrom(Versions.v2, Record) - prop: Updated; - } - `); - expectDiagnostics(diagnostics, { - code: "@typespec/versioning/incompatible-versioned-reference", - severity: "error", - message: - "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", - }); - }); - - it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in unions", async () => { - const diagnostics = await runner.diagnose(` - @test - @added(Versions.v2) - model Original {} - - @test - @added(Versions.v2) - model Updated {} - - @test - model Test { - @typeChangedFrom(Versions.v2, Original | string) - prop: Updated; - } - `); - expectDiagnostics(diagnostics, { - code: "@typespec/versioning/incompatible-versioned-reference", - severity: "error", - message: - "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", - }); - }); - - it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in template", async () => { - const diagnostics = await runner.diagnose(` - @test - @added(Versions.v2) - model Original {} - - @test - @added(Versions.v2) - model Updated {} - - model Template { - prop: T; - } - - @test - model Test { - @typeChangedFrom(Versions.v2, Template) - prop: Updated; - } - `); - expectDiagnostics(diagnostics, { - code: "@typespec/versioning/incompatible-versioned-reference", - severity: "error", - message: - "'TestService.Test.prop' was added in version 'v1' but referencing type 'TestService.Original' added in version 'v2'.", - }); - }); - it("succeed if version are compatible in model", async () => { const diagnostics = await runner.diagnose(` @added(Versions.v2) From 341620b715caf94a25ff131b33c2e312d29ca12f Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:30:21 -0600 Subject: [PATCH 11/71] [http-client-csharp] Add Flatten api to MethodBodyStatement (#5254) This PR adds a Flatten method to the MethodBodyStatement class to aid in implementing visitors and iterate through all the statements in a method body. fixes: https://github.com/microsoft/typespec/issues/5017 --- .../src/Statements/MethodBodyStatement.cs | 23 ++++++++++++++ .../test/Statements/StatementTests.cs | 31 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs index b5403050ed..c170a7bed7 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs @@ -26,6 +26,29 @@ internal override void Write(CodeWriter writer) public string ToDisplayString() => GetDebuggerDisplay(); + public IEnumerable Flatten() + { + Queue queue = new(); + queue.Enqueue(this); + + while (queue.Count > 0) + { + MethodBodyStatement current = queue.Dequeue(); + + if (current is MethodBodyStatements statements) + { + foreach (var subStatement in statements.Statements) + { + queue.Enqueue(subStatement); + } + } + else + { + yield return current; + } + } + } + private string GetDebuggerDisplay() { using CodeWriter writer = new CodeWriter(); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs index efc1b1781f..ee3b2b26f6 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs @@ -488,5 +488,36 @@ public void TestIfElsePreprocessorStatement() var test = writer.ToString(false); Assert.AreEqual(expectedResult, test); } + + [Test] + public void TestFlatten() + { + var ifTrueStatement = new IfStatement(True) { Return(True) }; + var ifFalseStatement = new IfStatement(False) { Return(False) }; + var ifElseStatement = new IfElseStatement(True, new SingleLineCommentStatement("$hello"), new SingleLineCommentStatement("$world")); + MethodBodyStatement methodBodyStatements = new List + { + ifTrueStatement, + ifElseStatement, + ifFalseStatement + }; + + var flattened = methodBodyStatements.Flatten().ToList(); + Assert.AreEqual(3, flattened.Count); + Assert.AreEqual(ifTrueStatement, flattened[0]); + Assert.AreEqual(ifElseStatement, flattened[1]); + Assert.AreEqual(ifFalseStatement, flattened[2]); + + // Test flattening a single statement + var singleStatementFlattened = ifTrueStatement.Flatten().ToList(); + Assert.AreEqual(1, singleStatementFlattened.Count); + + // flatten the body + var body = ifTrueStatement.Body.Flatten().ToList(); + Assert.AreEqual(1, body.Count); + Assert.AreEqual(ifTrueStatement.Body.ToDisplayString(), body[0].ToDisplayString()); + } + + } } From a3e1c54950ab024b7941728b0cf9e15626af9c06 Mon Sep 17 00:00:00 2001 From: Jesse Squire Date: Wed, 4 Dec 2024 13:34:46 -0800 Subject: [PATCH 12/71] [EngSys] Update Package Version (#5267) # Summary The focus of these changes is to bump the `System.Memory.Data` to fix a transitive dependency on v8.0.0 of `System.Text.Json`, which has known vulnerabilities. This bump pulls the transitive dependency up to v8.0.5, matching the version used by direct references in the repository. ## References and resources - [System.Memory.Data v8.0.1](https://www.nuget.org/packages/System.Memory.Data/8.0.1#dependencies-body-tab) --- packages/http-client-csharp/generator/Packages.Data.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http-client-csharp/generator/Packages.Data.props b/packages/http-client-csharp/generator/Packages.Data.props index 0680a7a694..c0878fbc11 100644 --- a/packages/http-client-csharp/generator/Packages.Data.props +++ b/packages/http-client-csharp/generator/Packages.Data.props @@ -13,6 +13,6 @@ - + From a226a761205684366c33d99a59c5252fda0301de Mon Sep 17 00:00:00 2001 From: Allen Zhang Date: Wed, 4 Dec 2024 14:15:37 -0800 Subject: [PATCH 13/71] Add RegEx validation for @pattern decorator (#5252) ... and throw a warning for invalid regex string value. close #4128 --- ...zhang_ValidatePatternRegEx-2024-11-3-11-32-36.md | 7 +++++++ packages/compiler/src/core/messages.ts | 7 +++++++ packages/compiler/src/lib/decorators.ts | 8 ++++++++ .../compiler/test/decorators/decorators.test.ts | 13 +++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 .chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md diff --git a/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md b/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md new file mode 100644 index 0000000000..28de1e3a7d --- /dev/null +++ b/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/compiler" +--- + +Added RegEx validation for @pattern and will throw warning for invalid RegEx string \ No newline at end of file diff --git a/packages/compiler/src/core/messages.ts b/packages/compiler/src/core/messages.ts index 25ed32d076..a0b74d2d58 100644 --- a/packages/compiler/src/core/messages.ts +++ b/packages/compiler/src/core/messages.ts @@ -781,6 +781,13 @@ const diagnostics = { /** * Decorator */ + "invalid-pattern-regex": { + severity: "warning", + messages: { + default: "@pattern decorator expects a valid regular expression pattern.", + }, + }, + "decorator-wrong-target": { severity: "error", messages: { diff --git a/packages/compiler/src/lib/decorators.ts b/packages/compiler/src/lib/decorators.ts index 4440ddf759..40f15e7867 100644 --- a/packages/compiler/src/lib/decorators.ts +++ b/packages/compiler/src/lib/decorators.ts @@ -414,6 +414,14 @@ export const $pattern: PatternDecorator = ( return; } + try { + new RegExp(pattern); + } catch (e) { + reportDiagnostic(context.program, { + code: "invalid-pattern-regex", + target: target, + }); + } const patternData: PatternData = { pattern, validationMessage, diff --git a/packages/compiler/test/decorators/decorators.test.ts b/packages/compiler/test/decorators/decorators.test.ts index 9b640a7551..ab3bfc7e24 100644 --- a/packages/compiler/test/decorators/decorators.test.ts +++ b/packages/compiler/test/decorators/decorators.test.ts @@ -261,6 +261,19 @@ describe("compiler: built-in decorators", () => { }); }); + it("emit diagnostic if pattern is not a valid RegEx", async () => { + const diagnostics = await runner.diagnose(` + model A { + @pattern("[a-z") + prop: string; + } + `); + + expectDiagnostics(diagnostics, { + code: "invalid-pattern-regex", + }); + }); + it("optionally allows specifying a pattern validation message", async () => { const { A, B } = (await runner.compile( ` From 74a7abb392384b5bab8b671e77dde5cded5fd162 Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:06:20 -0600 Subject: [PATCH 14/71] [http-client-csharp] use recursion for statement flattening (#5268) contributes to https://github.com/microsoft/typespec/issues/5017 --- .../src/Statements/MethodBodyStatement.cs | 21 +++++--------- .../test/Statements/StatementTests.cs | 29 ++++++++++++++++++- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs index c170a7bed7..0dcc7065b5 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/MethodBodyStatement.cs @@ -28,24 +28,19 @@ internal override void Write(CodeWriter writer) public IEnumerable Flatten() { - Queue queue = new(); - queue.Enqueue(this); - - while (queue.Count > 0) + if (this is MethodBodyStatements statements) { - MethodBodyStatement current = queue.Dequeue(); - - if (current is MethodBodyStatements statements) + foreach (var statement in statements.Statements) { - foreach (var subStatement in statements.Statements) + foreach (var subStatement in statement.Flatten()) { - queue.Enqueue(subStatement); + yield return subStatement; } } - else - { - yield return current; - } + } + else + { + yield return this; } } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs index ee3b2b26f6..586643b348 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Statements/StatementTests.cs @@ -518,6 +518,33 @@ public void TestFlatten() Assert.AreEqual(ifTrueStatement.Body.ToDisplayString(), body[0].ToDisplayString()); } - + [Test] + public void TestFlatten_CorrectNestedOrder() + { + var statement1 = new IfStatement(True) { Return(True) }; + var statement2 = new IfStatement(False) { Return(False) }; + var nestedStatement1 = new IfStatement(False) { Return(Literal("Foo")) }; + var nestedStatement2 = new IfStatement(True) { Return(Literal("Bar")) }; + var methodBodyStatements = new MethodBodyStatements( + [ + statement1, + new MethodBodyStatements( + [ + nestedStatement1, + nestedStatement2 + ]), + statement2 + ]); + + var result = methodBodyStatements.Flatten(); + var expectedOrder = new List + { + statement1, + nestedStatement1, + nestedStatement2, + statement2 + }; + Assert.AreEqual(expectedOrder, result); + } } } From e9003b1a60c7059ba8670a179bae7d5fe3b38021 Mon Sep 17 00:00:00 2001 From: Christopher Radek <14189820+chrisradek@users.noreply.github.com> Date: Wed, 4 Dec 2024 20:53:53 -0800 Subject: [PATCH 15/71] Fix typeChangedFrom of template/union/tuple to catch invalid versioning (#5262) Fixes #4752 and replaces #5191 #5191 was the original attempt to fix this issue. However the implementation only worked if the current type of a `@typeChangedFrom` decorated property wasn't itself a template/union. This PR gets away from using `validateReference` like the previous PR did, and instead will recursively crawl the target type such that it visits any template args/union variants/tuple members, checking if each sub-type available for the version being validated. Edit: Here is an example illustrating the issue introduced in #5191: [playground](https://cadlplayground.z22.web.core.windows.net/prs/5191/?c=aW1wb3J0ICJAdHlwZXNwZWMvdmVyc2lvbmluZyI7DQoNCnVzaW5nIFR5cGVTcGVjLlbJH8UeQMcvZWQoxxpzKQ0KQHNlcnZpY2UNCm5hbWVzcGFjZSBEZW1vU8YXxTplbnVtIMg0IHsNCiAgdjEsxQcyLA0KfcVeYWRky1oudjEpDQptb2RlbCBPcmlnaW5hbCB71ioyySpVcGRhdGVkxynGFEJhcsZz5QD4Q2hhbmdlZEZyb23MQizJZVtdKcQtZmFpbHM6yFFbXeUAyN9E0ERwYXNzZcpFO%2BcA6g%3D%3D&e=%40typespec%2Fopenapi3&options=%7B%7D) --------- Co-authored-by: Christopher Radek --- ...sioning-typechangeof-2024-11-3-22-56-22.md | 6 + ...rsioning-typechangeof-2024-11-3-22-56-4.md | 7 + packages/versioning/src/validate.ts | 69 ++++++-- .../test/incompatible-versioning.test.ts | 154 ++++++++++++++++++ packages/versioning/test/versioning.test.ts | 127 +++++++++++++++ 5 files changed, 350 insertions(+), 13 deletions(-) create mode 100644 .chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md create mode 100644 .chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md diff --git a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md new file mode 100644 index 0000000000..65426bb013 --- /dev/null +++ b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md @@ -0,0 +1,6 @@ +--- +changeKind: internal +packages: + - "@typespec/versioning" +--- + diff --git a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md new file mode 100644 index 0000000000..463f4eb094 --- /dev/null +++ b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/versioning" +--- + +Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template, union, or tuple. \ No newline at end of file diff --git a/packages/versioning/src/validate.ts b/packages/versioning/src/validate.ts index bfce834dba..b96e53eeb3 100644 --- a/packages/versioning/src/validate.ts +++ b/packages/versioning/src/validate.ts @@ -223,21 +223,64 @@ function validateMultiTypeReference(program: Program, source: Type, options?: Ty if (versionTypeMap === undefined) return; for (const [version, type] of versionTypeMap!) { if (type === undefined) continue; + validateTypeAvailability(program, version, type, source, options); + } +} + +/** + * Ensures that a type is available in a given version. + * For types that may wrap other types, e.g. unions, tuples, or template instances, + * this function will recursively check the wrapped types. + */ +function validateTypeAvailability( + program: Program, + version: Version, + targetType: Type, + source: Type, + options?: TypeNameOptions, +) { + const typesToCheck: Type[] = [targetType]; + while (typesToCheck.length) { + const type = typesToCheck.pop()!; const availMap = getAvailabilityMap(program, type); - const availability = availMap?.get(version.name) ?? Availability.Available; - if ([Availability.Added, Availability.Available].includes(availability)) { - continue; + const availability = availMap?.get(version?.name) ?? Availability.Available; + if (![Availability.Added, Availability.Available].includes(availability)) { + reportDiagnostic(program, { + code: "incompatible-versioned-reference", + messageId: "doesNotExist", + format: { + sourceName: getTypeName(source, options), + targetName: getTypeName(type, options), + version: prettyVersion(version), + }, + target: source, + }); + } + + if (isTemplateInstance(type)) { + for (const arg of type.templateMapper.args) { + if (isType(arg)) { + typesToCheck.push(arg); + } + } + } else if (type.kind === "Union") { + for (const variant of type.variants.values()) { + if (type.expression) { + // Union expressions don't have decorators applied, + // so we need to check the type directly. + typesToCheck.push(variant.type); + } else { + // Named unions can have decorators applied, + // so we need to check that the variant type is valid + // for whatever decoration the variant has. + validateTargetVersionCompatible(program, variant, variant.type); + } + } + } else if (type.kind === "Tuple") { + for (const value of type.values) { + typesToCheck.push(value); + } } - reportDiagnostic(program, { - code: "incompatible-versioned-reference", - messageId: "doesNotExist", - format: { - sourceName: getTypeName(source, options), - targetName: getTypeName(type, options), - version: prettyVersion(version), - }, - target: source, - }); } } diff --git a/packages/versioning/test/incompatible-versioning.test.ts b/packages/versioning/test/incompatible-versioning.test.ts index dd8159d34b..9469888f5a 100644 --- a/packages/versioning/test/incompatible-versioning.test.ts +++ b/packages/versioning/test/incompatible-versioning.test.ts @@ -387,6 +387,160 @@ describe("versioning: validate incompatible references", () => { }); }); + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in arrays", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Original[]) + prop: Updated[]; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' is referencing type 'TestService.Original' which does not exist in version 'v1'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in records", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Record) + prop: Record; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' is referencing type 'TestService.Original' which does not exist in version 'v1'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in unions", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, Original | string) + prop: Updated; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' is referencing type 'TestService.Original' which does not exist in version 'v1'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in named unions", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + union InvalidUnion { + string, + Updated, + } + + @test + model Test { + @typeChangedFrom(Versions.v2, InvalidUnion) + prop: string; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Updated' is referencing versioned type 'TestService.Updated' but is not versioned itself.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in tuples", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, [Original, string]) + prop: [Updated, string]; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' is referencing type 'TestService.Original' which does not exist in version 'v1'.", + }); + }); + + it("emit diagnostic when using @typeChangedFrom with a type parameter that does not yet exist in template", async () => { + const diagnostics = await runner.diagnose(` + @test + @added(Versions.v2) + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + model Template { + prop: T; + } + + @test + model Test { + @typeChangedFrom(Versions.v2, Template) + prop: Template; + } + `); + expectDiagnostics(diagnostics, { + code: "@typespec/versioning/incompatible-versioned-reference", + severity: "error", + message: + "'TestService.Test.prop' is referencing type 'TestService.Original' which does not exist in version 'v1'.", + }); + }); + it("succeed if version are compatible in model", async () => { const diagnostics = await runner.diagnose(` @added(Versions.v2) diff --git a/packages/versioning/test/versioning.test.ts b/packages/versioning/test/versioning.test.ts index bfc145495c..688fd9ffb2 100644 --- a/packages/versioning/test/versioning.test.ts +++ b/packages/versioning/test/versioning.test.ts @@ -9,6 +9,7 @@ import { type Program, type ProjectionApplication, type Scalar, + type Tuple, type Type, type Union, } from "@typespec/compiler"; @@ -553,6 +554,132 @@ describe("versioning: logic", () => { ok((v3.properties.get("prop")!.type as Model).name === "Updated"); }); + it("can change template arg types to versioned models", async () => { + const { + projections: [v1, v2, v3], + } = await versionedModel( + ["v1", "v2", "v3"], + ` + @test + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @added(Versions.v2) + @typeChangedFrom(Versions.v3, Original[]) + prop: Updated[]; + } + `, + ); + + ok(v1.properties.get("prop") === undefined); + + const propV2 = v2.properties.get("prop")!.type as Model; + const propV3 = v3.properties.get("prop")!.type as Model; + ok(propV2.name === "Array"); + ok((propV2.indexer!.value as Model).name === "Original"); + ok(propV3.name === "Array"); + ok((propV3.indexer!.value as Model).name === "Updated"); + }); + + it("can change types to versioned unions", async () => { + const { + projections: [v1, v2, v3], + } = await versionedModel( + ["v1", "v2", "v3"], + ` + @test + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + union TemporaryUnion { + string, + + @added(Versions.v2) + Updated, + } + + @test + model Test { + @typeChangedFrom(Versions.v3, TemporaryUnion) + prop: string | Updated; + } + `, + ); + + const propV1 = v1.properties.get("prop")!.type as Union; + const propV2 = v2.properties.get("prop")!.type as Union; + const propV3 = v3.properties.get("prop")!.type as Union; + ok(propV1.name === "TemporaryUnion"); + ok(propV2.name === "TemporaryUnion"); + ok(propV3.expression); + ok([...propV3.variants.values()].find((v) => (v.type as Model)?.name === "Updated")); + }); + + it("can change types to versioned tuples", async () => { + const { + projections: [v1, v2], + } = await versionedModel( + ["v1", "v2"], + ` + @test + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, [Original]) + prop: [Updated]; + } + `, + ); + + const propV1 = v1.properties.get("prop")!.type as Tuple; + const propV2 = v2.properties.get("prop")!.type as Tuple; + ok((propV1.values[0] as Model).name === "Original"); + ok((propV2.values[0] as Model).name === "Updated"); + }); + + it("can change types to versioned union expressions", async () => { + const { + projections: [v1, v2], + } = await versionedModel( + ["v1", "v2"], + ` + @test + model Original {} + + @test + @added(Versions.v2) + model Updated {} + + @test + model Test { + @typeChangedFrom(Versions.v2, string | Original) + prop: string | Updated; + } + `, + ); + + const propV1 = v1.properties.get("prop")!.type as Union; + const propV2 = v2.properties.get("prop")!.type as Union; + ok(propV1.expression); + ok(propV2.expression); + ok([...propV1.variants.values()].find((v) => (v.type as Model)?.name === "Original")); + ok([...propV2.variants.values()].find((v) => (v.type as Model)?.name === "Updated")); + }); + it("can change type over multiple versions", async () => { const { projections: [v1, v2, v3], From df30aca735b7a231ec5c7cfbd2392c00805297e1 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 5 Dec 2024 19:42:19 +0800 Subject: [PATCH 16/71] http-client-java, generate error model for unbranded (#5209) fix https://github.com/Azure/autorest.java/issues/2991 --- .../emitter/src/code-model-builder.ts | 6 +++ .../http-client-java/emitter/src/emitter.ts | 11 +----- .../core/mapper/ProxyMethodMapper.java | 11 ++++-- .../core/model/clientmodel/ClassType.java | 4 ++ .../core/model/clientmodel/ProxyMethod.java | 19 ++++++++++ .../core/template/ExceptionTemplate.java | 3 +- .../core/template/ProxyTemplate.java | 37 +++++++++++++++---- .../generator/core/util/ClientModelUtil.java | 8 ++++ .../http/client/generator/TypeSpecPlugin.java | 1 + .../http/client/generator/util/ModelUtil.java | 11 +----- 10 files changed, 79 insertions(+), 32 deletions(-) diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index 1940dcf5b2..eb89d1722f 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -1764,6 +1764,12 @@ export class CodeModelBuilder { if (response instanceof SchemaResponse) { this.trackSchemaUsage(response.schema, { usage: [SchemaContext.Exception] }); + + if (trackConvenienceApi && !this.isBranded()) { + this.trackSchemaUsage(response.schema, { + usage: [op.internalApi ? SchemaContext.Internal : SchemaContext.Public], + }); + } } } else { op.addResponse(response); diff --git a/packages/http-client-java/emitter/src/emitter.ts b/packages/http-client-java/emitter/src/emitter.ts index c2061b0e47..8aef1d72d4 100644 --- a/packages/http-client-java/emitter/src/emitter.ts +++ b/packages/http-client-java/emitter/src/emitter.ts @@ -3,7 +3,6 @@ import { EmitContext, getNormalizedAbsolutePath, JSONSchemaType, - NoTarget, resolvePath, } from "@typespec/compiler"; import { spawn } from "child_process"; @@ -227,15 +226,7 @@ export async function $onEmit(context: EmitContext) { // program.trace("http-client-java", output.stdout ? output.stdout : output.stderr); } catch (error: any) { if (error && "code" in error && error["code"] === "ENOENT") { - const msg = "'java' is not on PATH. Please install JDK 11 or above."; - program.trace("http-client-java", msg); - program.reportDiagnostic({ - code: "http-client-java", - severity: "error", - message: msg, - target: NoTarget, - }); - logError(program, msg); + logError(program, "'java' is not on PATH. Please install JDK 11 or above."); } else { logError(program, error.message); } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java index e81610faf5..10cb481dc8 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ProxyMethodMapper.java @@ -36,6 +36,7 @@ import java.util.Locale; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; @@ -500,7 +501,7 @@ protected void buildUnexpectedResponseExceptionTypes(ProxyMethod.Builder builder // Initialize the merged map with the Swagger defined configurations so that the settings configurations // overrides it. Map mergedExceptionTypeMapping - = new HashMap<>(swaggerExceptionDefinitions.exceptionTypeMapping); + = new TreeMap<>(swaggerExceptionDefinitions.exceptionTypeMapping); mergedExceptionTypeMapping.putAll(settingsExceptionTypeMap); // remove expected status codes @@ -532,7 +533,7 @@ private SwaggerExceptionDefinitions getSwaggerExceptionDefinitions(Operation ope ClassType swaggerDefaultExceptionType = null; Map swaggerExceptionTypeMap = new HashMap<>(); - if (settings.isDataPlaneClient()) { + if (settings.isDataPlaneClient() && settings.isBranded()) { // LLC does not use model, hence exception from swagger swaggerDefaultExceptionType = ClassType.HTTP_RESPONSE_EXCEPTION; exceptionDefinitions.defaultExceptionType = swaggerDefaultExceptionType; @@ -559,7 +560,7 @@ private SwaggerExceptionDefinitions getSwaggerExceptionDefinitions(Operation ope ClassType exceptionType = getExceptionType(exception, settings); statusCodes.stream() .map(Integer::parseInt) - .forEach(status -> swaggerExceptionTypeMap.put(status, exceptionType)); + .forEach(status -> swaggerExceptionTypeMap.putIfAbsent(status, exceptionType)); isDefaultError = false; } catch (NumberFormatException ex) { @@ -574,8 +575,10 @@ private SwaggerExceptionDefinitions getSwaggerExceptionDefinitions(Operation ope } } - if (swaggerDefaultExceptionType == null && !CoreUtils.isNullOrEmpty(operation.getExceptions()) // m4 could return Response without schema, when the Swagger uses e.g. "produces: [ application/x-rdp ]" + if (swaggerDefaultExceptionType == null + && settings.isBranded() + && !CoreUtils.isNullOrEmpty(operation.getExceptions()) && operation.getExceptions().get(0).getSchema() != null) { // no default error, use the 1st to keep backward compatibility swaggerDefaultExceptionType = processExceptionClassType( diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java index a04f6fedb2..3eb82508c0 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java @@ -22,6 +22,7 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpRequest; +import com.azure.core.http.HttpResponse; import com.azure.core.http.MatchConditions; import com.azure.core.http.ProxyOptions; import com.azure.core.http.RequestConditions; @@ -126,6 +127,8 @@ public String getGenericClass() { put(HttpHeaderName.class, new ClassDetails(HttpHeaderName.class, "io.clientcore.core.http.models.HttpHeaderName")); put(HttpRequest.class, new ClassDetails(HttpRequest.class, "io.clientcore.core.http.models.HttpRequest")); + put(HttpResponse.class, + new ClassDetails(HttpResponse.class, "io.clientcore.core.http.models.HttpResponse")); put(RequestOptions.class, new ClassDetails(RequestOptions.class, "io.clientcore.core.http.models.RequestOptions")); put(BinaryData.class, new ClassDetails(BinaryData.class, "io.clientcore.core.util.binarydata.BinaryData")); @@ -516,6 +519,7 @@ private static ClassType.Builder getClassTypeBuilder(Class classKey) { public static final ClassType HTTP_REQUEST = getClassTypeBuilder(HttpRequest.class).build(); public static final ClassType HTTP_HEADERS = getClassTypeBuilder(HttpHeaders.class).build(); public static final ClassType HTTP_HEADER_NAME = getClassTypeBuilder(HttpHeaderName.class).build(); + public static final ClassType HTTP_RESPONSE = getClassTypeBuilder(HttpResponse.class).build(); // Java exception types public static final ClassType HTTP_RESPONSE_EXCEPTION = getClassTypeBuilder(HttpResponseException.class).build(); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ProxyMethod.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ProxyMethod.java index 1db1158751..004374bed8 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ProxyMethod.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ProxyMethod.java @@ -7,6 +7,7 @@ import com.azure.core.http.HttpMethod; import com.microsoft.typespec.http.client.generator.core.extension.base.util.HttpExceptionType; import com.microsoft.typespec.http.client.generator.core.extension.plugin.JavaSettings; +import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; import com.microsoft.typespec.http.client.generator.core.util.CodeNamer; import com.microsoft.typespec.http.client.generator.core.util.MethodNamer; import java.util.List; @@ -382,15 +383,33 @@ private IType mapToSyncType(IType type) { public void addImportsTo(Set imports, boolean includeImplementationImports, JavaSettings settings) { Annotation.HTTP_REQUEST_INFORMATION.addImportsTo(imports); Annotation.UNEXPECTED_RESPONSE_EXCEPTION_INFORMATION.addImportsTo(imports); + ClassType.HTTP_RESPONSE_EXCEPTION.addImportsTo(imports, false); if (includeImplementationImports) { if (getUnexpectedResponseExceptionType() != null) { Annotation.UNEXPECTED_RESPONSE_EXCEPTION_TYPE.addImportsTo(imports); getUnexpectedResponseExceptionType().addImportsTo(imports, includeImplementationImports); + + if (!settings.isBranded()) { + ClientModel errorModel + = ClientModelUtil.getErrorModelFromException(getUnexpectedResponseExceptionType()); + if (errorModel != null) { + errorModel.addImportsTo(imports, settings); + } + } } if (getUnexpectedResponseExceptionTypes() != null) { Annotation.UNEXPECTED_RESPONSE_EXCEPTION_TYPE.addImportsTo(imports); getUnexpectedResponseExceptionTypes().keySet() .forEach(e -> e.addImportsTo(imports, includeImplementationImports)); + + if (!settings.isBranded()) { + for (ClassType exceptionType : getUnexpectedResponseExceptionTypes().keySet()) { + ClientModel errorModel = ClientModelUtil.getErrorModelFromException(exceptionType); + if (errorModel != null) { + errorModel.addImportsTo(imports, settings); + } + } + } } if (isResumable()) { imports.add("com.azure.core.annotation.ResumeOperation"); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ExceptionTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ExceptionTemplate.java index a193aa0e8e..3eaf64c1aa 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ExceptionTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ExceptionTemplate.java @@ -3,6 +3,7 @@ package com.microsoft.typespec.http.client.generator.core.template; +import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClassType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientException; import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaFile; import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaJavadocComment; @@ -69,6 +70,6 @@ public final void write(ClientException exception, JavaFile javaFile) { } protected String getHttpResponseImport() { - return "com.azure.core.http.HttpResponse"; + return ClassType.HTTP_RESPONSE.getFullName(); } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java index 9cf90bf229..d50625f68c 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java @@ -7,6 +7,7 @@ import com.microsoft.typespec.http.client.generator.core.extension.model.codemodel.RequestParameterLocation; import com.microsoft.typespec.http.client.generator.core.extension.plugin.JavaSettings; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClassType; +import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientModel; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.IType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.Proxy; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ProxyMethod; @@ -14,6 +15,7 @@ import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaClass; import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaInterface; import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaVisibility; +import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; import com.microsoft.typespec.http.client.generator.core.util.CodeNamer; import java.util.ArrayList; import java.util.List; @@ -94,7 +96,7 @@ public final void write(Proxy restAPI, JavaClass classBlock) { } } - if (!settings.isDataPlaneClient() || isExceptionCustomized()) { + if (!settings.isDataPlaneClient() || !settings.isBranded() || isExceptionCustomized()) { // write @UnexpectedResponseExceptionType if (restAPIMethod.getUnexpectedResponseExceptionTypes() != null) { @@ -198,11 +200,21 @@ protected void writeUnexpectedExceptions(ProxyMethod restAPIMethod, JavaInterfac exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(", ")))); } } else { - for (Map.Entry> exception : restAPIMethod.getUnexpectedResponseExceptionTypes() - .entrySet()) { - interfaceBlock.annotation("UnexpectedResponseExceptionDetail(exceptionTypeName = \"" - + restAPIMethod.getHttpExceptionType(exception.getKey()).toString() + "\", statusCode = {" - + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) + " })"); + if (JavaSettings.getInstance().isUseDefaultHttpStatusCodeToExceptionTypeMapping()) { + for (Map.Entry> exception : restAPIMethod.getUnexpectedResponseExceptionTypes() + .entrySet()) { + interfaceBlock.annotation("UnexpectedResponseExceptionDetail(exceptionTypeName = \"" + + restAPIMethod.getHttpExceptionType(exception.getKey()).toString() + "\", statusCode = {" + + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) + " })"); + } + } else { + for (Map.Entry> exception : restAPIMethod.getUnexpectedResponseExceptionTypes() + .entrySet()) { + ClientModel errorModel = ClientModelUtil.getErrorModelFromException(exception.getKey()); + interfaceBlock.annotation("UnexpectedResponseExceptionDetail(statusCode = {" + + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) + + " }, exceptionBodyClass = " + errorModel.getName() + ".class)"); + } } } } @@ -212,7 +224,18 @@ protected void writeSingleUnexpectedException(ProxyMethod restAPIMethod, JavaInt interfaceBlock.annotation(String.format("UnexpectedResponseExceptionType(%1$s.class)", restAPIMethod.getUnexpectedResponseExceptionType())); } else { - interfaceBlock.annotation("UnexpectedResponseExceptionDetail"); + if (JavaSettings.getInstance().isUseDefaultHttpStatusCodeToExceptionTypeMapping()) { + interfaceBlock.annotation("UnexpectedResponseExceptionDetail"); + } else { + ClientModel errorModel + = ClientModelUtil.getErrorModelFromException(restAPIMethod.getUnexpectedResponseExceptionType()); + if (errorModel != null) { + interfaceBlock.annotation( + "UnexpectedResponseExceptionDetail(exceptionBodyClass = " + errorModel.getName() + ".class)"); + } else { + interfaceBlock.annotation("UnexpectedResponseExceptionDetail"); + } + } } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java index 0e1ff7943b..6df46e1d80 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java @@ -891,6 +891,14 @@ public static boolean isMultipartModel(ClientModel model) { return model.getSerializationFormats().contains(KnownMediaType.MULTIPART.value()); } + public static ClientModel getErrorModelFromException(ClassType exceptionType) { + String errorBodyClassName = exceptionType.getName(); + if (errorBodyClassName.endsWith("Exception")) { + errorBodyClassName = errorBodyClassName.substring(0, errorBodyClassName.length() - "Exception".length()); + } + return ClientModels.getInstance().getModel(errorBodyClassName); + } + private static boolean hasNoUsage(ClientModel model) { ImplementationDetails details = model.getImplementationDetails(); return details == null || CoreUtils.isNullOrEmpty(details.getUsages()); diff --git a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java index ebe658c2fa..424b478490 100644 --- a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java +++ b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/TypeSpecPlugin.java @@ -294,6 +294,7 @@ public TypeSpecPlugin(EmitterOptions options, boolean sdkIntegration) { SETTINGS_MAP.put("license-header", "SMALL_TYPESPEC"); SETTINGS_MAP.put("sync-methods", "sync-only"); + SETTINGS_MAP.put("use-default-http-status-code-to-exception-type-mapping", false); SETTINGS_MAP.put("generate-samples", false); SETTINGS_MAP.put("generate-tests", false); } diff --git a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/util/ModelUtil.java b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/util/ModelUtil.java index c5b0cad51a..c13e10621c 100644 --- a/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/util/ModelUtil.java +++ b/packages/http-client-java/generator/http-client-generator/src/main/java/com/microsoft/typespec/http/client/generator/util/ModelUtil.java @@ -17,15 +17,13 @@ public class ModelUtil { public static boolean isGeneratingModel(ClientModel model) { return model.getImplementationDetails() != null && (model.getImplementationDetails().isPublic() || model.getImplementationDetails().isInternal()) - && !(isModelUsedOnlyInException(model.getImplementationDetails())) && !(isExternalModel(model.getImplementationDetails())) && !(isPagedModel(model.getImplementationDetails())); } public static boolean isGeneratingModel(EnumType model) { return model.getImplementationDetails() != null - && (model.getImplementationDetails().isPublic() || model.getImplementationDetails().isInternal()) - && !(isModelUsedOnlyInException(model.getImplementationDetails())); + && (model.getImplementationDetails().isPublic() || model.getImplementationDetails().isInternal()); } public static boolean isGeneratingModel(ClientResponse response) { @@ -44,16 +42,9 @@ public static boolean isGeneratingModel(ClientResponse response) { public static boolean isGeneratingModel(UnionModel model) { return model.getImplementationDetails() != null && (model.getImplementationDetails().isPublic() || model.getImplementationDetails().isInternal()) - && !(isModelUsedOnlyInException(model.getImplementationDetails())) && !(isExternalModel(model.getImplementationDetails())); } - private static boolean isModelUsedOnlyInException(ImplementationDetails implementationDetails) { - return (implementationDetails.isException() - && !implementationDetails.isInput() - && !implementationDetails.isOutput()); - } - private static boolean isPagedModel(ImplementationDetails implementationDetails) { return (implementationDetails.getUsages() != null && implementationDetails.getUsages().contains(ImplementationDetails.Usage.PAGED)); From f332203fbdbb351c85541988adbafc549e1f7b0b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Thu, 5 Dec 2024 20:23:24 +0800 Subject: [PATCH 17/71] http-client-java, do not generate model under models sub package, for unbranded (#5269) also bump TCGC output ![image](https://github.com/user-attachments/assets/72071b8c-a412-4c36-b993-931f4fe06394) --- .../core/extension/plugin/JavaSettings.java | 17 ++++++++++++----- .../http-client-generator-test/package.json | 4 ++-- packages/http-client-java/package-lock.json | 15 +++++++-------- packages/http-client-java/package.json | 6 +++--- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java index 8587bc30cf..00398cb2cc 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java @@ -108,7 +108,10 @@ public static JavaSettings getInstance() { logger.debug("List of require : {}", autorestSettings.getRequire()); } - String fluent = getStringValue(host, "fluent"); + final String fluent = getStringValue(host, "fluent"); + + final String flavor = getStringValue(host, "flavor", "azure"); + final String defaultModelsSubPackageName = isBranded(flavor) ? "models" : ""; setHeader(getStringValue(host, "license-header")); instance = new JavaSettings(autorestSettings, @@ -120,8 +123,8 @@ public static JavaSettings getInstance() { getBooleanValue(host, "generate-client-interfaces", false), getBooleanValue(host, "generate-client-as-impl", false), getStringValue(host, "implementation-subpackage", "implementation"), - getStringValue(host, "models-subpackage", "models"), getStringValue(host, "custom-types", ""), - getStringValue(host, "custom-types-subpackage", ""), + getStringValue(host, "models-subpackage", defaultModelsSubPackageName), + getStringValue(host, "custom-types", ""), getStringValue(host, "custom-types-subpackage", ""), getStringValue(host, "fluent-subpackage", "fluent"), getBooleanValue(host, "required-parameter-client-methods", false), getBooleanValue(host, "generate-sync-async-clients", false), @@ -163,7 +166,7 @@ public static JavaSettings getInstance() { getBooleanValue(host, "disable-required-property-annotation", false), getBooleanValue(host, "enable-page-size", false), getBooleanValue(host, "use-key-credential", false), getBooleanValue(host, "null-byte-array-maps-to-empty-array", false), - getBooleanValue(host, "graal-vm-config", false), getStringValue(host, "flavor", "Azure"), + getBooleanValue(host, "graal-vm-config", false), flavor, getBooleanValue(host, "disable-typed-headers-methods", false), getBooleanValue(host, "share-jsonserializable-code", false), getBooleanValue(host, "use-object-for-unknown", false), getBooleanValue(host, "android", false)); @@ -402,7 +405,11 @@ private JavaSettings(AutorestSettings autorestSettings, Map mode * @return Whether to generate with Azure branding. */ public boolean isBranded() { - return "azure".equalsIgnoreCase(this.flavor); + return isBranded(this.flavor); + } + + private static boolean isBranded(String flavor) { + return "azure".equalsIgnoreCase(flavor); } private final String keyCredentialHeaderName; diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json index cd83e88b41..3e5c8eb1a9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-test/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@azure-tools/cadl-ranch-specs": "0.39.4", - "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.2.tgz", + "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.3.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { @@ -24,7 +24,7 @@ "@typespec/openapi": "~0.62.0", "@typespec/xml": "~0.62.0", "@azure-tools/typespec-azure-core": "~0.48.0", - "@azure-tools/typespec-client-generator-core": "~0.48.3", + "@azure-tools/typespec-client-generator-core": "~0.48.4", "@azure-tools/typespec-azure-resource-manager": "~0.48.0", "@azure-tools/typespec-autorest": "~0.48.0" }, diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index e9e2e54d1d..418aa3f8af 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-java", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-java", - "version": "0.1.2", + "version": "0.1.3", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", @@ -20,7 +20,7 @@ "@azure-tools/typespec-azure-core": "0.48.0", "@azure-tools/typespec-azure-resource-manager": "0.48.0", "@azure-tools/typespec-azure-rulesets": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.3", + "@azure-tools/typespec-client-generator-core": "0.48.4", "@microsoft/api-extractor": "^7.47.11", "@microsoft/api-extractor-model": "^7.29.8", "@types/js-yaml": "~4.0.9", @@ -44,7 +44,7 @@ "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.3 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.48.4 <1.0.0", "@typespec/compiler": ">=0.62.0 <1.0.0", "@typespec/http": ">=0.62.0 <1.0.0", "@typespec/openapi": ">=0.62.0 <1.0.0", @@ -289,11 +289,10 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.3", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.3.tgz", - "integrity": "sha512-EWyET1EXCee6TYfxway57L+SQdQurRZ8NuOWgenRjQf/Ja/0+Ht3IYfbFoqIYS2+/uFpLeotYCd4hUPjsW0Jwg==", + "version": "0.48.4", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz", + "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==", "dev": true, - "license": "MIT", "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json index e0954ed289..db6dd58669 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-java", - "version": "0.1.2", + "version": "0.1.3", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec" @@ -44,7 +44,7 @@ "peerDependencies": { "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.3 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.48.4 <1.0.0", "@typespec/compiler": ">=0.62.0 <1.0.0", "@typespec/http": ">=0.62.0 <1.0.0", "@typespec/openapi": ">=0.62.0 <1.0.0", @@ -63,7 +63,7 @@ "@azure-tools/typespec-azure-core": "0.48.0", "@azure-tools/typespec-azure-resource-manager": "0.48.0", "@azure-tools/typespec-azure-rulesets": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.3", + "@azure-tools/typespec-client-generator-core": "0.48.4", "@microsoft/api-extractor": "^7.47.11", "@microsoft/api-extractor-model": "^7.29.8", "@types/js-yaml": "~4.0.9", From dddf9c7c7c65dd17ddb3994f9aa9d59bc95c7aef Mon Sep 17 00:00:00 2001 From: Mike Harder Date: Thu, 5 Dec 2024 11:15:55 -0800 Subject: [PATCH 18/71] [openapi3] Add missing peer dependency "openapi-types" (#5274) Fixes warnings (or potentially errors) when installing `@typespec/openapi3`: ``` $ npx yarn add @typespec/openapi3@0.62.0 yarn add v1.22.22 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... warning " > @typespec/openapi3@0.62.0" has unmet peer dependency "@typespec/compiler@~0.62.0". warning " > @typespec/openapi3@0.62.0" has unmet peer dependency "@typespec/http@~0.62.0". warning " > @typespec/openapi3@0.62.0" has unmet peer dependency "@typespec/versioning@~0.62.0". warning " > @typespec/openapi3@0.62.0" has unmet peer dependency "@typespec/openapi@~0.62.0". warning "@typespec/openapi3 > @readme/openapi-parser@2.6.0" has unmet peer dependency "openapi-types@>=7". ``` The first 4 warnings are expected, but the peer dependency on `openapi-types` should either be satisfied by `@typespec/openapi3` itself, or be declared as a peer dependency of `@typespec/openapi3` itself. --- .../openapi3-peer-2024-11-5-18-44-45.md | 7 ++ packages/openapi3/package.json | 1 + pnpm-lock.yaml | 65 ++++++++++--------- 3 files changed, 42 insertions(+), 31 deletions(-) create mode 100644 .chronus/changes/openapi3-peer-2024-11-5-18-44-45.md diff --git a/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md b/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md new file mode 100644 index 0000000000..d6e39adaf3 --- /dev/null +++ b/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/openapi3" +--- + +Added missing peer dependency "openapi-types" \ No newline at end of file diff --git a/packages/openapi3/package.json b/packages/openapi3/package.json index 985e94510c..ddc25e531b 100644 --- a/packages/openapi3/package.json +++ b/packages/openapi3/package.json @@ -59,6 +59,7 @@ ], "dependencies": { "@readme/openapi-parser": "~2.6.0", + "openapi-types": "~12.1.3", "yaml": "~2.5.1" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ed5f8e078..07ece0d799 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ importers: version: 22.7.9 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) c8: specifier: ^10.1.2 version: 10.1.2 @@ -67,7 +67,7 @@ importers: version: 56.0.1(eslint@9.15.0(jiti@1.21.6)) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5) micromatch: specifier: ^4.0.8 version: 4.0.8 @@ -151,7 +151,7 @@ importers: version: link:../compiler '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -200,7 +200,7 @@ importers: version: 7.5.8 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -258,7 +258,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -346,7 +346,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -398,7 +398,7 @@ importers: version: 8.15.0 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -434,7 +434,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -504,7 +504,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -549,7 +549,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -598,7 +598,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -712,7 +712,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -755,7 +755,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -788,7 +788,7 @@ importers: version: link:../compiler '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -816,7 +816,7 @@ importers: version: 22.7.9 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -858,7 +858,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -880,6 +880,9 @@ importers: '@readme/openapi-parser': specifier: ~2.6.0 version: 2.6.0(openapi-types@12.1.3) + openapi-types: + specifier: ~12.1.3 + version: 12.1.3 yaml: specifier: ~2.5.1 version: 2.5.1 @@ -916,7 +919,7 @@ importers: version: link:../xml '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1158,7 +1161,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1234,7 +1237,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1295,7 +1298,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1340,7 +1343,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1410,7 +1413,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1504,7 +1507,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1726,7 +1729,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1759,7 +1762,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1827,7 +1830,7 @@ importers: version: link:../prettier-plugin-typespec '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1890,7 +1893,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1938,7 +1941,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1971,7 +1974,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) + version: 2.1.5(vitest@2.1.5) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -16368,7 +16371,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/coverage-v8@2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0))': + '@vitest/coverage-v8@2.1.5(vitest@2.1.5)': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -18547,7 +18550,7 @@ snapshots: semver: 7.6.3 strip-indent: 3.0.0 - eslint-plugin-vitest@0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)): + eslint-plugin-vitest@0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3) eslint: 9.15.0(jiti@1.21.6) From fc51b1f0db8b6e014f3344eea52323e8270d62bd Mon Sep 17 00:00:00 2001 From: Will Temple Date: Thu, 5 Dec 2024 17:14:03 -0500 Subject: [PATCH 19/71] [http-server-javascript] Two small correctness fixes (#5253) This fixes two issues that showed up in the widget and petstore REST examples. - Required query parameters were being detected as missing if their value was not exactly `null`. This PR changes this to a falsiness test. - Checking literal range-constrained properties in type differentiation could try to use a property without proving its presence. This PR adds an `in` check to that logic so that range-constrained properties have the same guard that literal-valued properties do. --------- Co-authored-by: Will Temple --- ...hsj-additional-guard-in-2024-11-3-13-53-46.md | 7 +++++++ ...hsj-additional-guard-in-2024-11-3-14-29-16.md | 7 +++++++ .../src/http/server/index.ts | 2 +- .../src/util/differentiate.ts | 16 +++++++++++++--- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md create mode 100644 .chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md diff --git a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md new file mode 100644 index 0000000000..055349a9b8 --- /dev/null +++ b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-server-javascript" +--- + +Added an additional check for the presence of a property before performing a bounds check on integer properties constrained to a range. \ No newline at end of file diff --git a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md new file mode 100644 index 0000000000..b3aab707a6 --- /dev/null +++ b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-server-javascript" +--- + +Fixed a null check in query parameter requiredness check by replacing it with a falseness check. diff --git a/packages/http-server-javascript/src/http/server/index.ts b/packages/http-server-javascript/src/http/server/index.ts index 74f0e3323a..5918ef8caf 100644 --- a/packages/http-server-javascript/src/http/server/index.ts +++ b/packages/http-server-javascript/src/http/server/index.ts @@ -453,7 +453,7 @@ function* emitQueryParamBinding( yield `const ${nameCase.camelCase} = __query_params.get(${JSON.stringify(parameter.name)}) ?? undefined;`; if (!parameter.param.optional) { - yield `if (${nameCase.camelCase} === null) {`; + yield `if (!${nameCase.camelCase}) {`; // prettier-ignore yield ` throw new Error("Invalid request: missing required query parameter '${parameter.name}'.");`; yield "}"; diff --git a/packages/http-server-javascript/src/util/differentiate.ts b/packages/http-server-javascript/src/util/differentiate.ts index dc886d63f4..b42b3cce43 100644 --- a/packages/http-server-javascript/src/util/differentiate.ts +++ b/packages/http-server-javascript/src/util/differentiate.ts @@ -742,9 +742,19 @@ export function differentiateModelTypes( branches.push({ condition: { - kind: "in-range", - expr: { kind: "model-property", property }, - range, + kind: "binary-op", + left: { + kind: "binary-op", + left: { kind: "literal", value: renderPropertyName(property) }, + operator: "in", + right: SUBJECT, + }, + operator: "&&", + right: { + kind: "in-range", + expr: { kind: "model-property", property }, + range, + }, }, body: { kind: "result", type: model }, }); From 11d6f4950649bbc68507a02abe5ce91e55c94fe7 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:27:43 -0800 Subject: [PATCH 20/71] Adopt versioning Cadl-Ranch specs (#5273) Fixes https://github.com/microsoft/typespec/issues/3965 Filed https://github.com/Azure/cadl-ranch/issues/779 as versioning is implemented in tsp compiler. --------- Co-authored-by: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> --- .../eng/scripts/Generate.ps1 | 12 +- .../eng/scripts/Generation.psm1 | 50 +- .../eng/scripts/Get-CadlRanch-Coverage.ps1 | 8 + .../eng/scripts/Test-CadlRanch.ps1 | 16 +- .../src/InputTypes/InputParameter.cs | 6 +- .../src/Properties/launchSettings.json | 60 ++ .../Added/V1/VersioningAddedV1Tests.cs | 56 + .../Added/V2/VersioningAddedV2Tests.cs | 91 ++ .../V1/VersioningMadeOptionalV1Tests.cs | 22 + .../V2/VersioningMadeOptionalV2Tests.cs | 33 + .../Removed/V1/VersioningRemovedV1Tests.cs | 43 + .../Removed/V2/VersioningRemovedV2Tests.cs | 81 ++ .../VersioningRemovedV2PreviewTests.cs | 22 + .../V1/VersioningRenamedFromV1Tests.cs | 49 + .../V2/VersioningRenamedFromV2Tests.cs | 73 ++ .../VersioningReturnTypeChangedFromV2Tests.cs | 20 + .../V2/VersioningTypeChangedFromV2Tests.cs | 23 + .../versioning/added/v1/Configuration.json | 6 + .../added/v1/Versioning.Added.V1.sln | 48 + .../added/v1/src/Generated/AddedClient.cs | 32 + .../v1/src/Generated/AddedClientOptions.cs | 21 + .../added/v1/src/Generated/Models/EnumV1.cs | 12 + .../Generated/Models/ModelV1.Serialization.cs | 36 + .../added/v1/src/Generated/Models/ModelV1.cs | 23 + .../VersioningAddedV1ModelFactory.cs | 11 + .../added/v1/src/Versioning.Added.V1.csproj | 16 + .../versioning/added/v1/tspCodeModel.json | 292 ++++++ .../versioning/added/v2/Configuration.json | 6 + .../added/v2/Versioning.Added.V2.sln | 48 + .../added/v2/src/Generated/AddedClient.cs | 42 + .../v2/src/Generated/AddedClientOptions.cs | 23 + .../added/v2/src/Generated/InterfaceV2.cs | 27 + .../added/v2/src/Generated/Models/EnumV1.cs | 14 + .../added/v2/src/Generated/Models/EnumV2.cs | 12 + .../Generated/Models/ModelV1.Serialization.cs | 36 + .../added/v2/src/Generated/Models/ModelV1.cs | 31 + .../Generated/Models/ModelV2.Serialization.cs | 36 + .../added/v2/src/Generated/Models/ModelV2.cs | 31 + .../VersioningAddedV2ModelFactory.cs | 15 + .../added/v2/src/Versioning.Added.V2.csproj | 16 + .../versioning/added/v2/tspCodeModel.json | 774 ++++++++++++++ .../madeOptional/v1/Configuration.json | 6 + .../v1/Versioning.MadeOptional.V1.sln | 48 + .../v1/src/Generated/MadeOptionalClient.cs | 32 + .../Generated/MadeOptionalClientOptions.cs | 21 + .../Models/TestModel.Serialization.cs | 36 + .../v1/src/Generated/Models/TestModel.cs | 23 + .../VersioningMadeOptionalV1ModelFactory.cs | 11 + .../v1/src/Versioning.MadeOptional.V1.csproj | 16 + .../madeOptional/v1/tspCodeModel.json | 281 +++++ .../madeOptional/v2/Configuration.json | 6 + .../v2/Versioning.MadeOptional.V2.sln | 48 + .../v2/src/Generated/MadeOptionalClient.cs | 32 + .../Generated/MadeOptionalClientOptions.cs | 23 + .../Models/TestModel.Serialization.cs | 36 + .../v2/src/Generated/Models/TestModel.cs | 23 + .../VersioningMadeOptionalV2ModelFactory.cs | 11 + .../v2/src/Versioning.MadeOptional.V2.csproj | 16 + .../madeOptional/v2/tspCodeModel.json | 300 ++++++ .../versioning/removed/v1/Configuration.json | 6 + .../removed/v1/Versioning.Removed.V1.sln | 48 + .../removed/v1/src/Generated/InterfaceV1.cs | 27 + .../removed/v1/src/Generated/Models/EnumV1.cs | 12 + .../removed/v1/src/Generated/Models/EnumV2.cs | 14 + .../removed/v1/src/Generated/Models/EnumV3.cs | 14 + .../Generated/Models/ModelV1.Serialization.cs | 36 + .../v1/src/Generated/Models/ModelV1.cs | 31 + .../Generated/Models/ModelV2.Serialization.cs | 36 + .../v1/src/Generated/Models/ModelV2.cs | 37 + .../Generated/Models/ModelV3.Serialization.cs | 36 + .../v1/src/Generated/Models/ModelV3.cs | 23 + .../removed/v1/src/Generated/RemovedClient.cs | 50 + .../v1/src/Generated/RemovedClientOptions.cs | 21 + .../VersioningRemovedV1ModelFactory.cs | 17 + .../v1/src/Versioning.Removed.V1.csproj | 16 + .../versioning/removed/v1/tspCodeModel.json | 990 ++++++++++++++++++ .../versioning/removed/v2/Configuration.json | 6 + .../removed/v2/Versioning.Removed.V2.sln | 48 + .../removed/v2/src/Generated/Models/EnumV2.cs | 12 + .../removed/v2/src/Generated/Models/EnumV3.cs | 14 + .../Generated/Models/ModelV2.Serialization.cs | 36 + .../v2/src/Generated/Models/ModelV2.cs | 31 + .../Generated/Models/ModelV3.Serialization.cs | 36 + .../v2/src/Generated/Models/ModelV3.cs | 23 + .../removed/v2/src/Generated/RemovedClient.cs | 40 + .../v2/src/Generated/RemovedClientOptions.cs | 25 + .../VersioningRemovedV2ModelFactory.cs | 15 + .../v2/src/Versioning.Removed.V2.csproj | 16 + .../versioning/removed/v2/tspCodeModel.json | 571 ++++++++++ .../removed/v2Preview/Configuration.json | 6 + .../Versioning.Removed.V2Preview.sln | 48 + .../v2Preview/src/Generated/InterfaceV1.cs | 27 + .../v2Preview/src/Generated/Models/EnumV1.cs | 12 + .../v2Preview/src/Generated/Models/EnumV2.cs | 14 + .../Generated/Models/ModelV1.Serialization.cs | 36 + .../v2Preview/src/Generated/Models/ModelV1.cs | 31 + .../Generated/Models/ModelV2.Serialization.cs | 36 + .../v2Preview/src/Generated/Models/ModelV2.cs | 37 + .../Generated/Models/ModelV3.Serialization.cs | 36 + .../v2Preview/src/Generated/Models/ModelV3.cs | 17 + .../v2Preview/src/Generated/RemovedClient.cs | 50 + .../src/Generated/RemovedClientOptions.cs | 23 + .../VersioningRemovedV2PreviewModelFactory.cs | 17 + .../src/Versioning.Removed.V2Preview.csproj | 16 + .../removed/v2Preview/tspCodeModel.json | 941 +++++++++++++++++ .../renamedFrom/v1/Configuration.json | 6 + .../v1/Versioning.RenamedFrom.V1.sln | 48 + .../v1/src/Generated/Models/OldEnum.cs | 12 + .../Models/OldModel.Serialization.cs | 36 + .../v1/src/Generated/Models/OldModel.cs | 31 + .../v1/src/Generated/OldInterface.cs | 27 + .../v1/src/Generated/RenamedFromClient.cs | 34 + .../src/Generated/RenamedFromClientOptions.cs | 21 + .../VersioningRenamedFromV1ModelFactory.cs | 13 + .../v1/src/Versioning.RenamedFrom.V1.csproj | 16 + .../renamedFrom/v1/tspCodeModel.json | 515 +++++++++ .../renamedFrom/v2/Configuration.json | 6 + .../v2/Versioning.RenamedFrom.V2.sln | 48 + .../v2/src/Generated/Models/NewEnum.cs | 12 + .../Models/NewModel.Serialization.cs | 36 + .../v2/src/Generated/Models/NewModel.cs | 31 + .../v2/src/Generated/NewInterface.cs | 27 + .../v2/src/Generated/RenamedFromClient.cs | 34 + .../src/Generated/RenamedFromClientOptions.cs | 23 + .../VersioningRenamedFromV2ModelFactory.cs | 13 + .../v2/src/Versioning.RenamedFrom.V2.csproj | 16 + .../renamedFrom/v2/tspCodeModel.json | 534 ++++++++++ .../v1/Configuration.json | 6 + .../Versioning.ReturnTypeChangedFrom.V1.sln | 48 + .../Generated/ReturnTypeChangedFromClient.cs | 31 + .../ReturnTypeChangedFromClientOptions.cs | 21 + ...Versioning.ReturnTypeChangedFrom.V1.csproj | 16 + .../v1/tspCodeModel.json | 219 ++++ .../v2/Configuration.json | 6 + .../Versioning.ReturnTypeChangedFrom.V2.sln | 48 + .../Generated/ReturnTypeChangedFromClient.cs | 31 + .../ReturnTypeChangedFromClientOptions.cs | 23 + ...Versioning.ReturnTypeChangedFrom.V2.csproj | 16 + .../v2/tspCodeModel.json | 238 +++++ .../typeChangedFrom/v1/Configuration.json | 6 + .../v1/Versioning.TypeChangedFrom.V1.sln | 48 + .../Models/TestModel.Serialization.cs | 36 + .../v1/src/Generated/Models/TestModel.cs | 23 + .../v1/src/Generated/TypeChangedFromClient.cs | 32 + .../Generated/TypeChangedFromClientOptions.cs | 21 + ...VersioningTypeChangedFromV1ModelFactory.cs | 11 + .../src/Versioning.TypeChangedFrom.V1.csproj | 16 + .../typeChangedFrom/v1/tspCodeModel.json | 281 +++++ .../typeChangedFrom/v2/Configuration.json | 6 + .../v2/Versioning.TypeChangedFrom.V2.sln | 48 + .../Models/TestModel.Serialization.cs | 36 + .../v2/src/Generated/Models/TestModel.cs | 23 + .../v2/src/Generated/TypeChangedFromClient.cs | 32 + .../Generated/TypeChangedFromClientOptions.cs | 23 + ...VersioningTypeChangedFromV2ModelFactory.cs | 11 + .../src/Versioning.TypeChangedFrom.V2.csproj | 16 + .../typeChangedFrom/v2/tspCodeModel.json | 300 ++++++ 157 files changed, 10076 insertions(+), 11 deletions(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V1/VersioningAddedV1Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V2/VersioningAddedV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V1/VersioningMadeOptionalV1Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V2/VersioningMadeOptionalV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2/VersioningRemovedV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2Preview/VersioningRemovedV2PreviewTests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V1/VersioningRenamedFromV1Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V2/VersioningRenamedFromV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/ReturnTypeChangedFrom/V2/VersioningReturnTypeChangedFromV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/TypeChangedFrom/V2/VersioningTypeChangedFromV2Tests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Versioning.Added.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/EnumV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/VersioningAddedV1ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Versioning.Added.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Versioning.Added.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/VersioningAddedV2ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Versioning.Added.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Versioning.MadeOptional.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/VersioningMadeOptionalV1ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Versioning.MadeOptional.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Versioning.MadeOptional.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/VersioningMadeOptionalV2ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Versioning.MadeOptional.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Versioning.Removed.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV3.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/VersioningRemovedV1ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Versioning.Removed.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Versioning.Removed.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV3.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/VersioningRemovedV2ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Versioning.Removed.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Versioning.Removed.V2Preview.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/VersioningRemovedV2PreviewModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Versioning.Removed.V2Preview.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Versioning.RenamedFrom.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldEnum.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/VersioningRenamedFromV1ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Versioning.RenamedFrom.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Versioning.RenamedFrom.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewEnum.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/VersioningRenamedFromV2ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Versioning.RenamedFrom.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Versioning.ReturnTypeChangedFrom.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Versioning.ReturnTypeChangedFrom.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Versioning.ReturnTypeChangedFrom.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Versioning.ReturnTypeChangedFrom.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Versioning.TypeChangedFrom.V1.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/VersioningTypeChangedFromV1ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Versioning.TypeChangedFrom.V1.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/tspCodeModel.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Versioning.TypeChangedFrom.V2.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.Serialization.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/VersioningTypeChangedFromV2ModelFactory.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Versioning.TypeChangedFrom.V2.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/tspCodeModel.json diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1 index 6dd27b46fc..ee44432ff6 100644 --- a/packages/http-client-csharp/eng/scripts/Generate.ps1 +++ b/packages/http-client-csharp/eng/scripts/Generate.ps1 @@ -79,10 +79,6 @@ foreach ($directory in $directories) { continue } - if ($folders.Contains("versioning")) { - continue # TODO: adopt versioning cadl ranch specs https://github.com/microsoft/typespec/issues/3965 - } - if ($failingSpecs.Contains($subPath)) { Write-Host "Skipping $subPath" -ForegroundColor Yellow continue @@ -97,11 +93,19 @@ foreach ($directory in $directories) { if (-not (Test-Path $generationDir)) { New-Item -ItemType Directory -Path $generationDir | Out-Null } + + if ($folders.Contains("versioning")) { + Generate-Versioning $directory.FullName $generationDir -generateStub $stubbed + $cadlRanchLaunchProjects.Add($($folders -join "-") + "-v1", $("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))") + "/v1") + $cadlRanchLaunchProjects.Add($($folders -join "-") + "-v2", $("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))") + "/v2") + continue + } $cadlRanchLaunchProjects.Add(($folders -join "-"), ("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))")) if ($LaunchOnly) { continue } + Write-Host "Generating $subPath" -ForegroundColor Cyan Invoke (Get-TspCommand $specFile $generationDir $stubbed) diff --git a/packages/http-client-csharp/eng/scripts/Generation.psm1 b/packages/http-client-csharp/eng/scripts/Generation.psm1 index cb4cc9403d..a2c6af5274 100644 --- a/packages/http-client-csharp/eng/scripts/Generation.psm1 +++ b/packages/http-client-csharp/eng/scripts/Generation.psm1 @@ -25,7 +25,8 @@ function Get-TspCommand { [string]$specFile, [string]$generationDir, [bool]$generateStub = $false, - [string]$namespaceOverride = $null + [string]$namespaceOverride = $null, + [string]$apiVersion = $null ) $command = "npx tsp compile $specFile" $command += " --trace @typespec/http-client-csharp" @@ -43,6 +44,10 @@ function Get-TspCommand { if ($namespaceOverride) { $command += " --option @typespec/http-client-csharp.namespace=$namespaceOverride" } + + if ($apiVersion) { + $command += " --option @typespec/http-client-csharp.api-version=$apiVersion" + } return $command } @@ -101,9 +106,52 @@ function Generate-Srv-Driven { } } +function Generate-Versioning { + param ( + [string]$specFilePath, + [string]$outputDir, + [bool]$generateStub = $false, + [bool]$createOutputDirIfNotExist = $true + ) + + $v1Dir = $(Join-Path $outputDir "v1") + if ($createOutputDirIfNotExist -and -not (Test-Path $v1Dir)) { + New-Item -ItemType Directory -Path $v1Dir | Out-Null + } + + $v2Dir = $(Join-Path $outputDir "v2") + if ($createOutputDirIfNotExist -and -not (Test-Path $v2Dir)) { + New-Item -ItemType Directory -Path $v2Dir | Out-Null + } + $outputFolders = $outputDir.Split([System.IO.Path]::DirectorySeparatorChar) + ## get the last two directories of the output directory and add V1/V2 to disambiguate the namespaces + $namespaceRoot = $(($outputFolders[-2..-1] | ` + ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }) -join ".") + $v1NamespaceOverride = $namespaceRoot + ".V1" + $v2NamespaceOverride = $namespaceRoot + ".V2" + + Invoke (Get-TspCommand $specFilePath $v1Dir -generateStub $generateStub -apiVersion "v1" -namespaceOverride $v1NamespaceOverride) + Invoke (Get-TspCommand $specFilePath $v2Dir -generateStub $generateStub -apiVersion "v2" -namespaceOverride $v2NamespaceOverride) + + if ($outputFolders.Contains("removed")) { + $v2PreviewDir = $(Join-Path $outputDir "v2Preview") + if ($createOutputDirIfNotExist -and -not (Test-Path $v2PreviewDir)) { + New-Item -ItemType Directory -Path $v2PreviewDir | Out-Null + } + $v2PreviewNamespaceOverride = $namespaceRoot + ".V2Preview" + Invoke (Get-TspCommand $specFilePath $v2PreviewDir -generateStub $generateStub -apiVersion "v2preview" -namespaceOverride $v2PreviewNamespaceOverride) + } + + # exit if the generation failed + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } +} + Export-ModuleMember -Function "Invoke" Export-ModuleMember -Function "Get-TspCommand" Export-ModuleMember -Function "Refresh-Build" Export-ModuleMember -Function "Compare-Paths" Export-ModuleMember -Function "Generate-Srv-Driven" +Export-ModuleMember -Function "Generate-Versioning" diff --git a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 index d658580088..da844ced98 100644 --- a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 +++ b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 @@ -37,6 +37,14 @@ foreach ($directory in $directories) { if (-not (Test-Path $specFile)) { $specFile = Join-Path $specsDirectory $subPath "main.tsp" } + + if ($subPath.Contains("versioning")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Versioning ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + continue + } $command = Get-TspCommand $specFile $outputDir Invoke $command diff --git a/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 b/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 index 378bab6793..65266e5ac8 100644 --- a/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 +++ b/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 @@ -59,10 +59,19 @@ foreach ($directory in $directories) { $specFile = Join-Path $specsDirectory $subPath "client.tsp" if (-not (Test-Path $specFile)) { $specFile = Join-Path $specsDirectory $subPath "main.tsp" + } + + if ($subPath.Contains("versioning")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Versioning ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } } - - $command = Get-TspCommand $specFile $outputDir - Invoke $command + else { + $command = Get-TspCommand $specFile $outputDir + Invoke $command + } + # exit if the generation failed if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE @@ -73,7 +82,6 @@ foreach ($directory in $directories) { Generate-Srv-Driven $(Join-Path $specsDirectory $subPath) $outputDir -createOutputDirIfNotExist $false } - Write-Host "Testing $subPath" -ForegroundColor Cyan $command = "dotnet test $cadlRanchCsproj --filter `"FullyQualifiedName~$testFilter`"" Invoke $command diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputParameter.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputParameter.cs index 305bf310b5..5c15b2eab1 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputParameter.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputParameter.cs @@ -7,6 +7,8 @@ namespace Microsoft.Generator.CSharp.Input { public sealed class InputParameter { + private readonly bool _isApiVersion; + public InputParameter( string name, string nameInRequest, @@ -33,7 +35,7 @@ public InputParameter( DefaultValue = defaultValue; Kind = kind; IsRequired = isRequired; - IsApiVersion = isApiVersion; + _isApiVersion = isApiVersion; IsResourceParameter = isResourceParameter; IsContentType = isContentType; IsEndpoint = isEndpoint; @@ -51,7 +53,7 @@ public InputParameter( public InputConstant? DefaultValue { get; } public InputOperationParameterKind Kind { get; } public bool IsRequired { get; } - public bool IsApiVersion { get; } + public bool IsApiVersion => _isApiVersion || Type is InputEnumType enumType && enumType.Usage.HasFlag(InputModelTypeUsage.ApiVersionEnum); public bool IsResourceParameter { get; } public bool IsContentType { get; } public bool IsEndpoint { get; } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json index a813937b29..a8e2843798 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json @@ -260,6 +260,66 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, + "http-versioning-added-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/added/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-added-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/added/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-madeOptional-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/madeOptional/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-madeOptional-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/madeOptional/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-removed-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/removed/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-removed-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/removed/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-renamedFrom-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/renamedFrom/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-renamedFrom-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/renamedFrom/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-returnTypeChangedFrom-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-returnTypeChangedFrom-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-typeChangedFrom-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-versioning-typeChangedFrom-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, "Unbranded-TypeSpec": { "commandLineArgs": "$(SolutionDir)/TestProjects/Local/Unbranded-TypeSpec -p ClientModelPlugin", "commandName": "Executable", diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V1/VersioningAddedV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V1/VersioningAddedV1Tests.cs new file mode 100644 index 0000000000..785e980779 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V1/VersioningAddedV1Tests.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System; +using System.Linq; +using Versioning.Added.V1; +using Versioning.Added.V1.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.Added.V1 +{ + public class VersioningAddedV1Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestAddedMembersV1Client() + { + /* verify ModelV1. */ + var properties = typeof(ModelV1).GetProperties(); + Assert.IsNotNull(properties); + Assert.AreEqual(2, properties.Length); + /* verify property UnionProp added in V2 is not present.*/ + Assert.IsNull(typeof(ModelV1).GetProperty("UnionProp")); + + /* verify EnumV1. */ + Assert.True(typeof(EnumV1).IsEnum); + var enumValues = typeof(EnumV1).GetEnumNames(); + Assert.IsNotNull(enumValues); + Assert.AreEqual(1, enumValues.Length); + /* verify added enum value EnumMemberV2. */ + Assert.IsFalse(enumValues.Contains("EnumMemberV2")); + + /* check existence of the added model ModelV2. */ + Assert.IsNull(Type.GetType("Versioning.Added.V1.Models.ModelV2")); + + /* check existence of the added enum EnumV2. */ + Assert.IsNull(Type.GetType("Versioning.Added.V1.Models.EnumV2")); + + /* check the added parameter. */ + var methods = typeof(AddedClient).GetMethods().Where(m => m.Name == "V1" || m.Name == "V1Async"); + Assert.IsNotNull(methods); + Assert.AreEqual(4, methods.Count()); + var methodsArray = methods.ToArray(); + foreach (var method in methodsArray) + { + Assert.IsFalse(method.GetParameters().Any(p => p.Name == "headerV2")); + } + + /* check the existence of added method in V2. */ + var addedMethods = typeof(AddedClient).GetMethods().Where(m => m.Name == "V2" || m.Name == "V2Async"); + Assert.IsEmpty(addedMethods); + + /* check the existence of added interface in V2. */ + Assert.IsNull(Type.GetType("Versioning.Added.V1.InterfaceV2")); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V2/VersioningAddedV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V2/VersioningAddedV2Tests.cs new file mode 100644 index 0000000000..ace5b75b5d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Added/V2/VersioningAddedV2Tests.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using NUnit.Framework; +using System; +using System.Linq; +using Versioning.Added.V2; +using Versioning.Added.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.Added.V2 +{ + public class VersioningAddedV2Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestAddedMembersV2Client() + { + /* verify ModelV1. */ + var properties = typeof(ModelV1).GetProperties(); + Assert.IsNotNull(properties); + Assert.AreEqual(3, properties.Length); + /* verify added property UnionProp in V2.*/ + Assert.IsNotNull(typeof(ModelV1).GetProperty("UnionProp")); + + /* verify EnumV1. */ + Assert.True(typeof(EnumV1).IsEnum); + var enumValues = typeof(EnumV1).GetEnumNames(); + Assert.IsNotNull(enumValues); + Assert.AreEqual(2, enumValues.Length); + /* verify added enum value EnumMemberV2. */ + Assert.IsTrue(enumValues.Contains("EnumMemberV2")); + + /* check existence of the added model ModelV2. */ + Assert.IsNotNull(Type.GetType("Versioning.Added.V2.Models.ModelV2")); + + /* check existence of the added enum EnumV2. */ + Assert.IsNotNull(Type.GetType("Versioning.Added.V2.Models.EnumV2")); + + /* check the added parameter. */ + var methods = typeof(AddedClient).GetMethods().Where(m => m.Name == "V1" || m.Name == "V1Async"); + Assert.IsNotNull(methods); + Assert.AreEqual(4, methods.Count()); + var methodsArray = methods.ToArray(); + foreach (var method in methodsArray) + { + Assert.IsTrue(method.GetParameters().Any(p => p.Name == "headerV2")); + } + + /* check the existence of added method in V2. */ + var addedMethods = typeof(AddedClient).GetMethods().Where(m => m.Name == "V2" || m.Name == "V2Async"); + Assert.IsNotNull(addedMethods); + Assert.AreEqual(4, addedMethods.Count()); + + /* check the existence of added interface in V2. */ + Assert.IsNotNull(Type.GetType("Versioning.Added.V2.InterfaceV2")); + } + + [CadlRanchTest] + public Task Versioning_Added_v1() => Test(async (host) => + { + ModelV1 modelV1 = new ModelV1("foo", EnumV1.EnumMemberV2, BinaryData.FromObjectAsJson(10)); + var response = await new AddedClient(host).V1Async("bar", modelV1); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + Assert.AreEqual(EnumV1.EnumMemberV2, response.Value.EnumProp); + Assert.AreEqual(10, response.Value.UnionProp.ToObjectFromJson()); + }); + + [CadlRanchTest] + public Task Versioning_Added_v2() => Test(async (host) => + { + ModelV2 modelV2 = new ModelV2("foo", EnumV2.EnumMember, BinaryData.FromObjectAsJson("bar")); + var response = await new AddedClient(host).V2Async(modelV2); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + Assert.AreEqual(EnumV2.EnumMember, response.Value.EnumProp); + Assert.AreEqual("bar", response.Value.UnionProp.ToObjectFromJson()); + }); + + [CadlRanchTest] + public Task Versioning_Added_InterfaceV2() => Test(async (host) => + { + ModelV2 modelV2 = new ModelV2("foo", EnumV2.EnumMember, BinaryData.FromObjectAsJson("bar")); + var response = await new AddedClient(host).GetInterfaceV2Client().V2InInterfaceAsync(modelV2); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + Assert.AreEqual(EnumV2.EnumMember, response.Value.EnumProp); + Assert.AreEqual("bar", response.Value.UnionProp.ToObjectFromJson()); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V1/VersioningMadeOptionalV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V1/VersioningMadeOptionalV1Tests.cs new file mode 100644 index 0000000000..2f60e93400 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V1/VersioningMadeOptionalV1Tests.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System.Linq; +using Versioning.MadeOptional.V1.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.MadeOptional.V1 +{ + public class VersioningMadeOptionalV1Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void CheckMadeOptionalMembers() + { + var constructors = typeof(TestModel).GetConstructors(); + Assert.IsNotNull(constructors); + Assert.AreEqual(1, constructors.Length); + /* property will not in public constructor signature. */ + Assert.IsTrue(constructors[0].GetParameters().Any(p => p.Name == "changedProp")); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V2/VersioningMadeOptionalV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V2/VersioningMadeOptionalV2Tests.cs new file mode 100644 index 0000000000..239b07fcd1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/MadeOptional/V2/VersioningMadeOptionalV2Tests.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System.Linq; +using System.Threading.Tasks; +using Versioning.MadeOptional.V2; +using Versioning.MadeOptional.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.MadeOptional.V2 +{ + public class VersioningMadeOptionalV2Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void CheckMadeOptionalMembers() + { + var constructors = typeof(TestModel).GetConstructors(); + Assert.IsNotNull(constructors); + Assert.AreEqual(1, constructors.Length); + /* optional property will not show in public constructor signature. */ + Assert.False(constructors[0].GetParameters().Any(p => p.Name == "changedProp")); + } + + [CadlRanchTest] + public Task Versioning_MadeOptional_Test() => Test(async (host) => + { + TestModel body = new TestModel("foo"); + var response = await new MadeOptionalClient(host).TestAsync(body); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs new file mode 100644 index 0000000000..3fdf09cc9e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using NUnit.Framework; +using Versioning.Removed.V1; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.Removed.V1 +{ + public class VersioningRemovedV1Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestRemovedMembers() + { + /* check existence of the removed model ModelV1. */ + Assert.IsNotNull(Type.GetType("Versioning.Removed.V1.Models.ModelV1")); + + /* check existence of the removed enum EnumV1. */ + Assert.IsNotNull(Type.GetType("Versioning.Removed.V1.Models.EnumV1")); + + /* check existence of removed method V1 */ + var removedMethods = typeof(RemovedClient).GetMethods().Where(m => m.Name == "V1" || m.Name == "V1Async"); + Assert.AreEqual(4, removedMethods.Count()); + + /* check existence of removed parameter. */ + var v2Methods = typeof(RemovedClient).GetMethods().Where(m => m.Name == "V2" || m.Name == "V2Async"); + Assert.IsNotNull(v2Methods); + Assert.AreEqual(4, v2Methods.Count()); + foreach (var method in v2Methods) + { + Assert.IsTrue(method.GetParameters().Any(p => p.Name == "param")); + } + + /* check existence of removed interface. */ + Assert.IsNotNull(Type.GetType("Versioning.Removed.V1.InterfaceV1")); + + // Only initial versions is defined + var enumType = typeof(RemovedClientOptions.ServiceVersion); + Assert.AreEqual(new string[] { "V1" }, enumType.GetEnumNames()); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2/VersioningRemovedV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2/VersioningRemovedV2Tests.cs new file mode 100644 index 0000000000..49b6031e46 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2/VersioningRemovedV2Tests.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Linq; +using System.Threading.Tasks; +using NUnit.Framework; +using Versioning.Removed.V2; +using Versioning.Removed.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.Removed.V2 +{ + public class VersioningRemovedV2Tests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestRemovedMembers() + { + /* check existence of the removed model ModelV1. */ + Assert.IsNull(Type.GetType("Versioning.Removed.V2.Models.ModelV1")); + + /* check existence of the removed enum EnumV1. */ + Assert.IsNull(Type.GetType("Versioning.Removed.V2.Models.EnumV1")); + + /* verify ModelV2. */ + var properties = typeof(ModelV2).GetProperties(); + Assert.IsNotNull(properties); + Assert.AreEqual(3, properties.Length); + /* verify removed property RemovedProp in V2.*/ + Assert.IsNull(typeof(ModelV2).GetProperty("RemovedProp")); + + /* verify EnumV2 */ + Assert.IsTrue(typeof(EnumV2).IsEnum); + var enumValues = typeof(EnumV2).GetEnumNames(); + Assert.IsNotNull(enumValues); + Assert.AreEqual(1, enumValues.Length); + /* verify added enum value EnumMemberV1. */ + Assert.IsFalse(enumValues.Contains("EnumMemberV1")); + + /* check existence of removed method V1 */ + var removedMethods = typeof(RemovedClient).GetMethods().Where(m => m.Name == "V1" || m.Name == "V1Async"); + Assert.AreEqual(0, removedMethods.Count()); + + /* check existence of removed parameter. */ + var v2Methods = typeof(RemovedClient).GetMethods().Where(m => m.Name == "V2" || m.Name == "V2Async"); + Assert.IsNotNull(v2Methods); + Assert.AreEqual(4, v2Methods.Count()); + foreach (var method in v2Methods) + { + Assert.False(method.GetParameters().Any(p => p.Name == "param")); + } + + /* check existence of removed interface. */ + Assert.IsNull(Type.GetType("Versioning.Removed.V2.InterfaceV1")); + + // All 3 versions are defined + var enumType = typeof(RemovedClientOptions.ServiceVersion); + Assert.AreEqual(new string[] { "V1", "V2preview", "V2" }, enumType.GetEnumNames()); + } + + [CadlRanchTest] + public Task Versioning_Removed_v2() => Test(async (host) => + { + ModelV2 modelV2 = new ModelV2("foo", EnumV2.EnumMemberV2, BinaryData.FromObjectAsJson("bar")); + var response = await new RemovedClient(host).V2Async(modelV2); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + Assert.AreEqual(EnumV2.EnumMemberV2, response.Value.EnumProp); + Assert.AreEqual("bar", response.Value.UnionProp.ToObjectFromJson()); + }); + + [CadlRanchTest] + public Task Versioning_Removed_V3Model() => Test(async (host) => + { + var model = new ModelV3("123", EnumV3.EnumMemberV1); + var response = await new RemovedClient(host).ModelV3Async(model); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("123", response.Value.Id); + Assert.AreEqual(EnumV3.EnumMemberV1, response.Value.EnumProp); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2Preview/VersioningRemovedV2PreviewTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2Preview/VersioningRemovedV2PreviewTests.cs new file mode 100644 index 0000000000..21b0b1ede6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V2Preview/VersioningRemovedV2PreviewTests.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using NUnit.Framework; +using Versioning.Removed.V2Preview; +using Versioning.Removed.V2Preview.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.Removed.V2Preview +{ + public class VersioningRemovedV2PreviewTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task Versioning_Removed_V3Model() => Test(async (host) => + { + var model = new ModelV3("123"); + var response = await new RemovedClient(host).ModelV3Async(model); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("123", response.Value.Id); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V1/VersioningRenamedFromV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V1/VersioningRenamedFromV1Tests.cs new file mode 100644 index 0000000000..2b17334cf4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V1/VersioningRenamedFromV1Tests.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System; +using System.Linq; +using Versioning.RenamedFrom.V2; +using Versioning.RenamedFrom.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.RenamedFrom.V1 +{ + public class VersioningRenamedFromTests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestRenamedMembers() + { + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V1.Models.OldModel")); + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V1.Models.NewModel")); + + /* check the renamed property of model */ + var properties = typeof(NewModel).GetProperties(); + Assert.IsNotNull(properties); + Assert.AreEqual(3, properties.Length); + Assert.IsNull(typeof(NewModel).GetProperty("OldProp")); + Assert.IsNotNull(typeof(NewModel).GetProperty("NewProp")); + + /* check the renamed enum from `OldEnum` to `NewEnum` */ + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V1.Models.OldEnum")); + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V1.Models.NewEnum")); + + /* check the renamed enum value */ + var enumValues = typeof(NewEnum).GetEnumNames(); + Assert.IsNotNull(enumValues); + Assert.AreEqual(1, enumValues.Length); + Assert.IsFalse(enumValues.Contains("OldEnumMember")); + Assert.IsTrue(enumValues.Contains("NewEnumMember")); + + /* check the renamed operation */ + var oldMethods = typeof(RenamedFromClient).GetMethods().Where(m => m.Name == "OldOp" || m.Name == "OldOpAsync"); + Assert.AreEqual(0, oldMethods.Count()); + var newMethods = typeof(RenamedFromClient).GetMethods().Where(m => m.Name == "NewOp" || m.Name == "NewOpAsync"); + Assert.AreEqual(4, newMethods.Count()); + + /* check the renamed interface */ + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V1.OldInterface")); + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V1.NewInterface")); + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V2/VersioningRenamedFromV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V2/VersioningRenamedFromV2Tests.cs new file mode 100644 index 0000000000..f5fe18224f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/RenamedFrom/V2/VersioningRenamedFromV2Tests.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System; +using System.Linq; +using System.Threading.Tasks; +using Versioning.RenamedFrom.V2; +using Versioning.RenamedFrom.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.RenamedFrom.V2 +{ + public class VersioningRenamedFromTests : CadlRanchTestBase + { + [CadlRanchTest] + public void TestRenamedMembers() + { + /* check the renamed model from `OldModel` to `NewModel` */ + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V2.Models.OldModel")); + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V2.Models.NewModel")); + + /* check the renamed property of model */ + var properties = typeof(NewModel).GetProperties(); + Assert.IsNotNull(properties); + Assert.AreEqual(3, properties.Length); + Assert.IsNull(typeof(NewModel).GetProperty("OldProp")); + Assert.IsNotNull(typeof(NewModel).GetProperty("NewProp")); + + /* check the renamed enum from `OldEnum` to `NewEnum` */ + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V2.Models.OldEnum")); + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V2.Models.NewEnum")); + + /* check the renamed enum value */ + var enumValues = typeof(NewEnum).GetEnumNames(); + Assert.IsNotNull(enumValues); + Assert.AreEqual(1, enumValues.Length); + Assert.IsFalse(enumValues.Contains("OldEnumMember")); + Assert.IsTrue(enumValues.Contains("NewEnumMember")); + + /* check the renamed operation */ + var oldMethods = typeof(RenamedFromClient).GetMethods().Where(m => m.Name == "OldOp" || m.Name == "OldOpAsync"); + Assert.AreEqual(0, oldMethods.Count()); + var newMethods = typeof(RenamedFromClient).GetMethods().Where(m => m.Name == "NewOp" || m.Name == "NewOpAsync"); + Assert.AreEqual(4, newMethods.Count()); + + /* check the renamed interface */ + Assert.IsNull(Type.GetType("Versioning.RenamedFrom.V2.OldInterface")); + Assert.IsNotNull(Type.GetType("Versioning.RenamedFrom.V2.NewInterface")); + } + + [CadlRanchTest] + public Task Versioning_RenamedFrom_NewOp() => Test(async (host) => + { + NewModel body = new NewModel("foo", NewEnum.NewEnumMember, BinaryData.FromObjectAsJson(10)); + var response = await new RenamedFromClient(host).NewOpAsync("bar", body); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.NewProp); + Assert.AreEqual(NewEnum.NewEnumMember, response.Value.EnumProp); + Assert.AreEqual(10, response.Value.UnionProp.ToObjectFromJson()); + }); + + [CadlRanchTest] + public Task Versioning_RenamedFrom_NewInterface() => Test(async (host) => + { + NewModel body = new NewModel("foo", NewEnum.NewEnumMember, BinaryData.FromObjectAsJson(10)); + var response = await new RenamedFromClient(host).GetNewInterfaceClient().NewOpInNewInterfaceAsync(body); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.NewProp); + Assert.AreEqual(NewEnum.NewEnumMember, response.Value.EnumProp); + Assert.AreEqual(10, response.Value.UnionProp.ToObjectFromJson()); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/ReturnTypeChangedFrom/V2/VersioningReturnTypeChangedFromV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/ReturnTypeChangedFrom/V2/VersioningReturnTypeChangedFromV2Tests.cs new file mode 100644 index 0000000000..01a077d443 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/ReturnTypeChangedFrom/V2/VersioningReturnTypeChangedFromV2Tests.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using NUnit.Framework; +using Versioning.ReturnTypeChangedFrom.V2; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.ReturnTypeChangedFrom.V2 +{ + public class VersioningReturnTypeChangedFromTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task Versioning_ReturnTypeChangedFrom_Test() => Test(async (host) => + { + var response = await new ReturnTypeChangedFromClient(host).TestAsync("test"); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("test", response.Value); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/TypeChangedFrom/V2/VersioningTypeChangedFromV2Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/TypeChangedFrom/V2/VersioningTypeChangedFromV2Tests.cs new file mode 100644 index 0000000000..aa25c3194f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/TypeChangedFrom/V2/VersioningTypeChangedFromV2Tests.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using NUnit.Framework; +using System.Threading.Tasks; +using Versioning.TypeChangedFrom.V2; +using Versioning.TypeChangedFrom.V2.Models; + +namespace TestProjects.CadlRanch.Tests.Http.Versioning.TypeChangedFrom.V2 +{ + public class VersioningTypeChangedFromTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task Versioning_TypeChangedFrom_Test() => Test(async (host) => + { + TestModel body = new TestModel("foo", "bar"); + var response = await new TypeChangedFromClient(host).TestAsync("baz", body); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("foo", response.Value.Prop); + Assert.AreEqual("bar", response.Value.ChangedProp); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Configuration.json new file mode 100644 index 0000000000..a1b0c89fac --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.Added.V1", + "library-name": "Versioning.Added.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Versioning.Added.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Versioning.Added.V1.sln new file mode 100644 index 0000000000..ef116e1588 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/Versioning.Added.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.Added.V1", "src\Versioning.Added.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs new file mode 100644 index 0000000000..4f3e4e8833 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs @@ -0,0 +1,32 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Added.V1.Models; + +namespace Versioning.Added.V1 +{ + public partial class AddedClient + { + protected AddedClient() => throw null; + + public AddedClient(Uri endpoint) : this(endpoint, new AddedClientOptions()) => throw null; + + public AddedClient(Uri endpoint, AddedClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1(ModelV1 body) => throw null; + + public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClientOptions.cs new file mode 100644 index 0000000000..dfa740aaeb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.Added.V1 +{ + public partial class AddedClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public AddedClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/EnumV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/EnumV1.cs new file mode 100644 index 0000000000..05170f3d40 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/EnumV1.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.Added.V1.Models +{ + public enum EnumV1 + { + /// EnumMemberV1. + EnumMemberV1 + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.Serialization.cs new file mode 100644 index 0000000000..436a07dffa --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Added.V1.Models +{ + public partial class ModelV1 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV1 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV1 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV1 modelV1) => throw null; + + public static explicit operator ModelV1(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.cs new file mode 100644 index 0000000000..6137596f1f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/Models/ModelV1.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.Added.V1.Models +{ + public partial class ModelV1 + { + public ModelV1(string prop, EnumV1 enumProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV1 EnumProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/VersioningAddedV1ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/VersioningAddedV1ModelFactory.cs new file mode 100644 index 0000000000..5ab472a490 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/VersioningAddedV1ModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Versioning.Added.V1.Models +{ + public static partial class VersioningAddedV1ModelFactory + { + public static ModelV1 ModelV1(string prop = default, EnumV1 enumProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Versioning.Added.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Versioning.Added.V1.csproj new file mode 100644 index 0000000000..bd7ea27e44 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Versioning.Added.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.Added.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.Added.V1 + 1.0.0-beta.1 + Versioning.Added.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/tspCodeModel.json new file mode 100644 index 0000000000..f973fbb958 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/tspCodeModel.json @@ -0,0 +1,292 @@ +{ + "$id": "1", + "Name": "Versioning.Added", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "EnumV1", + "crossLanguageDefinitionId": "Versioning.Added.EnumV1", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.Added.Versions", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "description": "The version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "10", + "kind": "model", + "name": "ModelV1", + "crossLanguageDefinitionId": "Versioning.Added.ModelV1", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "11", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV1.prop" + }, + { + "$id": "13", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV1.enumProp" + } + ] + } + ], + "Clients": [ + { + "$id": "14", + "Name": "AddedClient", + "Description": "Test for the `@added` decorator.", + "Operations": [ + { + "$id": "15", + "Name": "v1", + "ResourceName": "Added", + "Accessibility": "public", + "Parameters": [ + { + "$id": "16", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "17", + "kind": "constant", + "valueType": { + "$id": "18", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "19", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "20", + "kind": "constant", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "22", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "10" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "23", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "10" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/added/api-version:{version}", + "Path": "/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Added.v1", + "Decorators": [] + } + ], + "Protocol": { + "$id": "24" + }, + "Parameters": [ + { + "$id": "25", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "26", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "27", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "6" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Configuration.json new file mode 100644 index 0000000000..02bab3c404 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.Added.V2", + "library-name": "Versioning.Added.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Versioning.Added.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Versioning.Added.V2.sln new file mode 100644 index 0000000000..29b239e010 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/Versioning.Added.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.Added.V2", "src\Versioning.Added.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs new file mode 100644 index 0000000000..c14b77224f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs @@ -0,0 +1,42 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Added.V2.Models; + +namespace Versioning.Added.V2 +{ + public partial class AddedClient + { + protected AddedClient() => throw null; + + public AddedClient(Uri endpoint) : this(endpoint, new AddedClientOptions()) => throw null; + + public AddedClient(Uri endpoint, AddedClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1(string headerV2, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1Async(string headerV2, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1(string headerV2, ModelV1 body) => throw null; + + public virtual Task> V1Async(string headerV2, ModelV1 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult V2(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V2Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V2(ModelV2 body) => throw null; + + public virtual Task> V2Async(ModelV2 body, CancellationToken cancellationToken = default) => throw null; + + public virtual InterfaceV2 GetInterfaceV2Client() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClientOptions.cs new file mode 100644 index 0000000000..8687c4616d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.Added.V2 +{ + public partial class AddedClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public AddedClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1, + /// The version v2. + V2 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs new file mode 100644 index 0000000000..a3e3e2561f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Added.V2.Models; + +namespace Versioning.Added.V2 +{ + public partial class InterfaceV2 + { + protected InterfaceV2() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V2InInterface(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V2InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V2InInterface(ModelV2 body) => throw null; + + public virtual Task> V2InInterfaceAsync(ModelV2 body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV1.cs new file mode 100644 index 0000000000..2d412c58dc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV1.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Versioning.Added.V2.Models +{ + public enum EnumV1 + { + /// EnumMemberV1. + EnumMemberV1, + /// EnumMemberV2. + EnumMemberV2 + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV2.cs new file mode 100644 index 0000000000..3d8cc2c153 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/EnumV2.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.Added.V2.Models +{ + public enum EnumV2 + { + /// EnumMember. + EnumMember + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.Serialization.cs new file mode 100644 index 0000000000..0fe0495bf1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Added.V2.Models +{ + public partial class ModelV1 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV1 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV1 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV1 modelV1) => throw null; + + public static explicit operator ModelV1(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.cs new file mode 100644 index 0000000000..7cf4187c0d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV1.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Added.V2.Models +{ + public partial class ModelV1 + { + public ModelV1(string prop, EnumV1 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV1 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.Serialization.cs new file mode 100644 index 0000000000..cbebd413c6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Added.V2.Models +{ + public partial class ModelV2 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV2 modelV2) => throw null; + + public static explicit operator ModelV2(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.cs new file mode 100644 index 0000000000..dfc2566608 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/Models/ModelV2.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Added.V2.Models +{ + public partial class ModelV2 + { + public ModelV2(string prop, EnumV2 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV2 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/VersioningAddedV2ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/VersioningAddedV2ModelFactory.cs new file mode 100644 index 0000000000..5bc2843e9b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/VersioningAddedV2ModelFactory.cs @@ -0,0 +1,15 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Added.V2.Models +{ + public static partial class VersioningAddedV2ModelFactory + { + public static ModelV1 ModelV1(string prop = default, EnumV1 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV2 ModelV2(string prop = default, EnumV2 enumProp = default, BinaryData unionProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Versioning.Added.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Versioning.Added.V2.csproj new file mode 100644 index 0000000000..752c8f4f58 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Versioning.Added.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.Added.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.Added.V2 + 1.0.0-beta.1 + Versioning.Added.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/tspCodeModel.json new file mode 100644 index 0000000000..b97fdf50a0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/tspCodeModel.json @@ -0,0 +1,774 @@ +{ + "$id": "1", + "Name": "Versioning.Added", + "ApiVersions": [ + "v1", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "EnumV1", + "crossLanguageDefinitionId": "Versioning.Added.EnumV1", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "enumMemberV2", + "value": "enumMemberV2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "8", + "kind": "enum", + "name": "EnumV2", + "crossLanguageDefinitionId": "Versioning.Added.EnumV2", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "10", + "kind": "enumvalue", + "name": "enumMember", + "value": "enumMember", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "8" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.Added.Versions", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The version v1.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "18", + "kind": "model", + "name": "ModelV1", + "crossLanguageDefinitionId": "Versioning.Added.ModelV1", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "19", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV1.prop" + }, + { + "$id": "21", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV1.enumProp" + }, + { + "$id": "22", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "23", + "kind": "union", + "name": "UnionV1", + "variantTypes": [ + { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "25", + "kind": "int32", + "name": "V2Scalar", + "crossLanguageDefinitionId": "Versioning.Added.V2Scalar", + "baseType": { + "$id": "26", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV1.unionProp" + } + ] + }, + { + "$id": "27", + "kind": "model", + "name": "ModelV2", + "crossLanguageDefinitionId": "Versioning.Added.ModelV2", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "28", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "29", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV2.prop" + }, + { + "$id": "30", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "8" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV2.enumProp" + }, + { + "$id": "31", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "32", + "kind": "union", + "name": "UnionV2", + "variantTypes": [ + { + "$id": "33", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "34", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Added.ModelV2.unionProp" + } + ] + } + ], + "Clients": [ + { + "$id": "35", + "Name": "AddedClient", + "Description": "Test for the `@added` decorator.", + "Operations": [ + { + "$id": "36", + "Name": "v1", + "ResourceName": "Added", + "Accessibility": "public", + "Parameters": [ + { + "$id": "37", + "Name": "headerV2", + "NameInRequest": "header-v2", + "Type": { + "$id": "38", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "39", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "40", + "kind": "constant", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "42", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "43", + "kind": "constant", + "valueType": { + "$id": "44", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "45", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "18" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "46", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "18" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/added/api-version:{version}", + "Path": "/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Added.v1", + "Decorators": [] + }, + { + "$id": "47", + "Name": "v2", + "ResourceName": "Added", + "Accessibility": "public", + "Parameters": [ + { + "$id": "48", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "49", + "kind": "constant", + "valueType": { + "$id": "50", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "51", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "52", + "kind": "constant", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "54", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "27" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "55", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "27" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/added/api-version:{version}", + "Path": "/v2", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Added.v2", + "Decorators": [] + } + ], + "Protocol": { + "$id": "56" + }, + "Parameters": [ + { + "$id": "57", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "58", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "59", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "12" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "60", + "Name": "InterfaceV2", + "Operations": [ + { + "$id": "61", + "Name": "v2InInterface", + "ResourceName": "InterfaceV2", + "Accessibility": "public", + "Parameters": [ + { + "$id": "62", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "63", + "kind": "constant", + "valueType": { + "$id": "64", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "65", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "66", + "kind": "constant", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "68", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "27" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "69", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "27" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/added/api-version:{version}", + "Path": "/interface-v2/v2", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Added.InterfaceV2.v2InInterface", + "Decorators": [] + } + ], + "Protocol": { + "$id": "70" + }, + "Parent": "AddedClient", + "Parameters": [ + { + "$id": "71", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "72", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "73", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "12" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Configuration.json new file mode 100644 index 0000000000..940644eeea --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.MadeOptional.V1", + "library-name": "Versioning.MadeOptional.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Versioning.MadeOptional.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Versioning.MadeOptional.V1.sln new file mode 100644 index 0000000000..51b46dbce2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/Versioning.MadeOptional.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.MadeOptional.V1", "src\Versioning.MadeOptional.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs new file mode 100644 index 0000000000..01ca1bac05 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs @@ -0,0 +1,32 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.MadeOptional.V1.Models; + +namespace Versioning.MadeOptional.V1 +{ + public partial class MadeOptionalClient + { + protected MadeOptionalClient() => throw null; + + public MadeOptionalClient(Uri endpoint) : this(endpoint, new MadeOptionalClientOptions()) => throw null; + + public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(string @param, TestModel body) => throw null; + + public virtual Task> TestAsync(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs new file mode 100644 index 0000000000..b8c4012f7a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.MadeOptional.V1 +{ + public partial class MadeOptionalClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public MadeOptionalClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.Serialization.cs new file mode 100644 index 0000000000..a9bb4866bb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.MadeOptional.V1.Models +{ + public partial class TestModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + TestModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + TestModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(TestModel testModel) => throw null; + + public static explicit operator TestModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.cs new file mode 100644 index 0000000000..75198e8071 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/Models/TestModel.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.MadeOptional.V1.Models +{ + public partial class TestModel + { + public TestModel(string prop, string changedProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public string ChangedProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/VersioningMadeOptionalV1ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/VersioningMadeOptionalV1ModelFactory.cs new file mode 100644 index 0000000000..d0949041b0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/VersioningMadeOptionalV1ModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Versioning.MadeOptional.V1.Models +{ + public static partial class VersioningMadeOptionalV1ModelFactory + { + public static TestModel TestModel(string prop = default, string changedProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Versioning.MadeOptional.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Versioning.MadeOptional.V1.csproj new file mode 100644 index 0000000000..e5b4b44f37 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Versioning.MadeOptional.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.MadeOptional.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.MadeOptional.V1 + 1.0.0-beta.1 + Versioning.MadeOptional.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/tspCodeModel.json new file mode 100644 index 0000000000..1a5ce90ce9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/tspCodeModel.json @@ -0,0 +1,281 @@ +{ + "$id": "1", + "Name": "Versioning.MadeOptional", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.MadeOptional.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "6", + "kind": "model", + "name": "TestModel", + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "7", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel.prop" + }, + { + "$id": "9", + "kind": "property", + "name": "changedProp", + "serializedName": "changedProp", + "type": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel.changedProp" + } + ] + } + ], + "Clients": [ + { + "$id": "11", + "Name": "MadeOptionalClient", + "Description": "Test for the `@madeOptional` decorator.", + "Operations": [ + { + "$id": "12", + "Name": "test", + "ResourceName": "MadeOptional", + "Accessibility": "public", + "Parameters": [ + { + "$id": "13", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "15", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "16", + "kind": "constant", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "18", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "19", + "kind": "constant", + "valueType": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "21", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "6" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "22", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "6" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/made-optional/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.MadeOptional.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "23" + }, + "Parameters": [ + { + "$id": "24", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "25", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "26", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Configuration.json new file mode 100644 index 0000000000..50d535b8e3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.MadeOptional.V2", + "library-name": "Versioning.MadeOptional.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Versioning.MadeOptional.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Versioning.MadeOptional.V2.sln new file mode 100644 index 0000000000..66d445ad82 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/Versioning.MadeOptional.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.MadeOptional.V2", "src\Versioning.MadeOptional.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs new file mode 100644 index 0000000000..0e1845360c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs @@ -0,0 +1,32 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.MadeOptional.V2.Models; + +namespace Versioning.MadeOptional.V2 +{ + public partial class MadeOptionalClient + { + protected MadeOptionalClient() => throw null; + + public MadeOptionalClient(Uri endpoint) : this(endpoint, new MadeOptionalClientOptions()) => throw null; + + public MadeOptionalClient(Uri endpoint, MadeOptionalClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(BinaryContent content, string @param = null, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(BinaryContent content, string @param = null, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(TestModel body, string @param = null) => throw null; + + public virtual Task> TestAsync(TestModel body, string @param = null, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs new file mode 100644 index 0000000000..0a43641656 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.MadeOptional.V2 +{ + public partial class MadeOptionalClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public MadeOptionalClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1, + /// The version v2. + V2 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.Serialization.cs new file mode 100644 index 0000000000..9700a3d60a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.MadeOptional.V2.Models +{ + public partial class TestModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + TestModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + TestModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(TestModel testModel) => throw null; + + public static explicit operator TestModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.cs new file mode 100644 index 0000000000..f9cd13dcef --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/Models/TestModel.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.MadeOptional.V2.Models +{ + public partial class TestModel + { + public TestModel(string prop) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public string ChangedProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/VersioningMadeOptionalV2ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/VersioningMadeOptionalV2ModelFactory.cs new file mode 100644 index 0000000000..402201f28b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/VersioningMadeOptionalV2ModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Versioning.MadeOptional.V2.Models +{ + public static partial class VersioningMadeOptionalV2ModelFactory + { + public static TestModel TestModel(string prop = default, string changedProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Versioning.MadeOptional.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Versioning.MadeOptional.V2.csproj new file mode 100644 index 0000000000..30c5889eda --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Versioning.MadeOptional.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.MadeOptional.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.MadeOptional.V2 + 1.0.0-beta.1 + Versioning.MadeOptional.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/tspCodeModel.json new file mode 100644 index 0000000000..90207ea958 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/tspCodeModel.json @@ -0,0 +1,300 @@ +{ + "$id": "1", + "Name": "Versioning.MadeOptional", + "ApiVersions": [ + "v1", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.MadeOptional.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "8", + "kind": "model", + "name": "TestModel", + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "9", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel.prop" + }, + { + "$id": "11", + "kind": "property", + "name": "changedProp", + "serializedName": "changedProp", + "type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.MadeOptional.TestModel.changedProp" + } + ] + } + ], + "Clients": [ + { + "$id": "13", + "Name": "MadeOptionalClient", + "Description": "Test for the `@madeOptional` decorator.", + "Operations": [ + { + "$id": "14", + "Name": "test", + "ResourceName": "MadeOptional", + "Accessibility": "public", + "Parameters": [ + { + "$id": "15", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "17", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "18", + "kind": "constant", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "20", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "21", + "kind": "constant", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "23", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "8" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "24", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "8" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/made-optional/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.MadeOptional.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "25" + }, + "Parameters": [ + { + "$id": "26", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "27", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "28", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Configuration.json new file mode 100644 index 0000000000..f2d631d285 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.Removed.V1", + "library-name": "Versioning.Removed.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Versioning.Removed.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Versioning.Removed.V1.sln new file mode 100644 index 0000000000..b8e71b9ecf --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/Versioning.Removed.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.Removed.V1", "src\Versioning.Removed.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs new file mode 100644 index 0000000000..1b690de1d7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Removed.V1.Models; + +namespace Versioning.Removed.V1 +{ + public partial class InterfaceV1 + { + protected InterfaceV1() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1InInterface(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1InInterface(ModelV1 body) => throw null; + + public virtual Task> V1InInterfaceAsync(ModelV1 body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV1.cs new file mode 100644 index 0000000000..45d0b8bab4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV1.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.Removed.V1.Models +{ + public enum EnumV1 + { + /// EnumMember. + EnumMember + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV2.cs new file mode 100644 index 0000000000..b94ada2865 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV2.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Versioning.Removed.V1.Models +{ + public enum EnumV2 + { + /// EnumMemberV1. + EnumMemberV1, + /// EnumMemberV2. + EnumMemberV2 + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV3.cs new file mode 100644 index 0000000000..9ad41447df --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/EnumV3.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Versioning.Removed.V1.Models +{ + public enum EnumV3 + { + /// EnumMemberV1. + EnumMemberV1, + /// EnumMemberV2Preview. + EnumMemberV2Preview + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.Serialization.cs new file mode 100644 index 0000000000..73ac5f911c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV1 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV1 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV1 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV1 modelV1) => throw null; + + public static explicit operator ModelV1(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.cs new file mode 100644 index 0000000000..306c82a546 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV1.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV1 + { + public ModelV1(string prop, EnumV1 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV1 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.Serialization.cs new file mode 100644 index 0000000000..b7f4ded0af --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV2 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV2 modelV2) => throw null; + + public static explicit operator ModelV2(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.cs new file mode 100644 index 0000000000..f2e845b378 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV2.cs @@ -0,0 +1,37 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV2 + { + public ModelV2(string prop, string removedProp, EnumV2 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public string RemovedProp + { + get => throw null; + set => throw null; + } + + public EnumV2 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.Serialization.cs new file mode 100644 index 0000000000..5afd00fe9c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV3 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV3 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV3 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV3 modelV3) => throw null; + + public static explicit operator ModelV3(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.cs new file mode 100644 index 0000000000..e876028af3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/Models/ModelV3.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.Removed.V1.Models +{ + public partial class ModelV3 + { + public ModelV3(string id, EnumV3 enumProp) => throw null; + + public string Id + { + get => throw null; + set => throw null; + } + + public EnumV3 EnumProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs new file mode 100644 index 0000000000..916f45fd30 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs @@ -0,0 +1,50 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Removed.V1.Models; + +namespace Versioning.Removed.V1 +{ + public partial class RemovedClient + { + protected RemovedClient() => throw null; + + public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1(ModelV1 body) => throw null; + + public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult V2(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V2Async(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V2(string @param, ModelV2 body) => throw null; + + public virtual Task> V2Async(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult ModelV3(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult ModelV3(ModelV3 body) => throw null; + + public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null; + + public virtual InterfaceV1 GetInterfaceV1Client() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs new file mode 100644 index 0000000000..cab73b02fc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.Removed.V1 +{ + public partial class RemovedClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The original version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/VersioningRemovedV1ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/VersioningRemovedV1ModelFactory.cs new file mode 100644 index 0000000000..379538bf7d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/VersioningRemovedV1ModelFactory.cs @@ -0,0 +1,17 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V1.Models +{ + public static partial class VersioningRemovedV1ModelFactory + { + public static ModelV1 ModelV1(string prop = default, EnumV1 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV2 ModelV2(string prop = default, string removedProp = default, EnumV2 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV3 ModelV3(string id = default, EnumV3 enumProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Versioning.Removed.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Versioning.Removed.V1.csproj new file mode 100644 index 0000000000..325a8ef7e1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Versioning.Removed.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.Removed.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.Removed.V1 + 1.0.0-beta.1 + Versioning.Removed.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/tspCodeModel.json new file mode 100644 index 0000000000..3f046e33d4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/tspCodeModel.json @@ -0,0 +1,990 @@ +{ + "$id": "1", + "Name": "Versioning.Removed", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "EnumV1", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV1", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "enumMember", + "value": "enumMember", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "EnumV2", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "enumMemberV2", + "value": "enumMemberV2", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "EnumV3", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV3", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "enumMemberV2Preview", + "value": "enumMemberV2Preview", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "18", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.Removed.Versions", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "20", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "21", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "18" + }, + "description": "The original version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "22", + "kind": "model", + "name": "ModelV1", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "23", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.prop" + }, + { + "$id": "25", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.enumProp" + }, + { + "$id": "26", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "27", + "kind": "union", + "name": "UnionV1", + "variantTypes": [ + { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "29", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.unionProp" + } + ] + }, + { + "$id": "30", + "kind": "model", + "name": "ModelV2", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "31", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "32", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.prop" + }, + { + "$id": "33", + "kind": "property", + "name": "removedProp", + "serializedName": "removedProp", + "type": { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.removedProp" + }, + { + "$id": "35", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "6" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.enumProp" + }, + { + "$id": "36", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "37", + "kind": "union", + "name": "UnionV2", + "variantTypes": [ + { + "$id": "38", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "39", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + { + "$id": "40", + "kind": "int32", + "name": "V1Scalar", + "crossLanguageDefinitionId": "Versioning.Removed.V1Scalar", + "baseType": { + "$id": "41", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.unionProp" + } + ] + }, + { + "$id": "42", + "kind": "model", + "name": "ModelV3", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "43", + "kind": "property", + "name": "id", + "serializedName": "id", + "type": { + "$id": "44", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3.id" + }, + { + "$id": "45", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "12" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3.enumProp" + } + ] + } + ], + "Clients": [ + { + "$id": "46", + "Name": "RemovedClient", + "Description": "Test for the `@removed` decorator.", + "Operations": [ + { + "$id": "47", + "Name": "v1", + "ResourceName": "Removed", + "Description": "This operation should not be generated with latest version's signature.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "48", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "49", + "kind": "constant", + "valueType": { + "$id": "50", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "51", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "52", + "kind": "constant", + "valueType": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "54", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "22" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "55", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "22" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.v1", + "Decorators": [] + }, + { + "$id": "56", + "Name": "v2", + "ResourceName": "Removed", + "Accessibility": "public", + "Parameters": [ + { + "$id": "57", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "58", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "59", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "60", + "kind": "constant", + "valueType": { + "$id": "61", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "62", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "63", + "kind": "constant", + "valueType": { + "$id": "64", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "65", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "30" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "66", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "30" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v2", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.v2", + "Decorators": [] + }, + { + "$id": "67", + "Name": "modelV3", + "ResourceName": "Removed", + "Description": "This operation will pass different paths and different request bodies based on different versions.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "68", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "69", + "kind": "constant", + "valueType": { + "$id": "70", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "71", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "72", + "kind": "constant", + "valueType": { + "$id": "73", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "74", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "42" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "75", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "42" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v3", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.modelV3", + "Decorators": [] + } + ], + "Protocol": { + "$id": "76" + }, + "Parameters": [ + { + "$id": "77", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "78", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "79", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1', 'v2preview' or 'v2' in client.", + "Type": { + "$ref": "18" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "80", + "Name": "InterfaceV1", + "Description": "This operation group should not be generated with latest version.", + "Operations": [ + { + "$id": "81", + "Name": "v1InInterface", + "ResourceName": "InterfaceV1", + "Accessibility": "public", + "Parameters": [ + { + "$id": "82", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "83", + "kind": "constant", + "valueType": { + "$id": "84", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "85", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "86", + "kind": "constant", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "88", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "22" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "89", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "22" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/interface-v1/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.InterfaceV1.v1InInterface", + "Decorators": [] + } + ], + "Protocol": { + "$id": "90" + }, + "Parent": "RemovedClient", + "Parameters": [ + { + "$id": "91", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "92", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "93", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1', 'v2preview' or 'v2' in client.", + "Type": { + "$ref": "18" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Configuration.json new file mode 100644 index 0000000000..6262e57e7e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.Removed.V2", + "library-name": "Versioning.Removed.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Versioning.Removed.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Versioning.Removed.V2.sln new file mode 100644 index 0000000000..2734f785ca --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/Versioning.Removed.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.Removed.V2", "src\Versioning.Removed.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV2.cs new file mode 100644 index 0000000000..9eef86c9ec --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV2.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2.Models +{ + public enum EnumV2 + { + /// EnumMemberV2. + EnumMemberV2 + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV3.cs new file mode 100644 index 0000000000..2817ca87e2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/EnumV3.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2.Models +{ + public enum EnumV3 + { + /// EnumMemberV1. + EnumMemberV1, + /// EnumMemberV2Preview. + EnumMemberV2Preview + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.Serialization.cs new file mode 100644 index 0000000000..190a3007b4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V2.Models +{ + public partial class ModelV2 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV2 modelV2) => throw null; + + public static explicit operator ModelV2(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.cs new file mode 100644 index 0000000000..2e463ef968 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV2.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V2.Models +{ + public partial class ModelV2 + { + public ModelV2(string prop, EnumV2 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV2 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.Serialization.cs new file mode 100644 index 0000000000..7ac06e47ac --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V2.Models +{ + public partial class ModelV3 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV3 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV3 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV3 modelV3) => throw null; + + public static explicit operator ModelV3(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.cs new file mode 100644 index 0000000000..048d197acb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/Models/ModelV3.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2.Models +{ + public partial class ModelV3 + { + public ModelV3(string id, EnumV3 enumProp) => throw null; + + public string Id + { + get => throw null; + set => throw null; + } + + public EnumV3 EnumProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs new file mode 100644 index 0000000000..f959fcc9d9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs @@ -0,0 +1,40 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Removed.V2.Models; + +namespace Versioning.Removed.V2 +{ + public partial class RemovedClient + { + protected RemovedClient() => throw null; + + public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V2(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V2Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V2(ModelV2 body) => throw null; + + public virtual Task> V2Async(ModelV2 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult ModelV3(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult ModelV3(ModelV3 body) => throw null; + + public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs new file mode 100644 index 0000000000..ec1c5bffc3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClientOptions.cs @@ -0,0 +1,25 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.Removed.V2 +{ + public partial class RemovedClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The original version v1. + V1 = 1, + /// The V2 Preview version. + V2preview = 2, + /// The latest version v2. + V2 = 3 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/VersioningRemovedV2ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/VersioningRemovedV2ModelFactory.cs new file mode 100644 index 0000000000..9eeb009773 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/VersioningRemovedV2ModelFactory.cs @@ -0,0 +1,15 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V2.Models +{ + public static partial class VersioningRemovedV2ModelFactory + { + public static ModelV2 ModelV2(string prop = default, EnumV2 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV3 ModelV3(string id = default, EnumV3 enumProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Versioning.Removed.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Versioning.Removed.V2.csproj new file mode 100644 index 0000000000..035de495cc --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Versioning.Removed.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.Removed.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.Removed.V2 + 1.0.0-beta.1 + Versioning.Removed.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/tspCodeModel.json new file mode 100644 index 0000000000..bd20f18e41 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/tspCodeModel.json @@ -0,0 +1,571 @@ +{ + "$id": "1", + "Name": "Versioning.Removed", + "ApiVersions": [ + "v1", + "v2preview", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "EnumV2", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV2", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "enumMemberV2", + "value": "enumMemberV2", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "EnumV3", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV3", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "enumMemberV2Preview", + "value": "enumMemberV2Preview", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.Removed.Versions", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The original version v1.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "v2preview", + "value": "v2preview", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The V2 Preview version.", + "decorators": [] + }, + { + "$id": "18", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The latest version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "20", + "kind": "model", + "name": "ModelV2", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "21", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.prop" + }, + { + "$id": "23", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.enumProp" + }, + { + "$id": "24", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "25", + "kind": "union", + "name": "UnionV2", + "variantTypes": [ + { + "$id": "26", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "27", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.unionProp" + } + ] + }, + { + "$id": "28", + "kind": "model", + "name": "ModelV3", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "29", + "kind": "property", + "name": "id", + "serializedName": "id", + "type": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3.id" + }, + { + "$id": "31", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "6" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3.enumProp" + } + ] + } + ], + "Clients": [ + { + "$id": "32", + "Name": "RemovedClient", + "Description": "Test for the `@removed` decorator.", + "Operations": [ + { + "$id": "33", + "Name": "v2", + "ResourceName": "Removed", + "Accessibility": "public", + "Parameters": [ + { + "$id": "34", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "35", + "kind": "constant", + "valueType": { + "$id": "36", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "37", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "38", + "kind": "constant", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "40", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "20" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "41", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "20" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v2", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.v2", + "Decorators": [] + }, + { + "$id": "42", + "Name": "modelV3", + "ResourceName": "Removed", + "Description": "This operation will pass different paths and different request bodies based on different versions.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "43", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "44", + "kind": "constant", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "46", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "47", + "kind": "constant", + "valueType": { + "$id": "48", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "49", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "28" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "50", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "28" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v3", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.modelV3", + "Decorators": [] + } + ], + "Protocol": { + "$id": "51" + }, + "Parameters": [ + { + "$id": "52", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "53", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "54", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1', 'v2preview' or 'v2' in client.", + "Type": { + "$ref": "12" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Configuration.json new file mode 100644 index 0000000000..5fe52d68db --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.Removed.V2Preview", + "library-name": "Versioning.Removed.V2Preview", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Versioning.Removed.V2Preview.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Versioning.Removed.V2Preview.sln new file mode 100644 index 0000000000..1fbf99a0e2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/Versioning.Removed.V2Preview.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.Removed.V2Preview", "src\Versioning.Removed.V2Preview.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs new file mode 100644 index 0000000000..37ff67ae66 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Removed.V2Preview.Models; + +namespace Versioning.Removed.V2Preview +{ + public partial class InterfaceV1 + { + protected InterfaceV1() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1InInterface(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1InInterface(ModelV1 body) => throw null; + + public virtual Task> V1InInterfaceAsync(ModelV1 body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV1.cs new file mode 100644 index 0000000000..625f364b53 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV1.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2Preview.Models +{ + public enum EnumV1 + { + /// EnumMember. + EnumMember + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV2.cs new file mode 100644 index 0000000000..01e528b7e2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/EnumV2.cs @@ -0,0 +1,14 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2Preview.Models +{ + public enum EnumV2 + { + /// EnumMemberV1. + EnumMemberV1, + /// EnumMemberV2. + EnumMemberV2 + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.Serialization.cs new file mode 100644 index 0000000000..5aebb54060 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV1 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV1 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV1 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV1 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV1 modelV1) => throw null; + + public static explicit operator ModelV1(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.cs new file mode 100644 index 0000000000..1f217d8ee7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV1.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV1 + { + public ModelV1(string prop, EnumV1 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public EnumV1 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.Serialization.cs new file mode 100644 index 0000000000..323f8225f1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV2 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV2 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV2 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV2 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV2 modelV2) => throw null; + + public static explicit operator ModelV2(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.cs new file mode 100644 index 0000000000..f1927fa0b9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV2.cs @@ -0,0 +1,37 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV2 + { + public ModelV2(string prop, string removedProp, EnumV2 enumProp, BinaryData unionProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public string RemovedProp + { + get => throw null; + set => throw null; + } + + public EnumV2 EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.Serialization.cs new file mode 100644 index 0000000000..de9f33ae5f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV3 : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + ModelV3 IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + ModelV3 IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual ModelV3 PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(ModelV3 modelV3) => throw null; + + public static explicit operator ModelV3(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.cs new file mode 100644 index 0000000000..cd06f24f03 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/Models/ModelV3.cs @@ -0,0 +1,17 @@ +// + +#nullable disable + +namespace Versioning.Removed.V2Preview.Models +{ + public partial class ModelV3 + { + public ModelV3(string id) => throw null; + + public string Id + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs new file mode 100644 index 0000000000..aec443226b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs @@ -0,0 +1,50 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.Removed.V2Preview.Models; + +namespace Versioning.Removed.V2Preview +{ + public partial class RemovedClient + { + protected RemovedClient() => throw null; + + public RemovedClient(Uri endpoint) : this(endpoint, new RemovedClientOptions()) => throw null; + + public RemovedClient(Uri endpoint, RemovedClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult V1(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V1(ModelV1 body) => throw null; + + public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult V2(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task V2Async(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult V2(string @param, ModelV2 body) => throw null; + + public virtual Task> V2Async(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult ModelV3(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult ModelV3(ModelV3 body) => throw null; + + public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null; + + public virtual InterfaceV1 GetInterfaceV1Client() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs new file mode 100644 index 0000000000..0988f7e442 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.Removed.V2Preview +{ + public partial class RemovedClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2preview; + + public RemovedClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The original version v1. + V1 = 1, + /// The V2 Preview version. + V2preview = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/VersioningRemovedV2PreviewModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/VersioningRemovedV2PreviewModelFactory.cs new file mode 100644 index 0000000000..a22d365b09 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/VersioningRemovedV2PreviewModelFactory.cs @@ -0,0 +1,17 @@ +// + +#nullable disable + +using System; + +namespace Versioning.Removed.V2Preview.Models +{ + public static partial class VersioningRemovedV2PreviewModelFactory + { + public static ModelV1 ModelV1(string prop = default, EnumV1 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV2 ModelV2(string prop = default, string removedProp = default, EnumV2 enumProp = default, BinaryData unionProp = default) => throw null; + + public static ModelV3 ModelV3(string id = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Versioning.Removed.V2Preview.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Versioning.Removed.V2Preview.csproj new file mode 100644 index 0000000000..47d436fc11 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Versioning.Removed.V2Preview.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.Removed.V2Preview client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.Removed.V2Preview + 1.0.0-beta.1 + Versioning.Removed.V2Preview + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/tspCodeModel.json new file mode 100644 index 0000000000..2a9efd0fd9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/tspCodeModel.json @@ -0,0 +1,941 @@ +{ + "$id": "1", + "Name": "Versioning.Removed", + "ApiVersions": [ + "v1", + "v2preview" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "EnumV1", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV1", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "enumMember", + "value": "enumMember", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "EnumV2", + "crossLanguageDefinitionId": "Versioning.Removed.EnumV2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "enumMemberV1", + "value": "enumMemberV1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "enumMemberV2", + "value": "enumMemberV2", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "12", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.Removed.Versions", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "14", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The original version v1.", + "decorators": [] + }, + { + "$id": "16", + "kind": "enumvalue", + "name": "v2preview", + "value": "v2preview", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "12" + }, + "description": "The V2 Preview version.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "18", + "kind": "model", + "name": "ModelV1", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "19", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.prop" + }, + { + "$id": "21", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.enumProp" + }, + { + "$id": "22", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "23", + "kind": "union", + "name": "UnionV1", + "variantTypes": [ + { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "25", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV1.unionProp" + } + ] + }, + { + "$id": "26", + "kind": "model", + "name": "ModelV2", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "27", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.prop" + }, + { + "$id": "29", + "kind": "property", + "name": "removedProp", + "serializedName": "removedProp", + "type": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.removedProp" + }, + { + "$id": "31", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "6" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.enumProp" + }, + { + "$id": "32", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "33", + "kind": "union", + "name": "UnionV2", + "variantTypes": [ + { + "$id": "34", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "35", + "kind": "float32", + "name": "float32", + "crossLanguageDefinitionId": "TypeSpec.float32", + "decorators": [] + }, + { + "$id": "36", + "kind": "int32", + "name": "V1Scalar", + "crossLanguageDefinitionId": "Versioning.Removed.V1Scalar", + "baseType": { + "$id": "37", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV2.unionProp" + } + ] + }, + { + "$id": "38", + "kind": "model", + "name": "ModelV3", + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "39", + "kind": "property", + "name": "id", + "serializedName": "id", + "type": { + "$id": "40", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.Removed.ModelV3.id" + } + ] + } + ], + "Clients": [ + { + "$id": "41", + "Name": "RemovedClient", + "Description": "Test for the `@removed` decorator.", + "Operations": [ + { + "$id": "42", + "Name": "v1", + "ResourceName": "Removed", + "Description": "This operation should not be generated with latest version's signature.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "43", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "44", + "kind": "constant", + "valueType": { + "$id": "45", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "46", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "47", + "kind": "constant", + "valueType": { + "$id": "48", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "49", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "18" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "50", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "18" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.v1", + "Decorators": [] + }, + { + "$id": "51", + "Name": "v2", + "ResourceName": "Removed", + "Accessibility": "public", + "Parameters": [ + { + "$id": "52", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "53", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "54", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "55", + "kind": "constant", + "valueType": { + "$id": "56", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "57", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "58", + "kind": "constant", + "valueType": { + "$id": "59", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "60", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "26" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "61", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "26" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v2", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.v2", + "Decorators": [] + }, + { + "$id": "62", + "Name": "modelV3", + "ResourceName": "Removed", + "Description": "This operation will pass different paths and different request bodies based on different versions.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "63", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "64", + "kind": "constant", + "valueType": { + "$id": "65", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "66", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "67", + "kind": "constant", + "valueType": { + "$id": "68", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "69", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "38" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "70", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "38" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/v3", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.modelV3", + "Decorators": [] + } + ], + "Protocol": { + "$id": "71" + }, + "Parameters": [ + { + "$id": "72", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "73", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "74", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1', 'v2preview' or 'v2' in client.", + "Type": { + "$ref": "12" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "75", + "Name": "InterfaceV1", + "Description": "This operation group should not be generated with latest version.", + "Operations": [ + { + "$id": "76", + "Name": "v1InInterface", + "ResourceName": "InterfaceV1", + "Accessibility": "public", + "Parameters": [ + { + "$id": "77", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "78", + "kind": "constant", + "valueType": { + "$id": "79", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "80", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "81", + "kind": "constant", + "valueType": { + "$id": "82", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "83", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "18" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "84", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "18" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/removed/api-version:{version}", + "Path": "/interface-v1/v1", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.Removed.InterfaceV1.v1InInterface", + "Decorators": [] + } + ], + "Protocol": { + "$id": "85" + }, + "Parent": "RemovedClient", + "Parameters": [ + { + "$id": "86", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "87", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "88", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1', 'v2preview' or 'v2' in client.", + "Type": { + "$ref": "12" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Configuration.json new file mode 100644 index 0000000000..4b8e725a4c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.RenamedFrom.V1", + "library-name": "Versioning.RenamedFrom.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Versioning.RenamedFrom.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Versioning.RenamedFrom.V1.sln new file mode 100644 index 0000000000..17685e8901 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/Versioning.RenamedFrom.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.RenamedFrom.V1", "src\Versioning.RenamedFrom.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldEnum.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldEnum.cs new file mode 100644 index 0000000000..7aa1dd1e4f --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldEnum.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.RenamedFrom.V1.Models +{ + public enum OldEnum + { + /// OldEnumMember. + OldEnumMember + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.Serialization.cs new file mode 100644 index 0000000000..2700fdf5a1 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.RenamedFrom.V1.Models +{ + public partial class OldModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + OldModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual OldModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + OldModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual OldModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(OldModel oldModel) => throw null; + + public static explicit operator OldModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.cs new file mode 100644 index 0000000000..f897691e26 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/Models/OldModel.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.RenamedFrom.V1.Models +{ + public partial class OldModel + { + public OldModel(string oldProp, OldEnum enumProp, BinaryData unionProp) => throw null; + + public string OldProp + { + get => throw null; + set => throw null; + } + + public OldEnum EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs new file mode 100644 index 0000000000..25c04f8125 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.RenamedFrom.V1.Models; + +namespace Versioning.RenamedFrom.V1 +{ + public partial class OldInterface + { + protected OldInterface() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult NewOpInNewInterface(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task NewOpInNewInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult NewOpInNewInterface(OldModel body) => throw null; + + public virtual Task> NewOpInNewInterfaceAsync(OldModel body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs new file mode 100644 index 0000000000..a6024326c4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs @@ -0,0 +1,34 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.RenamedFrom.V1.Models; + +namespace Versioning.RenamedFrom.V1 +{ + public partial class RenamedFromClient + { + protected RenamedFromClient() => throw null; + + public RenamedFromClient(Uri endpoint) : this(endpoint, new RenamedFromClientOptions()) => throw null; + + public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult OldOp(string oldQuery, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task OldOpAsync(string oldQuery, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult OldOp(string oldQuery, OldModel body) => throw null; + + public virtual Task> OldOpAsync(string oldQuery, OldModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual OldInterface GetOldInterfaceClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs new file mode 100644 index 0000000000..82aade9d37 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.RenamedFrom.V1 +{ + public partial class RenamedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public RenamedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/VersioningRenamedFromV1ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/VersioningRenamedFromV1ModelFactory.cs new file mode 100644 index 0000000000..38cf8bb6bb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/VersioningRenamedFromV1ModelFactory.cs @@ -0,0 +1,13 @@ +// + +#nullable disable + +using System; + +namespace Versioning.RenamedFrom.V1.Models +{ + public static partial class VersioningRenamedFromV1ModelFactory + { + public static OldModel OldModel(string oldProp = default, OldEnum enumProp = default, BinaryData unionProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Versioning.RenamedFrom.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Versioning.RenamedFrom.V1.csproj new file mode 100644 index 0000000000..416c1b7769 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Versioning.RenamedFrom.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.RenamedFrom.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.RenamedFrom.V1 + 1.0.0-beta.1 + Versioning.RenamedFrom.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/tspCodeModel.json new file mode 100644 index 0000000000..e9411d9300 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/tspCodeModel.json @@ -0,0 +1,515 @@ +{ + "$id": "1", + "Name": "Versioning.RenamedFrom", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "OldEnum", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldEnum", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "oldEnumMember", + "value": "oldEnumMember", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.Versions", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "description": "The version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "10", + "kind": "model", + "name": "OldModel", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "11", + "kind": "property", + "name": "oldProp", + "serializedName": "oldProp", + "type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldModel.oldProp" + }, + { + "$id": "13", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldModel.enumProp" + }, + { + "$id": "14", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "15", + "kind": "union", + "name": "OldUnion", + "variantTypes": [ + { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "17", + "kind": "int32", + "name": "OldScalar", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldScalar", + "baseType": { + "$id": "18", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.OldModel.unionProp" + } + ] + } + ], + "Clients": [ + { + "$id": "19", + "Name": "RenamedFromClient", + "Description": "Test for the `@renamedFrom` decorator.", + "Operations": [ + { + "$id": "20", + "Name": "oldOp", + "ResourceName": "RenamedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "21", + "Name": "oldQuery", + "NameInRequest": "newQuery", + "Type": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "23", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "24", + "kind": "constant", + "valueType": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "26", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "27", + "kind": "constant", + "valueType": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "29", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "10" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "30", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "10" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/renamed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.RenamedFrom.oldOp", + "Decorators": [] + } + ], + "Protocol": { + "$id": "31" + }, + "Parameters": [ + { + "$id": "32", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "33", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "34", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "6" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "35", + "Name": "OldInterface", + "Operations": [ + { + "$id": "36", + "Name": "newOpInNewInterface", + "ResourceName": "OldInterface", + "Accessibility": "public", + "Parameters": [ + { + "$id": "37", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "38", + "kind": "constant", + "valueType": { + "$id": "39", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "40", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "41", + "kind": "constant", + "valueType": { + "$id": "42", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "43", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "10" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "44", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "10" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/renamed-from/api-version:{version}", + "Path": "/interface/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.RenamedFrom.OldInterface.newOpInNewInterface", + "Decorators": [] + } + ], + "Protocol": { + "$id": "45" + }, + "Parent": "RenamedFromClient", + "Parameters": [ + { + "$id": "46", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "47", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "48", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "6" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Configuration.json new file mode 100644 index 0000000000..fef56b3247 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.RenamedFrom.V2", + "library-name": "Versioning.RenamedFrom.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Versioning.RenamedFrom.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Versioning.RenamedFrom.V2.sln new file mode 100644 index 0000000000..6a0dc6ef3c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/Versioning.RenamedFrom.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.RenamedFrom.V2", "src\Versioning.RenamedFrom.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewEnum.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewEnum.cs new file mode 100644 index 0000000000..da46a6b113 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewEnum.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +namespace Versioning.RenamedFrom.V2.Models +{ + public enum NewEnum + { + /// NewEnumMember. + NewEnumMember + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.Serialization.cs new file mode 100644 index 0000000000..0187a881fe --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.RenamedFrom.V2.Models +{ + public partial class NewModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + NewModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual NewModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + NewModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual NewModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(NewModel newModel) => throw null; + + public static explicit operator NewModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.cs new file mode 100644 index 0000000000..4c430c9229 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/Models/NewModel.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; + +namespace Versioning.RenamedFrom.V2.Models +{ + public partial class NewModel + { + public NewModel(string newProp, NewEnum enumProp, BinaryData unionProp) => throw null; + + public string NewProp + { + get => throw null; + set => throw null; + } + + public NewEnum EnumProp + { + get => throw null; + set => throw null; + } + + public BinaryData UnionProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs new file mode 100644 index 0000000000..ff671a89f8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs @@ -0,0 +1,27 @@ +// + +#nullable disable + +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.RenamedFrom.V2.Models; + +namespace Versioning.RenamedFrom.V2 +{ + public partial class NewInterface + { + protected NewInterface() => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult NewOpInNewInterface(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task NewOpInNewInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult NewOpInNewInterface(NewModel body) => throw null; + + public virtual Task> NewOpInNewInterfaceAsync(NewModel body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs new file mode 100644 index 0000000000..795ef372f6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs @@ -0,0 +1,34 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.RenamedFrom.V2.Models; + +namespace Versioning.RenamedFrom.V2 +{ + public partial class RenamedFromClient + { + protected RenamedFromClient() => throw null; + + public RenamedFromClient(Uri endpoint) : this(endpoint, new RenamedFromClientOptions()) => throw null; + + public RenamedFromClient(Uri endpoint, RenamedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult NewOp(string newQuery, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task NewOpAsync(string newQuery, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult NewOp(string newQuery, NewModel body) => throw null; + + public virtual Task> NewOpAsync(string newQuery, NewModel body, CancellationToken cancellationToken = default) => throw null; + + public virtual NewInterface GetNewInterfaceClient() => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs new file mode 100644 index 0000000000..f666e966cb --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.RenamedFrom.V2 +{ + public partial class RenamedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public RenamedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1, + /// The version v2. + V2 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/VersioningRenamedFromV2ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/VersioningRenamedFromV2ModelFactory.cs new file mode 100644 index 0000000000..78a40258b2 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/VersioningRenamedFromV2ModelFactory.cs @@ -0,0 +1,13 @@ +// + +#nullable disable + +using System; + +namespace Versioning.RenamedFrom.V2.Models +{ + public static partial class VersioningRenamedFromV2ModelFactory + { + public static NewModel NewModel(string newProp = default, NewEnum enumProp = default, BinaryData unionProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Versioning.RenamedFrom.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Versioning.RenamedFrom.V2.csproj new file mode 100644 index 0000000000..9e1bb09f6e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Versioning.RenamedFrom.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.RenamedFrom.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.RenamedFrom.V2 + 1.0.0-beta.1 + Versioning.RenamedFrom.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/tspCodeModel.json new file mode 100644 index 0000000000..95d7023057 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/tspCodeModel.json @@ -0,0 +1,534 @@ +{ + "$id": "1", + "Name": "Versioning.RenamedFrom", + "ApiVersions": [ + "v1", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "NewEnum", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewEnum", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "newEnumMember", + "value": "newEnumMember", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "decorators": [] + } + ], + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.Versions", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "description": "The version v1.", + "decorators": [] + }, + { + "$id": "10", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "11", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "6" + }, + "description": "The version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "12", + "kind": "model", + "name": "NewModel", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "13", + "kind": "property", + "name": "newProp", + "serializedName": "newProp", + "type": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewModel.newProp" + }, + { + "$id": "15", + "kind": "property", + "name": "enumProp", + "serializedName": "enumProp", + "type": { + "$ref": "2" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewModel.enumProp" + }, + { + "$id": "16", + "kind": "property", + "name": "unionProp", + "serializedName": "unionProp", + "type": { + "$id": "17", + "kind": "union", + "name": "NewUnion", + "variantTypes": [ + { + "$id": "18", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + { + "$id": "19", + "kind": "int32", + "name": "NewScalar", + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewScalar", + "baseType": { + "$id": "20", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "decorators": [] + } + ], + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.RenamedFrom.NewModel.unionProp" + } + ] + } + ], + "Clients": [ + { + "$id": "21", + "Name": "RenamedFromClient", + "Description": "Test for the `@renamedFrom` decorator.", + "Operations": [ + { + "$id": "22", + "Name": "newOp", + "ResourceName": "RenamedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "23", + "Name": "newQuery", + "NameInRequest": "newQuery", + "Type": { + "$id": "24", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "25", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "26", + "kind": "constant", + "valueType": { + "$id": "27", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "28", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "29", + "kind": "constant", + "valueType": { + "$id": "30", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "31", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "32", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "12" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/renamed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.RenamedFrom.newOp", + "Decorators": [] + } + ], + "Protocol": { + "$id": "33" + }, + "Parameters": [ + { + "$id": "34", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "35", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "36", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "6" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + }, + { + "$id": "37", + "Name": "NewInterface", + "Operations": [ + { + "$id": "38", + "Name": "newOpInNewInterface", + "ResourceName": "NewInterface", + "Accessibility": "public", + "Parameters": [ + { + "$id": "39", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "40", + "kind": "constant", + "valueType": { + "$id": "41", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "42", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "43", + "kind": "constant", + "valueType": { + "$id": "44", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "45", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "12" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "46", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "12" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/renamed-from/api-version:{version}", + "Path": "/interface/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.RenamedFrom.NewInterface.newOpInNewInterface", + "Decorators": [] + } + ], + "Protocol": { + "$id": "47" + }, + "Parent": "RenamedFromClient", + "Parameters": [ + { + "$id": "48", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "49", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "50", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "6" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Configuration.json new file mode 100644 index 0000000000..54a7c0ff83 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.ReturnTypeChangedFrom.V1", + "library-name": "Versioning.ReturnTypeChangedFrom.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Versioning.ReturnTypeChangedFrom.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Versioning.ReturnTypeChangedFrom.V1.sln new file mode 100644 index 0000000000..b908d244e8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/Versioning.ReturnTypeChangedFrom.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.ReturnTypeChangedFrom.V1", "src\Versioning.ReturnTypeChangedFrom.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs new file mode 100644 index 0000000000..9b9291ec28 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Versioning.ReturnTypeChangedFrom.V1 +{ + public partial class ReturnTypeChangedFromClient + { + protected ReturnTypeChangedFromClient() => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint) : this(endpoint, new ReturnTypeChangedFromClientOptions()) => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(string body) => throw null; + + public virtual Task> TestAsync(string body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs new file mode 100644 index 0000000000..99f5fb8d6e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.ReturnTypeChangedFrom.V1 +{ + public partial class ReturnTypeChangedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public ReturnTypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Versioning.ReturnTypeChangedFrom.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Versioning.ReturnTypeChangedFrom.V1.csproj new file mode 100644 index 0000000000..ed95167e9e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Versioning.ReturnTypeChangedFrom.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.ReturnTypeChangedFrom.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.ReturnTypeChangedFrom.V1 + 1.0.0-beta.1 + Versioning.ReturnTypeChangedFrom.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/tspCodeModel.json new file mode 100644 index 0000000000..61dcea416a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/tspCodeModel.json @@ -0,0 +1,219 @@ +{ + "$id": "1", + "Name": "Versioning.ReturnTypeChangedFrom", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.ReturnTypeChangedFrom.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [], + "Clients": [ + { + "$id": "6", + "Name": "ReturnTypeChangedFromClient", + "Description": "Test for the `@returnTypeChangedFrom` decorator.", + "Operations": [ + { + "$id": "7", + "Name": "test", + "ResourceName": "ReturnTypeChangedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "8", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "9", + "kind": "constant", + "valueType": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "11", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "12", + "kind": "constant", + "valueType": { + "$id": "13", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "14", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "16", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "17", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Text", + "Uri": "{endpoint}/versioning/return-type-changed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.ReturnTypeChangedFrom.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "18" + }, + "Parameters": [ + { + "$id": "19", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "20", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "21", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Configuration.json new file mode 100644 index 0000000000..1801b0a8a5 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.ReturnTypeChangedFrom.V2", + "library-name": "Versioning.ReturnTypeChangedFrom.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Versioning.ReturnTypeChangedFrom.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Versioning.ReturnTypeChangedFrom.V2.sln new file mode 100644 index 0000000000..2a5767f4e3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/Versioning.ReturnTypeChangedFrom.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.ReturnTypeChangedFrom.V2", "src\Versioning.ReturnTypeChangedFrom.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs new file mode 100644 index 0000000000..6210793c43 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs @@ -0,0 +1,31 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace Versioning.ReturnTypeChangedFrom.V2 +{ + public partial class ReturnTypeChangedFromClient + { + protected ReturnTypeChangedFromClient() => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint) : this(endpoint, new ReturnTypeChangedFromClientOptions()) => throw null; + + public ReturnTypeChangedFromClient(Uri endpoint, ReturnTypeChangedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(string body) => throw null; + + public virtual Task> TestAsync(string body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs new file mode 100644 index 0000000000..800d45414c --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.ReturnTypeChangedFrom.V2 +{ + public partial class ReturnTypeChangedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public ReturnTypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1, + /// The version v2. + V2 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Versioning.ReturnTypeChangedFrom.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Versioning.ReturnTypeChangedFrom.V2.csproj new file mode 100644 index 0000000000..19102843c9 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Versioning.ReturnTypeChangedFrom.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.ReturnTypeChangedFrom.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.ReturnTypeChangedFrom.V2 + 1.0.0-beta.1 + Versioning.ReturnTypeChangedFrom.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/tspCodeModel.json new file mode 100644 index 0000000000..4e307e361d --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/tspCodeModel.json @@ -0,0 +1,238 @@ +{ + "$id": "1", + "Name": "Versioning.ReturnTypeChangedFrom", + "ApiVersions": [ + "v1", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.ReturnTypeChangedFrom.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [], + "Clients": [ + { + "$id": "8", + "Name": "ReturnTypeChangedFromClient", + "Description": "Test for the `@returnTypeChangedFrom` decorator.", + "Operations": [ + { + "$id": "9", + "Name": "test", + "ResourceName": "ReturnTypeChangedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "10", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "11", + "kind": "constant", + "valueType": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "13", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "14", + "kind": "constant", + "valueType": { + "$id": "15", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "16", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "18", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Text", + "Uri": "{endpoint}/versioning/return-type-changed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.ReturnTypeChangedFrom.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "20" + }, + "Parameters": [ + { + "$id": "21", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "22", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "23", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Configuration.json new file mode 100644 index 0000000000..43edb1a33e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.TypeChangedFrom.V1", + "library-name": "Versioning.TypeChangedFrom.V1", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Versioning.TypeChangedFrom.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Versioning.TypeChangedFrom.V1.sln new file mode 100644 index 0000000000..767110f9be --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/Versioning.TypeChangedFrom.V1.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.TypeChangedFrom.V1", "src\Versioning.TypeChangedFrom.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.Serialization.cs new file mode 100644 index 0000000000..885d18dcb4 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.TypeChangedFrom.V1.Models +{ + public partial class TestModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + TestModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + TestModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(TestModel testModel) => throw null; + + public static explicit operator TestModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.cs new file mode 100644 index 0000000000..1f103a30b8 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/Models/TestModel.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.TypeChangedFrom.V1.Models +{ + public partial class TestModel + { + public TestModel(string prop, int changedProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public int ChangedProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs new file mode 100644 index 0000000000..9fe1dab017 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs @@ -0,0 +1,32 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.TypeChangedFrom.V1.Models; + +namespace Versioning.TypeChangedFrom.V1 +{ + public partial class TypeChangedFromClient + { + protected TypeChangedFromClient() => throw null; + + public TypeChangedFromClient(Uri endpoint) : this(endpoint, new TypeChangedFromClientOptions()) => throw null; + + public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(BinaryContent content, int @param, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(BinaryContent content, int @param, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(TestModel body, int @param) => throw null; + + public virtual Task> TestAsync(TestModel body, int @param, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs new file mode 100644 index 0000000000..517b7fd75a --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClientOptions.cs @@ -0,0 +1,21 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.TypeChangedFrom.V1 +{ + public partial class TypeChangedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V1; + + public TypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/VersioningTypeChangedFromV1ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/VersioningTypeChangedFromV1ModelFactory.cs new file mode 100644 index 0000000000..791f334b85 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/VersioningTypeChangedFromV1ModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Versioning.TypeChangedFrom.V1.Models +{ + public static partial class VersioningTypeChangedFromV1ModelFactory + { + public static TestModel TestModel(string prop = default, int changedProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Versioning.TypeChangedFrom.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Versioning.TypeChangedFrom.V1.csproj new file mode 100644 index 0000000000..b2a9feb3d0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Versioning.TypeChangedFrom.V1.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.TypeChangedFrom.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.TypeChangedFrom.V1 + 1.0.0-beta.1 + Versioning.TypeChangedFrom.V1 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/tspCodeModel.json new file mode 100644 index 0000000000..d127fe74bf --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/tspCodeModel.json @@ -0,0 +1,281 @@ +{ + "$id": "1", + "Name": "Versioning.TypeChangedFrom", + "ApiVersions": [ + "v1" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "6", + "kind": "model", + "name": "TestModel", + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "7", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "8", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel.prop" + }, + { + "$id": "9", + "kind": "property", + "name": "changedProp", + "serializedName": "changedProp", + "type": { + "$id": "10", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel.changedProp" + } + ] + } + ], + "Clients": [ + { + "$id": "11", + "Name": "TypeChangedFromClient", + "Description": "Test for the `@typeChangedFrom` decorator.", + "Operations": [ + { + "$id": "12", + "Name": "test", + "ResourceName": "TypeChangedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "13", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "14", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "15", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "16", + "kind": "constant", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "18", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "19", + "kind": "constant", + "valueType": { + "$id": "20", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "21", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "6" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "22", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "6" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/type-changed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.TypeChangedFrom.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "23" + }, + "Parameters": [ + { + "$id": "24", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "25", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "26", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Configuration.json new file mode 100644 index 0000000000..102113a4b3 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Versioning.TypeChangedFrom.V2", + "library-name": "Versioning.TypeChangedFrom.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Versioning.TypeChangedFrom.V2.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Versioning.TypeChangedFrom.V2.sln new file mode 100644 index 0000000000..df0fdc64bd --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/Versioning.TypeChangedFrom.V2.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Versioning.TypeChangedFrom.V2", "src\Versioning.TypeChangedFrom.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.Serialization.cs new file mode 100644 index 0000000000..97154287b7 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.Serialization.cs @@ -0,0 +1,36 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Versioning.TypeChangedFrom.V2.Models +{ + public partial class TestModel : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; + + TestModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; + + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; + + TestModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; + + protected virtual TestModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; + + public static implicit operator BinaryContent(TestModel testModel) => throw null; + + public static explicit operator TestModel(ClientResult result) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.cs new file mode 100644 index 0000000000..4312b1165b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/Models/TestModel.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +namespace Versioning.TypeChangedFrom.V2.Models +{ + public partial class TestModel + { + public TestModel(string prop, string changedProp) => throw null; + + public string Prop + { + get => throw null; + set => throw null; + } + + public string ChangedProp + { + get => throw null; + set => throw null; + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs new file mode 100644 index 0000000000..90ad3cde4e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs @@ -0,0 +1,32 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Versioning.TypeChangedFrom.V2.Models; + +namespace Versioning.TypeChangedFrom.V2 +{ + public partial class TypeChangedFromClient + { + protected TypeChangedFromClient() => throw null; + + public TypeChangedFromClient(Uri endpoint) : this(endpoint, new TypeChangedFromClientOptions()) => throw null; + + public TypeChangedFromClient(Uri endpoint, TypeChangedFromClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult Test(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual Task TestAsync(string @param, BinaryContent content, RequestOptions options = null) => throw null; + + public virtual ClientResult Test(string @param, TestModel body) => throw null; + + public virtual Task> TestAsync(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs new file mode 100644 index 0000000000..02a531c3d0 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClientOptions.cs @@ -0,0 +1,23 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace Versioning.TypeChangedFrom.V2 +{ + public partial class TypeChangedFromClientOptions : ClientPipelineOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2; + + public TypeChangedFromClientOptions(ServiceVersion version = LatestVersion) => throw null; + + public enum ServiceVersion + { + /// The version v1. + V1 = 1, + /// The version v2. + V2 = 2 + } + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/VersioningTypeChangedFromV2ModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/VersioningTypeChangedFromV2ModelFactory.cs new file mode 100644 index 0000000000..403986f012 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/VersioningTypeChangedFromV2ModelFactory.cs @@ -0,0 +1,11 @@ +// + +#nullable disable + +namespace Versioning.TypeChangedFrom.V2.Models +{ + public static partial class VersioningTypeChangedFromV2ModelFactory + { + public static TestModel TestModel(string prop = default, string changedProp = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Versioning.TypeChangedFrom.V2.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Versioning.TypeChangedFrom.V2.csproj new file mode 100644 index 0000000000..a16da8eaab --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Versioning.TypeChangedFrom.V2.csproj @@ -0,0 +1,16 @@ + + + This is the Versioning.TypeChangedFrom.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Versioning.TypeChangedFrom.V2 + 1.0.0-beta.1 + Versioning.TypeChangedFrom.V2 + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/tspCodeModel.json new file mode 100644 index 0000000000..710a591393 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/tspCodeModel.json @@ -0,0 +1,300 @@ +{ + "$id": "1", + "Name": "Versioning.TypeChangedFrom", + "ApiVersions": [ + "v1", + "v2" + ], + "Enums": [ + { + "$id": "2", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.Versions", + "valueType": { + "$id": "3", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "4", + "kind": "enumvalue", + "name": "v1", + "value": "v1", + "valueType": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v1.", + "decorators": [] + }, + { + "$id": "6", + "kind": "enumvalue", + "name": "v2", + "value": "v2", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "enumType": { + "$ref": "2" + }, + "description": "The version v2.", + "decorators": [] + } + ], + "description": "The version of the API.", + "isFixed": true, + "isFlags": false, + "usage": "Input,ApiVersionEnum", + "decorators": [] + } + ], + "Models": [ + { + "$id": "8", + "kind": "model", + "name": "TestModel", + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel", + "usage": "Input,Output,Json", + "decorators": [], + "properties": [ + { + "$id": "9", + "kind": "property", + "name": "prop", + "serializedName": "prop", + "type": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel.prop" + }, + { + "$id": "11", + "kind": "property", + "name": "changedProp", + "serializedName": "changedProp", + "type": { + "$id": "12", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Versioning.TypeChangedFrom.TestModel.changedProp" + } + ] + } + ], + "Clients": [ + { + "$id": "13", + "Name": "TypeChangedFromClient", + "Description": "Test for the `@typeChangedFrom` decorator.", + "Operations": [ + { + "$id": "14", + "Name": "test", + "ResourceName": "TypeChangedFrom", + "Accessibility": "public", + "Parameters": [ + { + "$id": "15", + "Name": "param", + "NameInRequest": "param", + "Type": { + "$id": "16", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Query", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "17", + "Name": "contentType", + "NameInRequest": "Content-Type", + "Description": "Body parameter's content type. Known values are application/json", + "Type": { + "$id": "18", + "kind": "constant", + "valueType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": true, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "20", + "Name": "accept", + "NameInRequest": "Accept", + "Type": { + "$id": "21", + "kind": "constant", + "valueType": { + "$id": "22", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Constant", + "Decorators": [], + "SkipUrlEncoding": false + }, + { + "$id": "23", + "Name": "body", + "NameInRequest": "body", + "Type": { + "$ref": "8" + }, + "Location": "Body", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": true, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "24", + "StatusCodes": [ + 200 + ], + "BodyType": { + "$ref": "8" + }, + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false, + "ContentTypes": [ + "application/json" + ] + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "Json", + "Uri": "{endpoint}/versioning/type-changed-from/api-version:{version}", + "Path": "/test", + "RequestMediaTypes": [ + "application/json" + ], + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "Versioning.TypeChangedFrom.test", + "Decorators": [] + } + ], + "Protocol": { + "$id": "25" + }, + "Parameters": [ + { + "$id": "26", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Need to be set as 'http://localhost:3000' in client.", + "Type": { + "$id": "27", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + }, + { + "$id": "28", + "Name": "version", + "NameInRequest": "version", + "Description": "Need to be set as 'v1' or 'v2' in client.", + "Type": { + "$ref": "2" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": false, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client" + } + ], + "Decorators": [] + } + ] +} From 7d0e580b597fb155f4cc5aa2dbb0c1b1189bc329 Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:58:08 +0800 Subject: [PATCH 21/71] http-client-java, remove extra shadowing if all polymorphic models are in the same package (#5259) Remove the need to check `share-jsonserializable-code` setting for determining whether to shadow parent read-only(effectively) properties for JSON deserialization. Should fix unnecessary read-only properties shadowing: https://apiview.dev/Assemblies/Review/2f43d81416e14779ac541fb65815d80c/c574461c3ae8458b981cdff776dde19a#com.azure.messaging.eventgrid.systemevents.AcsChatMessageDeletedEventData.public-String-getMessageId%28%29 --- .../StreamSerializationModelTemplate.java | 8 +- .../generator/core/util/ClientModelUtil.java | 13 +- .../fluent/models/OutputOnlyModelInner.java | 10 ++ .../models/OutputOnlyModelProperties.java | 24 +++ .../implementation/OutputOnlyModelImpl.java | 5 + .../models/Dog.java | 163 ++++++++++++++++++ .../models/DogKind.java | 46 +++++ .../models/Golden.java | 89 ++++++++++ .../models/OutputOnlyModel.java | 7 + .../models/OutputOnlyModelChild.java | 9 + .../tsp/arm-stream-style-serialization.tsp | 29 ++++ 11 files changed, 395 insertions(+), 8 deletions(-) create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/Dog.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/DogKind.java create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/Golden.java diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java index c9c9d6d530..53cc20f72f 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java @@ -247,7 +247,7 @@ protected List getFieldProperties(ClientModelPropertiesMana // If the model is polymorphic and all the models in the polymorphic hierarchy are in the same package we don't // need to shade parent properties. - if (canUseFromJsonShared(propertiesManager)) { + if (propertiesManager.getModel().isAllPolymorphicModelsInSamePackage()) { return fieldProperties; } @@ -1893,8 +1893,10 @@ private void handleSettingDeserializedValue(JavaBlock methodBlock, ClientModelPr // If the property is defined in a super class use the setter as this will be able to set the value in the // super class. if (fromSuper - // If the property is flattened or read-only from parent, it will be shadowed in child class. - && (!ClientModelUtil.readOnlyNotInCtor(model, property, settings) && !property.getClientFlatten())) { + // If the property is flattened or read-only from parent, and not all polymorphic models are in the same + // package, it will be shadowed in child class. + && (!ClientModelUtil.readOnlyNotInCtor(model, property, settings) && !property.getClientFlatten() + || model.isAllPolymorphicModelsInSamePackage())) { if (model.isPolymorphic() && isJsonMergePatchModel) { // Polymorphic JSON merge patch needs special handling as the setter methods are used to track // whether diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java index 6df46e1d80..db879063ea 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/ClientModelUtil.java @@ -867,12 +867,15 @@ public static ClientModel getDefiningModel(ClientModel model, ClientModelPropert } public static boolean readOnlyNotInCtor(ClientModel model, ClientModelProperty property, JavaSettings settings) { - return // not required and in constructor - !(property.isRequired() && settings.isRequiredFieldsAsConstructorArgs()) && ( + return // must be read-only and not appear in constructor - (property.isReadOnly() && !settings.isIncludeReadOnlyInConstructorArgs()) - // immutable output model only has package-private setters, making its properties read-only - || isImmutableOutputModel(getDefiningModel(model, property), settings)); + ((property.isReadOnly() && !settings.isIncludeReadOnlyInConstructorArgs()) + // immutable output model only has package-private setters, making its properties effectively read-only + || (isImmutableOutputModel(getDefiningModel(model, property), settings)) + // if property.isReadOnly(), whether it's required or not will not affect it being in constructor or not + // , thus only check when !property.isReadOnly() and the model is immutable output(effectively + // read-only) + && !(property.isRequired() && settings.isRequiredFieldsAsConstructorArgs())); } /** diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelInner.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelInner.java index 8d779f9162..1d9b5c88a9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelInner.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelInner.java @@ -11,6 +11,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import tsptest.armstreamstyleserialization.models.Dog; import tsptest.armstreamstyleserialization.models.OutputOnlyModelChild; /** @@ -122,6 +123,15 @@ public String title() { return this.innerProperties() == null ? null : this.innerProperties().title(); } + /** + * Get the dog property: The dog property. + * + * @return the dog value. + */ + public Dog dog() { + return this.innerProperties() == null ? null : this.innerProperties().dog(); + } + /** * Validates the instance. * diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelProperties.java index 11bb060faa..446a313d82 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelProperties.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/fluent/models/OutputOnlyModelProperties.java @@ -11,6 +11,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import tsptest.armstreamstyleserialization.models.Dog; /** * The OutputOnlyModelProperties model. @@ -22,6 +23,11 @@ public final class OutputOnlyModelProperties implements JsonSerializable { + /* + * discriminator property + */ + private DogKind kind = DogKind.fromString("Dog"); + + /* + * Weight of the dog + */ + private int weight; + + /* + * dna of the dog + */ + private String dna; + + /** + * Creates an instance of Dog class. + */ + protected Dog() { + } + + /** + * Get the kind property: discriminator property. + * + * @return the kind value. + */ + public DogKind kind() { + return this.kind; + } + + /** + * Get the weight property: Weight of the dog. + * + * @return the weight value. + */ + public int weight() { + return this.weight; + } + + /** + * Set the weight property: Weight of the dog. + * + * @param weight the weight value to set. + * @return the Dog object itself. + */ + Dog withWeight(int weight) { + this.weight = weight; + return this; + } + + /** + * Get the dna property: dna of the dog. + * + * @return the dna value. + */ + public String dna() { + return this.dna; + } + + /** + * Set the dna property: dna of the dog. + * + * @param dna the dna value to set. + * @return the Dog object itself. + */ + Dog withDna(String dna) { + this.dna = dna; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("weight", this.weight); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dog from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dog if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dog. + */ + public static Dog fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("golden".equals(discriminatorValue)) { + return Golden.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static Dog fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Dog deserializedDog = new Dog(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("weight".equals(fieldName)) { + deserializedDog.weight = reader.getInt(); + } else if ("dna".equals(fieldName)) { + deserializedDog.dna = reader.getString(); + } else if ("kind".equals(fieldName)) { + deserializedDog.kind = DogKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDog; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/DogKind.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/DogKind.java new file mode 100644 index 0000000000..92d015749b --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/DogKind.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.armstreamstyleserialization.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * extensible enum type for discriminator. + */ +public final class DogKind extends ExpandableStringEnum { + /** + * Species golden. + */ + public static final DogKind GOLDEN = fromString("golden"); + + /** + * Creates a new instance of DogKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DogKind() { + } + + /** + * Creates or finds a DogKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding DogKind. + */ + public static DogKind fromString(String name) { + return fromString(name, DogKind.class); + } + + /** + * Gets known DogKind values. + * + * @return known DogKind values. + */ + public static Collection values() { + return values(DogKind.class); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/Golden.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/Golden.java new file mode 100644 index 0000000000..09e38f38c3 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/Golden.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package tsptest.armstreamstyleserialization.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Golden dog model. + */ +@Immutable +public final class Golden extends Dog { + /* + * discriminator property + */ + private DogKind kind = DogKind.GOLDEN; + + /** + * Creates an instance of Golden class. + */ + private Golden() { + } + + /** + * Get the kind property: discriminator property. + * + * @return the kind value. + */ + @Override + public DogKind kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("weight", weight()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Golden from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Golden if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Golden. + */ + public static Golden fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Golden deserializedGolden = new Golden(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("weight".equals(fieldName)) { + deserializedGolden.withWeight(reader.getInt()); + } else if ("dna".equals(fieldName)) { + deserializedGolden.withDna(reader.getString()); + } else if ("kind".equals(fieldName)) { + deserializedGolden.kind = DogKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGolden; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModel.java index de152c8715..3c3ef65e3f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModel.java @@ -38,6 +38,13 @@ public interface OutputOnlyModel { */ String title(); + /** + * Gets the dog property: The dog property. + * + * @return the dog value. + */ + Dog dog(); + /** * Gets the inner tsptest.armstreamstyleserialization.fluent.models.OutputOnlyModelInner object. * diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModelChild.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModelChild.java index 0d85c1b340..056179369c 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModelChild.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armstreamstyleserialization/models/OutputOnlyModelChild.java @@ -106,6 +106,15 @@ public String title() { return this.innerProperties() == null ? null : this.innerProperties().title(); } + /** + * Get the dog property: The dog property. + * + * @return the dog value. + */ + public Dog dog() { + return this.innerProperties() == null ? null : this.innerProperties().dog(); + } + /** * Validates the instance. * diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/arm-stream-style-serialization.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/arm-stream-style-serialization.tsp index c676782c40..f1474895f2 100644 --- a/packages/http-client-java/generator/http-client-generator-test/tsp/arm-stream-style-serialization.tsp +++ b/packages/http-client-java/generator/http-client-generator-test/tsp/arm-stream-style-serialization.tsp @@ -158,6 +158,35 @@ model OutputOnlyModel { model OutputOnlyModelProperties { title: string; + dog: Dog; +} + +@doc("extensible enum type for discriminator") +union DogKind { + string, + + @doc("Species golden") + Golden: "golden", +} + +@doc("Test extensible enum type for discriminator") +@discriminator("kind") +model Dog { + @doc("discriminator property") + kind: DogKind; + + @doc("Weight of the dog") + weight: int32; + + @doc("dna of the dog") + @visibility("read") + dna: string; +} + +@doc("Golden dog model") +model Golden extends Dog { + @doc("discriminator property") + kind: DogKind.Golden; } model OutputOnlyModelChild extends OutputOnlyModel { From 1d13279fe70fa4ba93aa6f7088c5bb2070b02184 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 6 Dec 2024 15:11:02 +0800 Subject: [PATCH 22/71] http-client-java, add HttpLoggingPolicy to unbranded (#5281) The reason we didn't have it before, is likely that this HttpLoggingPolicy class was not public in clientcore. --- .../client/generator/core/model/clientmodel/ClassType.java | 4 ++++ .../generator/core/model/clientmodel/ServiceClient.java | 5 +++-- .../core/template/ServiceClientBuilderTemplate.java | 3 +-- .../http/client/generator/core/template/TemplateHelper.java | 1 + 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java index 3eb82508c0..0477cfebbd 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java @@ -27,6 +27,7 @@ import com.azure.core.http.ProxyOptions; import com.azure.core.http.RequestConditions; import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.KeyCredentialPolicy; import com.azure.core.http.policy.RedirectPolicy; @@ -121,6 +122,8 @@ public String getGenericClass() { new ClassDetails(RetryPolicy.class, "io.clientcore.core.http.pipeline.HttpRetryPolicy")); put(RedirectPolicy.class, new ClassDetails(RedirectPolicy.class, "io.clientcore.core.http.pipeline.HttpRedirectPolicy")); + put(HttpLoggingPolicy.class, + new ClassDetails(HttpLoggingPolicy.class, "io.clientcore.core.http.pipeline.HttpLoggingPolicy")); put(Configuration.class, new ClassDetails(Configuration.class, "io.clientcore.core.util.configuration.Configuration")); put(HttpHeaders.class, new ClassDetails(HttpHeaders.class, "io.clientcore.core.models.Headers")); @@ -486,6 +489,7 @@ private static ClassType.Builder getClassTypeBuilder(Class classKey) { public static final ClassType RETRY_POLICY = getClassTypeBuilder(RetryPolicy.class).build(); public static final ClassType REDIRECT_POLICY = getClassTypeBuilder(RedirectPolicy.class).build(); + public static final ClassType HTTP_LOGGING_POLICY = getClassTypeBuilder(HttpLoggingPolicy.class).build(); public static final ClassType RETRY_OPTIONS = getClassTypeBuilder(RetryOptions.class).build(); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ServiceClient.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ServiceClient.java index 111cbb8352..f28e6190ed 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ServiceClient.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ServiceClient.java @@ -3,6 +3,7 @@ package com.microsoft.typespec.http.client.generator.core.model.clientmodel; +import com.azure.core.http.policy.UserAgentPolicy; import com.microsoft.typespec.http.client.generator.core.extension.plugin.JavaSettings; import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; import java.util.Collections; @@ -361,9 +362,9 @@ protected void addRestProxyImport(Set imports) { } protected void addHttpPolicyImports(Set imports) { + ClassType.RETRY_POLICY.addImportsTo(imports, false); if (JavaSettings.getInstance().isBranded()) { - imports.add("com.azure.core.http.policy.RetryPolicy"); - imports.add("com.azure.core.http.policy.UserAgentPolicy"); + imports.add(UserAgentPolicy.class.getName()); } } diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientBuilderTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientBuilderTemplate.java index f892d31046..63c2f8fe86 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientBuilderTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientBuilderTemplate.java @@ -9,7 +9,6 @@ import com.azure.core.http.policy.AddHeadersPolicy; import com.azure.core.http.policy.AzureKeyCredentialPolicy; import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; -import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; import com.azure.core.util.CoreUtils; @@ -523,7 +522,7 @@ protected void addHttpPolicyImports(Set imports) { imports.add(HttpPolicyProviders.class.getName()); ClassType.HTTP_PIPELINE_POLICY.addImportsTo(imports, false); - imports.add(HttpLoggingPolicy.class.getName()); + ClassType.HTTP_LOGGING_POLICY.addImportsTo(imports, false); imports.add(AddHeadersPolicy.class.getName()); imports.add(RequestIdPolicy.class.getName()); imports.add(AddHeadersFromContextPolicy.class.getName()); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/TemplateHelper.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/TemplateHelper.java index 1bd39ae442..f465dd1082 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/TemplateHelper.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/TemplateHelper.java @@ -76,6 +76,7 @@ private static void createGenericHttpPipelineMethod(JavaSettings settings, Strin + "\", keyCredential, " + prefixExpr + "));"); }); } + function.line("policies.add(new HttpLoggingPolicy(%s));", localHttpLogOptionsName); function.line("httpPipelineBuilder.policies(policies.toArray(new HttpPipelinePolicy[0]));"); function.methodReturn("httpPipelineBuilder.build()"); } From 387606b63acdd67671ee347801e39ae0da3050f6 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Fri, 6 Dec 2024 15:28:54 +0800 Subject: [PATCH 23/71] [http-python-client] filter out credential that python does not support for now (#5282) fix: https://github.com/Azure/autorest.python/issues/2938 --- .../emitter/src/code-model.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/http-client-python/emitter/src/code-model.ts b/packages/http-client-python/emitter/src/code-model.ts index 8595637ebc..0199c7de21 100644 --- a/packages/http-client-python/emitter/src/code-model.ts +++ b/packages/http-client-python/emitter/src/code-model.ts @@ -2,6 +2,7 @@ import { SdkBasicServiceMethod, SdkClientType, SdkCredentialParameter, + SdkCredentialType, SdkEndpointParameter, SdkEndpointType, SdkLroPagingServiceMethod, @@ -10,6 +11,7 @@ import { SdkPagingServiceMethod, SdkServiceMethod, SdkServiceOperation, + SdkUnionType, UsageFlags, getCrossLanguagePackageId, isAzureCoreModel, @@ -109,6 +111,28 @@ function emitMethodParameter( return emitEndpointType(context, parameter.type); } } + // filter out credential that python does not support for now + if (parameter.kind === "credential") { + const filteredCredentialType = []; + const originalCredentialType = + parameter.type.kind === "union" ? parameter.type.variantTypes : [parameter.type]; + for (const credentialType of originalCredentialType) { + if ( + credentialType.scheme.type === "oauth2" || + credentialType.scheme.type === "http" || + (credentialType.scheme.type === "apiKey" && credentialType.scheme.in === "header") + ) { + filteredCredentialType.push(credentialType); + } + } + if (filteredCredentialType.length === 0) { + return []; + } else if (filteredCredentialType.length === 1) { + parameter.type = filteredCredentialType[0]; + } else { + (parameter.type as SdkUnionType).variantTypes = filteredCredentialType; + } + } const base = { ...emitParamBase(context, parameter), implementation: getImplementation(context, parameter), From 252b3dfe45a5ebc9cd04096c695e0caae654638f Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Fri, 6 Dec 2024 17:42:22 +0800 Subject: [PATCH 24/71] [http-client-python] refine exception handling logic (#5270) 1. add ranged status code support for exception 2. move customized exception handling logic from error map to exception handling 3. add `_failsafe_deserialize` function to provide fail saft deserialization for exception to support always return http response exception fix: https://github.com/Azure/autorest.python/issues/2937 fix: https://github.com/Azure/autorest.python/issues/2940 --- .../http-client-python/emitter/src/http.ts | 2 +- .../generator/pygen/codegen/__init__.py | 12 ++ .../pygen/codegen/models/model_type.py | 2 +- .../pygen/codegen/models/operation.py | 25 +-- .../pygen/codegen/models/response.py | 2 +- .../codegen/serializers/builder_serializer.py | 142 ++++++++++-------- .../codegen/templates/model_base.py.jinja2 | 17 +++ packages/http-client-python/package-lock.json | 4 +- 8 files changed, 119 insertions(+), 87 deletions(-) diff --git a/packages/http-client-python/emitter/src/http.ts b/packages/http-client-python/emitter/src/http.ts index ad62dd4082..cd2ae43904 100644 --- a/packages/http-client-python/emitter/src/http.ts +++ b/packages/http-client-python/emitter/src/http.ts @@ -379,7 +379,7 @@ function emitHttpResponse( headers: response.headers.map((x) => emitHttpResponseHeader(context, x)), statusCodes: typeof statusCodes === "object" - ? [(statusCodes as HttpStatusCodeRange).start] + ? [[(statusCodes as HttpStatusCodeRange).start, (statusCodes as HttpStatusCodeRange).end]] : statusCodes === "*" ? ["default"] : [statusCodes], diff --git a/packages/http-client-python/generator/pygen/codegen/__init__.py b/packages/http-client-python/generator/pygen/codegen/__init__.py index 11d829263c..1ab9bd6237 100644 --- a/packages/http-client-python/generator/pygen/codegen/__init__.py +++ b/packages/http-client-python/generator/pygen/codegen/__init__.py @@ -241,6 +241,16 @@ def _validate_code_model_options(self) -> None: if not self.options_retriever.is_azure_flavor and self.options_retriever.tracing: raise ValueError("Can only have tracing turned on for Azure SDKs.") + @staticmethod + def sort_exceptions(yaml_data: Dict[str, Any]) -> None: + for client in yaml_data["clients"]: + for group in client["operationGroups"]: + for operation in group["operations"]: + if not operation.get("exceptions"): + continue + # sort exceptions by status code, first single status code, then range, then default + operation["exceptions"] = sorted(operation["exceptions"], key=lambda x: 3 if x["statusCodes"][0] == "default" else (1 if isinstance(x["statusCodes"][0], int) else 2)) + @staticmethod def remove_cloud_errors(yaml_data: Dict[str, Any]) -> None: for client in yaml_data["clients"]: @@ -315,6 +325,8 @@ def process(self) -> bool: self._validate_code_model_options() options = self._build_code_model_options() yaml_data = self.get_yaml() + + self.sort_exceptions(yaml_data) if self.options_retriever.azure_arm: self.remove_cloud_errors(yaml_data) diff --git a/packages/http-client-python/generator/pygen/codegen/models/model_type.py b/packages/http-client-python/generator/pygen/codegen/models/model_type.py index 80e21252b4..09422a44e3 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/model_type.py +++ b/packages/http-client-python/generator/pygen/codegen/models/model_type.py @@ -348,7 +348,7 @@ def serialization_type(self) -> str: @property def instance_check_template(self) -> str: - return "isinstance({}, _model_base.Model)" + return "isinstance({}, " + f"_models.{self.name})" def imports(self, **kwargs: Any) -> FileImport: file_import = super().imports(**kwargs) diff --git a/packages/http-client-python/generator/pygen/codegen/models/operation.py b/packages/http-client-python/generator/pygen/codegen/models/operation.py index 06631ca907..0ce0c62aee 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/operation.py +++ b/packages/http-client-python/generator/pygen/codegen/models/operation.py @@ -9,6 +9,7 @@ List, Any, Optional, + Tuple, Union, TYPE_CHECKING, Generic, @@ -201,17 +202,11 @@ def default_error_deserialization(self) -> Optional[str]: exception_schema = default_exceptions[0].type if isinstance(exception_schema, ModelType): return exception_schema.type_annotation(skip_quote=True) - # in this case, it's just an AnyType - return "'object'" + return None @property def non_default_errors(self) -> List[Response]: - return [e for e in self.exceptions if "default" not in e.status_codes] - - @property - def non_default_error_status_codes(self) -> List[Union[str, int]]: - """Actually returns all of the status codes from exceptions (besides default)""" - return list(chain.from_iterable([error.status_codes for error in self.non_default_errors])) + return [e for e in self.exceptions if "default" not in e.status_codes and e.type and isinstance(e.type, ModelType)] def _imports_shared(self, async_mode: bool, **kwargs: Any) -> FileImport: # pylint: disable=unused-argument file_import = FileImport(self.code_model) @@ -344,19 +339,7 @@ def imports( # pylint: disable=too-many-branches, disable=too-many-statements file_import.add_submodule_import("exceptions", error, ImportType.SDKCORE) if self.code_model.options["azure_arm"]: file_import.add_submodule_import("azure.mgmt.core.exceptions", "ARMErrorFormat", ImportType.SDKCORE) - if self.non_default_errors: - file_import.add_submodule_import( - "typing", - "Type", - ImportType.STDLIB, - ) file_import.add_mutable_mapping_import() - if self.non_default_error_status_codes: - file_import.add_submodule_import( - "typing", - "cast", - ImportType.STDLIB, - ) if self.has_kwargs_to_pop_with_default( self.parameters.kwargs_to_pop, ParameterLocation.HEADER # type: ignore @@ -436,7 +419,7 @@ def imports( # pylint: disable=too-many-branches, disable=too-many-statements elif any(r.type for r in self.responses): file_import.add_submodule_import(f"{relative_path}_model_base", "_deserialize", ImportType.LOCAL) if self.default_error_deserialization or self.non_default_errors: - file_import.add_submodule_import(f"{relative_path}_model_base", "_deserialize", ImportType.LOCAL) + file_import.add_submodule_import(f"{relative_path}_model_base", "_failsafe_deserialize", ImportType.LOCAL) return file_import def get_response_from_status(self, status_code: Optional[Union[str, int]]) -> ResponseType: diff --git a/packages/http-client-python/generator/pygen/codegen/models/response.py b/packages/http-client-python/generator/pygen/codegen/models/response.py index 19a7d62e94..c36a98a371 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/response.py +++ b/packages/http-client-python/generator/pygen/codegen/models/response.py @@ -54,7 +54,7 @@ def __init__( type: Optional[BaseType] = None, ) -> None: super().__init__(yaml_data=yaml_data, code_model=code_model) - self.status_codes: List[Union[int, str]] = yaml_data["statusCodes"] + self.status_codes: List[Union[int, str, List[int]]] = yaml_data["statusCodes"] self.headers = headers or [] self.type = type self.nullable = yaml_data.get("nullable") diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py b/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py index de7d6c2086..34924397e1 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py @@ -61,14 +61,6 @@ def _all_same(data: List[List[str]]) -> bool: return len(data) > 1 and all(sorted(data[0]) == sorted(data[i]) for i in range(1, len(data))) -def _need_type_ignore(builder: OperationType) -> bool: - for e in builder.non_default_errors: - for status_code in e.status_codes: - if status_code in (401, 404, 409, 304): - return True - return False - - def _xml_config(send_xml: bool, content_types: List[str]) -> str: if not (send_xml and "xml" in str(content_types)): return "" @@ -999,20 +991,80 @@ def handle_error_response(self, builder: OperationType) -> List[str]: elif isinstance(builder.stream_value, str): # _stream is not sure, so we need to judge it retval.append(" if _stream:") retval.extend([f" {l}" for l in response_read]) - type_ignore = " # type: ignore" if _need_type_ignore(builder) else "" retval.append( - f" map_error(status_code=response.status_code, response=response, error_map=error_map){type_ignore}" + f" map_error(status_code=response.status_code, response=response, error_map=error_map)" ) error_model = "" + if builder.non_default_errors and self.code_model.options["models_mode"]: + error_model = ", model=error" + condition = "if" + retval.append(" error = None") + for e in builder.non_default_errors: + # single status code + if isinstance(e.status_codes[0], int): + for status_code in e.status_codes: + retval.append(f" {condition} response.status_code == {status_code}:") + if self.code_model.options["models_mode"] == "dpg": + retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") + else: + retval.append( + f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " + "pipeline_response)" + ) + # add build-in error type + # TODO: we should decide whether need to this wrapper for customized error type + if status_code == 401: + retval.append( + " raise ClientAuthenticationError(response=response{}{})".format( + error_model, + (", error_format=ARMErrorFormat" if self.code_model.options["azure_arm"] else ""), + ) + ) + elif status_code == 404: + retval.append( + " raise ResourceNotFoundError(response=response{}{})".format( + error_model, + (", error_format=ARMErrorFormat" if self.code_model.options["azure_arm"] else ""), + ) + ) + elif status_code == 409: + retval.append( + " raise ResourceExistsError(response=response{}{})".format( + error_model, + (", error_format=ARMErrorFormat" if self.code_model.options["azure_arm"] else ""), + ) + ) + elif status_code == 304: + retval.append( + " raise ResourceNotModifiedError(response=response{}{})".format( + error_model, + (", error_format=ARMErrorFormat" if self.code_model.options["azure_arm"] else ""), + ) + ) + # ranged status code only exist in typespec and will not have multiple status codes + else: + retval.append(f" {condition} {e.status_codes[0][0]} <= response.status_code <= {e.status_codes[0][1]}:") + if self.code_model.options["models_mode"] == "dpg": + retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") + else: + retval.append( + f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " + "pipeline_response)" + ) + condition = "elif" + # default error handling if builder.default_error_deserialization and self.code_model.options["models_mode"]: + error_model = ", model=error" + indent = " " if builder.non_default_errors else " " + if builder.non_default_errors: + retval.append(" else:") if self.code_model.options["models_mode"] == "dpg": - retval.append(f" error = _deserialize({builder.default_error_deserialization}, response.json())") + retval.append(f"{indent}error = _failsafe_deserialize({builder.default_error_deserialization}, response.json())") else: retval.append( - f" error = self._deserialize.failsafe_deserialize({builder.default_error_deserialization}, " + f"{indent}error = self._deserialize.failsafe_deserialize({builder.default_error_deserialization}, " "pipeline_response)" ) - error_model = ", model=error" retval.append( " raise HttpResponseError(response=response{}{})".format( error_model, @@ -1085,60 +1137,28 @@ def handle_response(self, builder: OperationType) -> List[str]: retval.append("return 200 <= response.status_code <= 299") return retval + def _need_specific_error_map(self, code: int, builder: OperationType) -> bool: + for non_default_error in builder.non_default_errors: + # single status code + if code in non_default_error.status_codes: + return False + # ranged status code + if isinstance(non_default_error.status_codes[0], list) and non_default_error.status_codes[0][0] <= code <= non_default_error.status_codes[0][1]: + return False + return True + def error_map(self, builder: OperationType) -> List[str]: retval = ["error_map: MutableMapping = {"] - if builder.non_default_errors: - if not 401 in builder.non_default_error_status_codes: + if builder.non_default_errors and self.code_model.options["models_mode"]: + # TODO: we should decide whether to add the build-in error map when there is a customized default error type + if self._need_specific_error_map(401, builder): retval.append(" 401: ClientAuthenticationError,") - if not 404 in builder.non_default_error_status_codes: + if self._need_specific_error_map(404, builder): retval.append(" 404: ResourceNotFoundError,") - if not 409 in builder.non_default_error_status_codes: + if self._need_specific_error_map(409, builder): retval.append(" 409: ResourceExistsError,") - if not 304 in builder.non_default_error_status_codes: + if self._need_specific_error_map(304, builder): retval.append(" 304: ResourceNotModifiedError,") - for e in builder.non_default_errors: - error_model_str = "" - if isinstance(e.type, ModelType): - if self.code_model.options["models_mode"] == "msrest": - error_model_str = ( - f", model=self._deserialize(" f"_models.{e.type.serialization_type}, response)" - ) - elif self.code_model.options["models_mode"] == "dpg": - error_model_str = f", model=_deserialize(_models.{e.type.name}, response.json())" - error_format_str = ", error_format=ARMErrorFormat" if self.code_model.options["azure_arm"] else "" - for status_code in e.status_codes: - if status_code == 401: - retval.append( - " 401: cast(Type[HttpResponseError], " - "lambda response: ClientAuthenticationError(response=response" - f"{error_model_str}{error_format_str}))," - ) - elif status_code == 404: - retval.append( - " 404: cast(Type[HttpResponseError], " - "lambda response: ResourceNotFoundError(response=response" - f"{error_model_str}{error_format_str}))," - ) - elif status_code == 409: - retval.append( - " 409: cast(Type[HttpResponseError], " - "lambda response: ResourceExistsError(response=response" - f"{error_model_str}{error_format_str}))," - ) - elif status_code == 304: - retval.append( - " 304: cast(Type[HttpResponseError], " - "lambda response: ResourceNotModifiedError(response=response" - f"{error_model_str}{error_format_str}))," - ) - elif not error_model_str and not error_format_str: - retval.append(f" {status_code}: HttpResponseError,") - else: - retval.append( - f" {status_code}: cast(Type[HttpResponseError], " - "lambda response: HttpResponseError(response=response" - f"{error_model_str}{error_format_str}))," - ) else: retval.append( " 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError, " diff --git a/packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 b/packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 index 2bea913ef3..fd2cbdedc1 100644 --- a/packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 +++ b/packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 @@ -892,6 +892,23 @@ def _deserialize( return _deserialize_with_callable(deserializer, value) +def _failsafe_deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, value, module, rf, format) + except DeserializationError: + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", + exc_info=True + ) + return None + + class _RestField: def __init__( self, diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index 500223ac08..9921931204 100644 --- a/packages/http-client-python/package-lock.json +++ b/packages/http-client-python/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-python", - "version": "0.3.9", + "version": "0.3.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.3.9", + "version": "0.3.12", "hasInstallScript": true, "license": "MIT", "dependencies": { From 6fc24841fba1e1f9b63bfe7e30a3a79d109f91ef Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:47:31 +0800 Subject: [PATCH 25/71] http-client-java, fix expandable enum `equals` (#5283) Bug found in deserialization mock test: https://dev.azure.com/azure-sdk/public/_build/results?buildId=4390469&view=logs&jobId=1ddb3322-d991-5251-324c-57ed6980c710&j=1ddb3322-d991-5251-324c-57ed6980c710&t=0da78e2d-17fd-5004-a494-748a34fd2ecc Fluent lite packages will experience generation failure, thus already released packages should be good. Premium packages are generated with `ExpandableStringEnum`, thus not affected as well. Not sure about DPG packages. I've not yet seen any released packages with ExpandableEnum. --- .../client/generator/core/template/EnumTemplate.java | 9 +++++---- .../armresourceprovider/models/PriorityModel.java | 11 +++++------ .../enumservice/models/OlympicRecordModel.java | 11 +++++------ .../tsptest/enumservice/models/PriorityModel.java | 11 +++++------ .../src/test/java/tsptest/enumservice/EnumTests.java | 10 ++++++++++ 5 files changed, 30 insertions(+), 22 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java index d7fbac8ba4..f75dd15152 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java @@ -67,6 +67,7 @@ protected void writeBrandedExpandableEnum(EnumType enumType, JavaFile javaFile, imports.add("java.util.ArrayList"); imports.add("java.util.Objects"); imports.add(ClassType.EXPANDABLE_ENUM.getFullName()); + imports.add("java.util.function.Function"); if (!settings.isStreamStyleSerialization()) { imports.add("com.fasterxml.jackson.annotation.JsonCreator"); } @@ -84,6 +85,8 @@ protected void writeBrandedExpandableEnum(EnumType enumType, JavaFile javaFile, javaFile.publicFinalClass(declaration, classBlock -> { classBlock.privateStaticFinalVariable( String.format("Map<%1$s, %2$s> VALUES = new ConcurrentHashMap<>()", pascalTypeName, enumName)); + classBlock.privateStaticFinalVariable( + String.format("Function<%1$s, %2$s> NEW_INSTANCE = %2$s::new", pascalTypeName, enumName)); for (ClientEnumValue enumValue : enumType.getValues()) { String value = enumValue.getValue(); @@ -115,9 +118,7 @@ protected void writeBrandedExpandableEnum(EnumType enumType, JavaFile javaFile, classBlock.publicStaticMethod(String.format("%1$s fromValue(%2$s value)", enumName, pascalTypeName), function -> { function.line("Objects.requireNonNull(value, \"'value' cannot be null.\");"); - function.line(enumName + " member = VALUES.get(value);"); - function.ifBlock("member != null", ifAction -> ifAction.line("return member;")); - function.methodReturn("VALUES.computeIfAbsent(value, key -> new " + enumName + "(key))"); + function.methodReturn("VALUES.computeIfAbsent(value, NEW_INSTANCE)"); }); // values @@ -150,7 +151,7 @@ protected void writeBrandedExpandableEnum(EnumType enumType, JavaFile javaFile, addGeneratedAnnotation(classBlock); classBlock.annotation("Override"); classBlock.method(JavaVisibility.Public, null, "boolean equals(Object obj)", - function -> function.methodReturn("Objects.equals(this.value, obj)")); + function -> function.methodReturn("this == obj")); // hashcode addGeneratedAnnotation(classBlock); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java index 80db9412da..33536bff25 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; /** * Defines values for PriorityModel. @@ -18,6 +19,8 @@ public final class PriorityModel implements ExpandableEnum { private static final Map VALUES = new ConcurrentHashMap<>(); + private static final Function NEW_INSTANCE = PriorityModel::new; + /** * Static value 0 for PriorityModel. */ @@ -43,11 +46,7 @@ private PriorityModel(Integer value) { @JsonCreator public static PriorityModel fromValue(Integer value) { Objects.requireNonNull(value, "'value' cannot be null."); - PriorityModel member = VALUES.get(value); - if (member != null) { - return member; - } - return VALUES.computeIfAbsent(value, key -> new PriorityModel(key)); + return VALUES.computeIfAbsent(value, NEW_INSTANCE); } /** @@ -76,7 +75,7 @@ public String toString() { @Override public boolean equals(Object obj) { - return Objects.equals(this.value, obj); + return this == obj; } @Override diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java index dce6221287..c46f716d2b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; /** * Defines values for OlympicRecordModel. @@ -18,6 +19,8 @@ public final class OlympicRecordModel implements ExpandableEnum { private static final Map VALUES = new ConcurrentHashMap<>(); + private static final Function NEW_INSTANCE = OlympicRecordModel::new; + /** * Static value 9.58 for OlympicRecordModel. */ @@ -45,11 +48,7 @@ private OlympicRecordModel(Double value) { @Generated public static OlympicRecordModel fromValue(Double value) { Objects.requireNonNull(value, "'value' cannot be null."); - OlympicRecordModel member = VALUES.get(value); - if (member != null) { - return member; - } - return VALUES.computeIfAbsent(value, key -> new OlympicRecordModel(key)); + return VALUES.computeIfAbsent(value, NEW_INSTANCE); } /** @@ -82,7 +81,7 @@ public String toString() { @Generated @Override public boolean equals(Object obj) { - return Objects.equals(this.value, obj); + return this == obj; } @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java index 99432a3cf0..43b1221128 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; /** * Defines values for PriorityModel. @@ -18,6 +19,8 @@ public final class PriorityModel implements ExpandableEnum { private static final Map VALUES = new ConcurrentHashMap<>(); + private static final Function NEW_INSTANCE = PriorityModel::new; + /** * Static value 100 for PriorityModel. */ @@ -45,11 +48,7 @@ private PriorityModel(Integer value) { @Generated public static PriorityModel fromValue(Integer value) { Objects.requireNonNull(value, "'value' cannot be null."); - PriorityModel member = VALUES.get(value); - if (member != null) { - return member; - } - return VALUES.computeIfAbsent(value, key -> new PriorityModel(key)); + return VALUES.computeIfAbsent(value, NEW_INSTANCE); } /** @@ -82,7 +81,7 @@ public String toString() { @Generated @Override public boolean equals(Object obj) { - return Objects.equals(this.value, obj); + return this == obj; } @Generated diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/enumservice/EnumTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/enumservice/EnumTests.java index 05bf2aa4df..fd3ba7b708 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/enumservice/EnumTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/tsptest/enumservice/EnumTests.java @@ -23,6 +23,7 @@ import tsptest.enumservice.implementation.EnumServiceClientImpl; import tsptest.enumservice.models.ColorModel; import tsptest.enumservice.models.Priority; +import tsptest.enumservice.models.PriorityModel; public class EnumTests { @@ -129,6 +130,15 @@ public void testStringArrayAsMulti() throws Exception { Assertions.assertEquals("colorArrayOpt=Green&colorArrayOpt=Red", request.getUrl().getQuery()); } + @Test + public void testExpandableEnum() { + Assertions.assertEquals(PriorityModel.HIGH, PriorityModel.fromValue(100)); + Assertions.assertNotEquals(PriorityModel.HIGH, PriorityModel.LOW); + Assertions.assertNotEquals(PriorityModel.HIGH, PriorityModel.fromValue(200)); + + Assertions.assertEquals(100, PriorityModel.HIGH.getValue()); + } + private static void verifyQuery(String query, String key, String value) { Assertions.assertEquals( URLEncoder.encode(key, StandardCharsets.UTF_8) + "=" + URLEncoder.encode(value, StandardCharsets.UTF_8), From 234d6867e74d0fb11ba4b19490c772be7b7f9985 Mon Sep 17 00:00:00 2001 From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com> Date: Fri, 6 Dec 2024 09:42:12 -0600 Subject: [PATCH 26/71] [http-client-csharp] split srv-driven cadl ranch directory (#5277) This PR restructures the generated output for the `http/resiliency/srv-driven` clients following the pattern established in https://github.com/microsoft/typespec/pull/5273. --- .../eng/scripts/Generate.ps1 | 13 ++++++---- .../eng/scripts/Generation.psm1 | 25 ++++++++++++++----- .../eng/scripts/Get-CadlRanch-Coverage.ps1 | 13 ++++++---- .../eng/scripts/Test-CadlRanch.ps1 | 16 +++++------- .../src/Properties/launchSettings.json | 9 +++++-- .../SrvDrivenV1Tests.cs} | 9 ++++--- .../SrvDrivenV2Tests.cs} | 7 +++--- .../resiliency/srv-driven/Configuration.json | 6 ----- .../srv-driven/v1/Configuration.json | 4 +-- .../Resiliency.SrvDriven.V1.sln} | 2 +- .../ResiliencyServiceDrivenClient.cs | 2 +- .../ResiliencyServiceDrivenClientOptions.cs | 2 +- .../src/Resiliency.SrvDriven.V1.csproj} | 6 ++--- .../srv-driven/v2/Configuration.json | 6 +++++ .../Resiliency.SrvDriven.V2.sln} | 2 +- .../ResiliencyServiceDrivenClient.cs | 2 +- .../ResiliencyServiceDrivenClientOptions.cs | 2 +- .../src/Resiliency.SrvDriven.V2.csproj} | 6 ++--- .../srv-driven/{ => v2}/tspCodeModel.json | 0 19 files changed, 77 insertions(+), 55 deletions(-) rename packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/{SrvDrivenTests.V1.cs => V1/SrvDrivenV1Tests.cs} (94%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/{SrvDrivenTests.cs => V2/SrvDrivenV2Tests.cs} (96%) delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Configuration.json rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{Resiliency.ServiceDriven.sln => v1/Resiliency.SrvDriven.V1.sln} (96%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{src/Resiliency.ServiceDriven.csproj => v1/src/Resiliency.SrvDriven.V1.csproj} (62%) create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Configuration.json rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{v1/Resiliency.ServiceDriven.V1.sln => v2/Resiliency.SrvDriven.V2.sln} (96%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{ => v2}/src/Generated/ResiliencyServiceDrivenClient.cs (98%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{ => v2}/src/Generated/ResiliencyServiceDrivenClientOptions.cs (94%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{v1/src/Resiliency.ServiceDriven.V1.csproj => v2/src/Resiliency.SrvDriven.V2.csproj} (61%) rename packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/{ => v2}/tspCodeModel.json (100%) diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1 index ee44432ff6..05134142c8 100644 --- a/packages/http-client-csharp/eng/scripts/Generate.ps1 +++ b/packages/http-client-csharp/eng/scripts/Generate.ps1 @@ -101,6 +101,14 @@ foreach ($directory in $directories) { continue } + # srv-driven contains two separate specs, for two separate clients. We need to generate both. + if ($folders.Contains("srv-driven")) { + Generate-Srv-Driven $directory.FullName $generationDir -generateStub $stubbed + $cadlRanchLaunchProjects.Add($($folders -join "-") + "-v1", $("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))") + "/v1") + $cadlRanchLaunchProjects.Add($($folders -join "-") + "-v2", $("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))") + "/v2") + continue + } + $cadlRanchLaunchProjects.Add(($folders -join "-"), ("TestProjects/CadlRanch/$($subPath.Replace([System.IO.Path]::DirectorySeparatorChar, '/'))")) if ($LaunchOnly) { continue @@ -114,11 +122,6 @@ foreach ($directory in $directories) { exit $LASTEXITCODE } - # srv-driven contains two separate specs, for two separate clients. We need to generate both. - if ($folders.Contains("srv-driven")) { - Generate-Srv-Driven $directory.FullName $generationDir -generateStub $stubbed - } - # TODO need to build but depends on https://github.com/Azure/autorest.csharp/issues/4463 } diff --git a/packages/http-client-csharp/eng/scripts/Generation.psm1 b/packages/http-client-csharp/eng/scripts/Generation.psm1 index a2c6af5274..cd10f88dc3 100644 --- a/packages/http-client-csharp/eng/scripts/Generation.psm1 +++ b/packages/http-client-csharp/eng/scripts/Generation.psm1 @@ -91,14 +91,27 @@ function Generate-Srv-Driven { [bool]$createOutputDirIfNotExist = $true ) - $specFilePath = $(Join-Path $specFilePath "old.tsp") - $outputDir = $(Join-Path $outputDir "v1") - if ($createOutputDirIfNotExist -and -not (Test-Path $outputDir)) { - New-Item -ItemType Directory -Path $outputDir | Out-Null + $v1Dir = $(Join-Path $outputDir "v1") + if ($createOutputDirIfNotExist -and -not (Test-Path $v1Dir)) { + New-Item -ItemType Directory -Path $v1Dir | Out-Null } - Write-Host "Generating http\resiliency\srv-driven\v1" -ForegroundColor Cyan - Invoke (Get-TspCommand $specFilePath $outputDir -generateStub $generateStub -namespaceOverride "Resiliency.ServiceDriven.V1") + $v2Dir = $(Join-Path $outputDir "v2") + if ($createOutputDirIfNotExist -and -not (Test-Path $v2Dir)) { + New-Item -ItemType Directory -Path $v2Dir | Out-Null + } + + ## get the last two directories of the output directory and add V1/V2 to disambiguate the namespaces + $namespaceRoot = $(($outputDir.Split([System.IO.Path]::DirectorySeparatorChar)[-2..-1] | ` + ForEach-Object { $_.Substring(0,1).ToUpper() + $_.Substring(1) }) -replace '-(\p{L})', { $_.Groups[1].Value.ToUpper() } -replace '\W', '' -join ".") + $v1NamespaceOverride = $namespaceRoot + ".V1" + $v2NamespaceOverride = $namespaceRoot + ".V2" + + $v1SpecFilePath = $(Join-Path $specFilePath "old.tsp") + $v2SpecFilePath = $(Join-Path $specFilePath "main.tsp") + + Invoke (Get-TspCommand $v1SpecFilePath $v1Dir -generateStub $generateStub -namespaceOverride $v1NamespaceOverride) + Invoke (Get-TspCommand $v2SpecFilePath $v2Dir -generateStub $generateStub -namespaceOverride $v2NamespaceOverride) # exit if the generation failed if ($LASTEXITCODE -ne 0) { diff --git a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 index da844ced98..ff668da5aa 100644 --- a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 +++ b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 @@ -46,17 +46,20 @@ foreach ($directory in $directories) { continue } + if ($subPath.Contains("srv-driven")) { + if ($subPath.Contains("v1")) { + # this will generate v1 and v2 so we only need to call it once for one of the versions + Generate-Srv-Driven ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + continue + } + $command = Get-TspCommand $specFile $outputDir Invoke $command # exit if the generation failed if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - - # srv-driven contains two separate specs, for two separate clients. We need to generate both. - if ($subPath.Contains('srv-driven')) { - Generate-Srv-Driven $(Join-Path $specsDirectory $subPath) $outputDir -createOutputDirIfNotExist $false - } } # test all diff --git a/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 b/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 index 65266e5ac8..698c0537df 100644 --- a/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 +++ b/packages/http-client-csharp/eng/scripts/Test-CadlRanch.ps1 @@ -32,10 +32,6 @@ foreach ($directory in $directories) { if (-not (Compare-Paths $subPath $filter)) { continue } - - if ($subPath.Contains($(Join-Path 'srv-driven' 'v1'))) { - continue - } $testPath = "$cadlRanchRoot.Tests" $testFilter = "TestProjects.CadlRanch.Tests" @@ -67,21 +63,21 @@ foreach ($directory in $directories) { Generate-Versioning ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false } } + elseif ($subPath.Contains("srv-driven")) { + if ($subPath.Contains("v1")) { + Generate-Srv-Driven ($(Join-Path $specsDirectory $subPath) | Split-Path) $($outputDir | Split-Path) -createOutputDirIfNotExist $false + } + } else { $command = Get-TspCommand $specFile $outputDir Invoke $command } - + # exit if the generation failed if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - # srv-driven contains two separate specs, for two separate clients. We need to generate both. - if ($subPath.Contains("srv-driven")) { - Generate-Srv-Driven $(Join-Path $specsDirectory $subPath) $outputDir -createOutputDirIfNotExist $false - } - Write-Host "Testing $subPath" -ForegroundColor Cyan $command = "dotnet test $cadlRanchCsproj --filter `"FullyQualifiedName~$testFilter`"" Invoke $command diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json index a8e2843798..f2d5ebb72d 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json @@ -120,8 +120,13 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, - "http-resiliency-srv-driven": { - "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/resiliency/srv-driven -p StubLibraryPlugin", + "http-resiliency-srv-driven-v1": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/resiliency/srv-driven/v1 -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, + "http-resiliency-srv-driven-v2": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/resiliency/srv-driven/v2 -p StubLibraryPlugin", "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.V1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs similarity index 94% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.V1.cs rename to packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs index 02f91bb8ba..dd321081b3 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.V1.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs @@ -2,16 +2,19 @@ // Licensed under the MIT License. using NUnit.Framework; -using Resiliency.ServiceDriven.V1; +using Resiliency.SrvDriven.V1; using System.Threading.Tasks; -namespace TestProjects.CadlRanch.Tests.Http.Resiliency.SrvDriven +namespace TestProjects.CadlRanch.Tests.Http.Resiliency.SrvDriven.V1 { /// /// Contains tests for the service-driven resiliency V1 client. /// - public partial class SrvDrivenTests : CadlRanchTestBase + public partial class SrvDrivenV2Tests : CadlRanchTestBase { + private const string ServiceDeploymentV1 = "v1"; + private const string ServiceDeploymentV2 = "v2"; + // This test validates the v1 client behavior when both the service deployment and api version are set to V1. [CadlRanchTest] public Task AddOptionalParamFromNone_V1Client_V1Service_WithApiVersionV1() => Test(async (host) => diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V2/SrvDrivenV2Tests.cs similarity index 96% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.cs rename to packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V2/SrvDrivenV2Tests.cs index ca6a493224..cc2dfb9985 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/SrvDrivenTests.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V2/SrvDrivenV2Tests.cs @@ -3,13 +3,12 @@ using NUnit.Framework; using System.Threading.Tasks; -using Resiliency.ServiceDriven; +using Resiliency.SrvDriven.V2; -namespace TestProjects.CadlRanch.Tests.Http.Resiliency.SrvDriven +namespace TestProjects.CadlRanch.Tests.Http.Resiliency.SrvDriven.V2 { - public partial class SrvDrivenTests : CadlRanchTestBase + public partial class SrvDrivenV2Tests : CadlRanchTestBase { - private const string ServiceDeploymentV1 = "v1"; private const string ServiceDeploymentV2 = "v2"; [CadlRanchTest] diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Configuration.json deleted file mode 100644 index 03f7a6232d..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Configuration.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "output-folder": ".", - "namespace": "Resiliency.ServiceDriven", - "library-name": "Resiliency.ServiceDriven", - "use-model-reader-writer": true -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Configuration.json index 23dcd7aba7..43d151251e 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Configuration.json +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Configuration.json @@ -1,6 +1,6 @@ { "output-folder": ".", - "namespace": "Resiliency.ServiceDriven.V1", - "library-name": "Resiliency.ServiceDriven.V1", + "namespace": "Resiliency.SrvDriven.V1", + "library-name": "Resiliency.SrvDriven.V1", "use-model-reader-writer": true } diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Resiliency.ServiceDriven.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.SrvDriven.V1.sln similarity index 96% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Resiliency.ServiceDriven.sln rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.SrvDriven.V1.sln index 1022c33783..92889ce27d 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/Resiliency.ServiceDriven.sln +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.SrvDriven.V1.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29709.97 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resiliency.ServiceDriven", "src\Resiliency.ServiceDriven.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resiliency.SrvDriven.V1", "src\Resiliency.SrvDriven.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs index 857cc0ef51..8c25a81940 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Resiliency.ServiceDriven.V1 +namespace Resiliency.SrvDriven.V1 { public partial class ResiliencyServiceDrivenClient { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs index 9c387842e9..adf5be0b0f 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClientOptions.cs @@ -4,7 +4,7 @@ using System.ClientModel.Primitives; -namespace Resiliency.ServiceDriven.V1 +namespace Resiliency.SrvDriven.V1 { public partial class ResiliencyServiceDrivenClientOptions : ClientPipelineOptions { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Resiliency.ServiceDriven.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.SrvDriven.V1.csproj similarity index 62% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Resiliency.ServiceDriven.csproj rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.SrvDriven.V1.csproj index a8a84fc716..5f5ff2e5e4 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Resiliency.ServiceDriven.csproj +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.SrvDriven.V1.csproj @@ -1,9 +1,9 @@ - This is the Resiliency.ServiceDriven client library for developing .NET applications with rich experience. - SDK Code Generation Resiliency.ServiceDriven + This is the Resiliency.SrvDriven.V1 client library for developing .NET applications with rich experience. + SDK Code Generation Resiliency.SrvDriven.V1 1.0.0-beta.1 - Resiliency.ServiceDriven + Resiliency.SrvDriven.V1 netstandard2.0 latest true diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Configuration.json new file mode 100644 index 0000000000..b479794aef --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "Resiliency.SrvDriven.V2", + "library-name": "Resiliency.SrvDriven.V2", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.ServiceDriven.V1.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Resiliency.SrvDriven.V2.sln similarity index 96% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.ServiceDriven.V1.sln rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Resiliency.SrvDriven.V2.sln index 2507d0b1ce..47ec60440c 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/Resiliency.ServiceDriven.V1.sln +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/Resiliency.SrvDriven.V2.sln @@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29709.97 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resiliency.ServiceDriven.V1", "src\Resiliency.ServiceDriven.V1.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resiliency.SrvDriven.V2", "src\Resiliency.SrvDriven.V2.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs similarity index 98% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClient.cs rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs index ab38b9c6be..6cc3562d37 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs @@ -8,7 +8,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Resiliency.ServiceDriven +namespace Resiliency.SrvDriven.V2 { public partial class ResiliencyServiceDrivenClient { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs similarity index 94% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClientOptions.cs rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs index 233945b82e..11ababcb63 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/src/Generated/ResiliencyServiceDrivenClientOptions.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClientOptions.cs @@ -4,7 +4,7 @@ using System.ClientModel.Primitives; -namespace Resiliency.ServiceDriven +namespace Resiliency.SrvDriven.V2 { public partial class ResiliencyServiceDrivenClientOptions : ClientPipelineOptions { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.ServiceDriven.V1.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Resiliency.SrvDriven.V2.csproj similarity index 61% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.ServiceDriven.V1.csproj rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Resiliency.SrvDriven.V2.csproj index fa7663cb74..0cf65023a6 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Resiliency.ServiceDriven.V1.csproj +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Resiliency.SrvDriven.V2.csproj @@ -1,9 +1,9 @@ - This is the Resiliency.ServiceDriven.V1 client library for developing .NET applications with rich experience. - SDK Code Generation Resiliency.ServiceDriven.V1 + This is the Resiliency.SrvDriven.V2 client library for developing .NET applications with rich experience. + SDK Code Generation Resiliency.SrvDriven.V2 1.0.0-beta.1 - Resiliency.ServiceDriven.V1 + Resiliency.SrvDriven.V2 netstandard2.0 latest true diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/tspCodeModel.json similarity index 100% rename from packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/tspCodeModel.json rename to packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/tspCodeModel.json From 7afa566b954887c3104fae274af43caa10000ba7 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 6 Dec 2024 18:46:30 +0000 Subject: [PATCH 27/71] [@typespec/http-specs] Add Installation Scripts to typespec repository (#5278) This is one of the required steps to get the dashboards released. Please review and approve the PR. Thanks --- .../changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md | 8 ++++++++ package.json | 6 +++++- packages/http-specs/CHANGELOG.md | 4 ++++ packages/http-specs/package.json | 4 +++- packages/spector/src/actions/upload-coverage-report.ts | 1 + 5 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md diff --git a/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md b/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md new file mode 100644 index 0000000000..e3e74262ca --- /dev/null +++ b/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md @@ -0,0 +1,8 @@ +--- +changeKind: internal +packages: + - "@typespec/http-specs" + - "@typespec/spector" +--- + +Adding scripts to package.json \ No newline at end of file diff --git a/package.json b/package.json index 786d4a21ec..adb2207254 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,11 @@ "test:e2e": "pnpm -r run test:e2e", "update-latest-docs": "pnpm -r run update-latest-docs", "watch": "tsc --build ./tsconfig.ws.json --watch", - "sync-labels": "tsx ./eng/common/scripts/labels/sync-labels.ts --config ./eng/common/config/labels.ts" + "sync-labels": "tsx ./eng/common/scripts/labels/sync-labels.ts --config ./eng/common/config/labels.ts", + "validate-scenarios": "pnpm -r --filter=@typespec/http-specs run validate-scenarios", + "validate-mock-apis": "pnpm -r --filter=@typespec/http-specs run validate-mock-apis", + "generate-scenarios-summary": "pnpm -r --filter=@typespec/http-specs run generate-scenarios-summary", + "upload-manifest": "pnpm -r --filter=@typespec/http-specs run upload-manifest" }, "devDependencies": { "@chronus/chronus": "^0.13.0", diff --git a/packages/http-specs/CHANGELOG.md b/packages/http-specs/CHANGELOG.md index 2bfe98d87a..a64b980f23 100644 --- a/packages/http-specs/CHANGELOG.md +++ b/packages/http-specs/CHANGELOG.md @@ -1,5 +1,9 @@ # @typespec/http-specs +## 0.1.0-alpha.3 + +- Create coverages container if not existing + ## 0.1.0-alpha.2 - Minor `api-key` in the `authentication` specs diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index 33c0d78243..18ad38dd70 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-specs", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "Spec scenarios and mock apis", "main": "dist/index.js", "type": "module", @@ -12,6 +12,8 @@ "validate-scenarios": "tsp-spector validate-scenarios ./specs", "generate-scenarios-summary": "tsp-spector generate-scenarios-summary ./specs", "regen-docs": "pnpm generate-scenarios-summary", + "upload-manifest": "tsp-spector upload-manifest ./specs --setName @typespec/http-specs --containerName manifests-typespec --storageAccountName typespec", + "upload-coverage": "tsp-spector upload-coverage --generatorName @typespec/http-specs --generatorVersion 0.1.0-alpha.3 --containerName coverages --generatorMode standard --storageAccountName typespec", "validate-mock-apis": "tsp-spector validate-mock-apis ./specs", "check-scenario-coverage": "tsp-spector check-coverage ./specs", "validate-client-server": "concurrently \"tsp-spector server start ./specs\" \"npm run client\" && tsp-spector server stop", diff --git a/packages/spector/src/actions/upload-coverage-report.ts b/packages/spector/src/actions/upload-coverage-report.ts index 9f5fb38ed4..caf1b20191 100644 --- a/packages/spector/src/actions/upload-coverage-report.ts +++ b/packages/spector/src/actions/upload-coverage-report.ts @@ -30,6 +30,7 @@ export async function uploadCoverageReport({ credential: new AzureCliCredential(), containerName, }); + await client.createIfNotExists(); const generatorMetadata: GeneratorMetadata = { name: generatorName, version: generatorVersion, From d5f92db0ae0606202171ab6a8fd765fd884a29ae Mon Sep 17 00:00:00 2001 From: Adam O'Brien Date: Fri, 6 Dec 2024 20:00:18 +0000 Subject: [PATCH 28/71] docs: Fix getting-started.md docs link (#5264) Corrected the link by adding the missing `x` in `.mdx`. ![image](https://github.com/user-attachments/assets/561ee85d-80de-4f09-9c29-2fb898b73476) Co-authored-by: Allen Zhang Co-authored-by: Mark Cowlishaw --- .../src/content/docs/docs/getting-started/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/content/docs/docs/getting-started/getting-started.md b/website/src/content/docs/docs/getting-started/getting-started.md index 2a57a3236b..acf2caa3d4 100644 --- a/website/src/content/docs/docs/getting-started/getting-started.md +++ b/website/src/content/docs/docs/getting-started/getting-started.md @@ -3,4 +3,4 @@ id: getting-started title: Getting Started --- -- [Get started with TypeSpec for REST](./getting-started-rest/01-setup-basic-syntax.md) +- [Get started with TypeSpec for REST](./getting-started-rest/01-setup-basic-syntax.mdx) From 47230dc2eb430858ba946baa5cfdcb3ef2acde1d Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Fri, 6 Dec 2024 12:04:36 -0800 Subject: [PATCH 29/71] Support non-kebab-case directories for cadl-ranch scenarios (#5286) Fixes https://github.com/microsoft/typespec/issues/5287 Follow up to https://github.com/microsoft/typespec/pull/5273/. The directories defined in cadl-ranch spec for the versioning scenarios do not use kebab-case which led to our test attribute skipping the tests. Also adds one missing scenario for versioning. --- .../Removed/V1/VersioningRemovedV1Tests.cs | 12 ++++++++++++ .../Infrastructure/CadlRanchTestAttribute.cs | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs index 3fdf09cc9e..d96e2a4292 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Versioning/Removed/V1/VersioningRemovedV1Tests.cs @@ -3,8 +3,10 @@ using System; using System.Linq; +using System.Threading.Tasks; using NUnit.Framework; using Versioning.Removed.V1; +using Versioning.Removed.V1.Models; namespace TestProjects.CadlRanch.Tests.Http.Versioning.Removed.V1 { @@ -39,5 +41,15 @@ public void TestRemovedMembers() var enumType = typeof(RemovedClientOptions.ServiceVersion); Assert.AreEqual(new string[] { "V1" }, enumType.GetEnumNames()); } + + [CadlRanchTest] + public Task Versioning_Removed_V3Model() => Test(async (host) => + { + var model = new ModelV3("123", EnumV3.EnumMemberV1); + var response = await new RemovedClient(host).ModelV3Async(model); + Assert.AreEqual(200, response.GetRawResponse().Status); + Assert.AreEqual("123", response.Value.Id); + Assert.AreEqual(EnumV3.EnumMemberV1, response.Value.EnumProp); + }); } } diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs index 32688b3275..8e4e8f2729 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs @@ -24,6 +24,12 @@ internal partial class CadlRanchTestAttribute : TestAttribute, IApplyToTest { string clientCodeDirectory = GetGeneratedDirectory(test); + if (!Directory.Exists(clientCodeDirectory)) + { + // Not all cadl-ranch scenarios use kebab-case directories, so try again without kebab-case. + clientCodeDirectory = GetGeneratedDirectory(test, false); + } + var clientCsFile = GetClientCsFile(clientCodeDirectory); TestContext.Progress.WriteLine($"Checking if '{clientCsFile}' is a stubbed implementation."); @@ -69,14 +75,14 @@ private static void SkipTest(Test test) .FirstOrDefault(); } - private static string GetGeneratedDirectory(Test test) + private static string GetGeneratedDirectory(Test test, bool kebabCaseDirectories = true) { var namespaceParts = test.FullName.Split('.').Skip(3); namespaceParts = namespaceParts.Take(namespaceParts.Count() - 2); var clientCodeDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "..", "..", "..", "..", "TestProjects", "CadlRanch"); foreach (var part in namespaceParts) { - clientCodeDirectory = Path.Combine(clientCodeDirectory, FixName(part)); + clientCodeDirectory = Path.Combine(clientCodeDirectory, kebabCaseDirectories ? FixName(part) : part); } return Path.Combine(clientCodeDirectory, "src", "Generated"); } From c21b5c1d381a9d935c6675c57540dccfcaf94f0e Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Fri, 6 Dec 2024 15:21:05 -0800 Subject: [PATCH 30/71] C-sharp Service emitter: Fix nullable types, anonymous types, and safeInt (#5279) --- .../changes/nullable-2024-11-6-1-23-27.md | 8 ++ packages/http-server-csharp/src/attributes.ts | 36 ++++- packages/http-server-csharp/src/interfaces.ts | 3 + packages/http-server-csharp/src/service.ts | 126 +++++++++++++----- packages/http-server-csharp/src/utils.ts | 58 +++++--- .../test/generation.test.ts | 74 ++++++++++ 6 files changed, 253 insertions(+), 52 deletions(-) create mode 100644 .chronus/changes/nullable-2024-11-6-1-23-27.md diff --git a/.chronus/changes/nullable-2024-11-6-1-23-27.md b/.chronus/changes/nullable-2024-11-6-1-23-27.md new file mode 100644 index 0000000000..5aa6b8945c --- /dev/null +++ b/.chronus/changes/nullable-2024-11-6-1-23-27.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - "@typespec/http-server-csharp" +--- + +Fix nullable types, anonymous types, and safeInt diff --git a/packages/http-server-csharp/src/attributes.ts b/packages/http-server-csharp/src/attributes.ts index de792e7402..cc4531d31f 100644 --- a/packages/http-server-csharp/src/attributes.ts +++ b/packages/http-server-csharp/src/attributes.ts @@ -419,13 +419,45 @@ export function getNumericConstraintAttribute( export function getSafeIntAttribute(type: Scalar): Attribute | undefined { if (type.name.toLowerCase() !== "safeint") return undefined; - return new Attribute( + const attr: Attribute = new Attribute( new AttributeType({ - name: "SafeInt", + name: `NumericConstraint`, namespace: HelperNamespace, }), [], ); + + attr.parameters.push( + new Parameter({ + name: "MinValue", + value: new NumericValue(-9007199254740991), + optional: true, + type: new CSharpType({ + name: "long", + namespace: "System", + isBuiltIn: true, + isValueType: true, + isNullable: false, + }), + }), + ); + + attr.parameters.push( + new Parameter({ + name: "MaxValue", + value: new NumericValue(9007199254740991), + optional: true, + type: new CSharpType({ + name: "long", + namespace: "System", + isBuiltIn: true, + isValueType: true, + isNullable: false, + }), + }), + ); + + return attr; } function getEnumAttribute(type: Enum, cSharpName?: string): Attribute { diff --git a/packages/http-server-csharp/src/interfaces.ts b/packages/http-server-csharp/src/interfaces.ts index de6f87a985..b7142c48a0 100644 --- a/packages/http-server-csharp/src/interfaces.ts +++ b/packages/http-server-csharp/src/interfaces.ts @@ -20,17 +20,20 @@ export class CSharpType implements CSharpTypeMetadata { namespace: string; isBuiltIn: boolean; isValueType: boolean; + isNullable: boolean; public constructor(input: { name: string; namespace: string; isBuiltIn?: boolean; isValueType?: boolean; + isNullable?: boolean; }) { this.name = input.name; this.namespace = input.namespace; this.isBuiltIn = input.isBuiltIn !== undefined ? input.isBuiltIn : input.namespace === "System"; this.isValueType = input.isValueType !== undefined ? input.isValueType : false; + this.isNullable = input.isNullable !== undefined ? input.isNullable : false; } isNamespaceInScope(scope?: Scope, visited?: Set>): boolean { diff --git a/packages/http-server-csharp/src/service.ts b/packages/http-server-csharp/src/service.ts index a64e9bf690..2eefa32289 100644 --- a/packages/http-server-csharp/src/service.ts +++ b/packages/http-server-csharp/src/service.ts @@ -346,7 +346,8 @@ export async function $onEmit(context: EmitContext) property, property.name, ); - const [typeName, typeDefault] = this.#findPropertyType(property); + + const [typeName, typeDefault, nullable] = this.#findPropertyType(property); const doc = getDoc(this.emitter.getProgram(), property); const attributes = getModelAttributes(this.emitter.getProgram(), property, propertyName); // eslint-disable-next-line @typescript-eslint/no-deprecated @@ -356,7 +357,9 @@ export async function $onEmit(context: EmitContext) : typeDefault; return this.emitter.result .rawCode(code`${doc ? `${formatComment(doc)}\n` : ""}${`${attributes.map((attribute) => attribute.getApplicationString(this.emitter.getContext().scope)).join("\n")}${attributes?.length > 0 ? "\n" : ""}`}public ${this.#isInheritedProperty(property) ? "new " : ""}${typeName}${ - property.optional && isValueType(this.emitter.getProgram(), property.type) ? "?" : "" + isValueType(this.emitter.getProgram(), property.type) && (property.optional || nullable) + ? "?" + : "" } ${propertyName} { get; ${typeDefault ? "}" : "set; }"}${ defaultValue ? ` = ${defaultValue};\n` : "\n" } @@ -365,14 +368,27 @@ export async function $onEmit(context: EmitContext) #findPropertyType( property: ModelProperty, - ): [EmitterOutput, string | boolean | undefined] { + ): [EmitterOutput, string | boolean | undefined, boolean] { return this.#getTypeInfoForTsType(property.type); } + #getTypeInfoForUnion( + union: Union, + ): [EmitterOutput, string | boolean | undefined, boolean] { + const propResult = this.#getNonNullableTsType(union); + if (propResult === undefined) { + return [ + code`${emitter.emitTypeReference(union)}`, + undefined, + [...union.variants.values()].filter((v) => isNullType(v.type)).length > 0, + ]; + } + const [typeName, typeDefault, _] = this.#getTypeInfoForTsType(propResult.type); + return [typeName, typeDefault, propResult.nullable]; + } #getTypeInfoForTsType( - this: any, tsType: Type, - ): [EmitterOutput, string | boolean | undefined] { + ): [EmitterOutput, string | boolean | undefined, boolean] { function extractStringValue(type: Type, span: StringTemplateSpan): string { switch (type.kind) { case "String": @@ -403,54 +419,62 @@ export async function $onEmit(context: EmitContext) } switch (tsType.kind) { case "String": - return [code`string`, `"${tsType.value}"`]; + return [code`string`, `"${tsType.value}"`, false]; case "StringTemplate": const template = tsType; if (template.stringValue !== undefined) - return [code`string`, `"${template.stringValue}"`]; + return [code`string`, `"${template.stringValue}"`, false]; const spanResults: string[] = []; for (const span of template.spans) { spanResults.push(extractStringValue(span, span)); } - return [code`string`, `"${spanResults.join("")}"`]; + return [code`string`, `"${spanResults.join("")}"`, false]; case "Boolean": - return [code`bool`, `${tsType.value === true ? true : false}`]; + return [code`bool`, `${tsType.value === true ? true : false}`, false]; case "Number": const [type, value] = this.#findNumericType(tsType); - return [code`${type}`, `${value}`]; + return [code`${type}`, `${value}`, false]; case "Tuple": const defaults = []; const [csharpType, isObject] = this.#coalesceTypes(tsType.values); - if (isObject) return ["object[]", undefined]; + if (isObject) return ["object[]", undefined, false]; for (const value of tsType.values) { const [_, itemDefault] = this.#getTypeInfoForTsType(value); defaults.push(itemDefault); } - return [code`${csharpType.getTypeReference()}[]`, `[${defaults.join(", ")}]`]; + return [ + code`${csharpType.getTypeReference()}[]`, + `[${defaults.join(", ")}]`, + csharpType.isNullable, + ]; case "Object": - return [code`object`, undefined]; + return [code`object`, undefined, false]; case "Model": if (this.#isRecord(tsType)) { - return [code`JsonObject`, undefined]; + return [code`JsonObject`, undefined, false]; } - return [code`${emitter.emitTypeReference(tsType)}`, undefined]; + return [code`${emitter.emitTypeReference(tsType)}`, undefined, false]; + case "ModelProperty": + return this.#getTypeInfoForTsType(tsType.type); case "Enum": - return [code`${emitter.emitTypeReference(tsType)}`, undefined]; + return [code`${emitter.emitTypeReference(tsType)}`, undefined, false]; case "EnumMember": if (typeof tsType.value === "number") { const stringValue = tsType.value.toString(); if (stringValue.includes(".") || stringValue.includes("e")) - return ["double", stringValue]; - return ["int", stringValue]; + return ["double", stringValue, false]; + return ["int", stringValue, false]; } if (typeof tsType.value === "string") { - return ["string", tsType.value]; + return ["string", tsType.value, false]; } - return [code`object`, undefined]; + return [code`object`, undefined, false]; case "Union": - return [code`${emitter.emitTypeReference(tsType)}`, undefined]; + return this.#getTypeInfoForUnion(tsType); + case "UnionVariant": + return this.#getTypeInfoForTsType(tsType.type); default: - return [code`${emitter.emitTypeReference(tsType)}`, undefined]; + return [code`${emitter.emitTypeReference(tsType)}`, undefined, false]; } } @@ -753,13 +777,13 @@ export async function $onEmit(context: EmitContext) } let i = 1; for (const requiredParam of requiredParams) { - const [paramType, _] = this.#findPropertyType(requiredParam); + const [paramType, _, __] = this.#findPropertyType(requiredParam); signature.push( code`${paramType} ${ensureCSharpIdentifier(this.emitter.getProgram(), requiredParam, requiredParam.name, NameCasingType.Parameter)}${i++ < totalParams ? ", " : ""}`, ); } for (const optionalParam of optionalParams) { - const [paramType, _] = this.#findPropertyType(optionalParam); + const [paramType, _, __] = this.#findPropertyType(optionalParam); signature.push( code`${paramType}? ${ensureCSharpIdentifier(this.emitter.getProgram(), optionalParam, optionalParam.name, NameCasingType.Parameter)}${i++ < totalParams ? ", " : ""}`, ); @@ -896,7 +920,7 @@ export async function $onEmit(context: EmitContext) name, NameCasingType.Parameter, ); - let [emittedType, emittedDefault] = this.#findPropertyType(parameter); + let [emittedType, emittedDefault, _] = this.#findPropertyType(parameter); if (emittedType.toString().endsWith("[]")) emittedDefault = undefined; // eslint-disable-next-line @typescript-eslint/no-deprecated const defaultValue = parameter.default @@ -907,11 +931,18 @@ export async function $onEmit(context: EmitContext) code`${httpParam.type !== "path" ? this.#emitParameterAttribute(httpParam) : ""}${emittedType} ${emittedName}${defaultValue === undefined ? "" : ` = ${defaultValue}`}`, ); } + #getBodyParameters(operation: HttpOperation): ModelProperty[] | undefined { + const bodyParam = operation.parameters.body; + if (bodyParam === undefined) return undefined; + if (bodyParam.property !== undefined) return [bodyParam.property]; + if (bodyParam.type.kind !== "Model" || bodyParam.type.properties.size < 1) return undefined; + return [...bodyParam.type.properties.values()]; + } #emitOperationCallParameters(operation: HttpOperation): EmitterOutput { const signature = new StringBuilder(); - const bodyParam = operation.parameters.body; let i = 0; + const bodyParameters = this.#getBodyParameters(operation); //const pathParameters = operation.parameters.parameters.filter((p) => p.type === "path"); for (const parameter of operation.parameters.parameters) { i++; @@ -922,13 +953,27 @@ export async function $onEmit(context: EmitContext) ) { signature.push( code`${this.#emitOperationCallParameter(operation, parameter)}${ - i < operation.parameters.parameters.length || bodyParam !== undefined ? ", " : "" + i < operation.parameters.parameters.length || bodyParameters !== undefined ? ", " : "" }`, ); } } - if (bodyParam !== undefined) { - signature.push(code`body`); + if (bodyParameters !== undefined) { + if (bodyParameters.length === 1) { + signature.push(code`body`); + } else { + let j = 0; + for (const parameter of bodyParameters) { + j++; + const propertyName = ensureCSharpIdentifier( + this.emitter.getProgram(), + parameter, + parameter.name, + NameCasingType.Property, + ); + signature.push(code`body?.${propertyName}${j < bodyParameters.length ? ", " : ""}`); + } + } } return signature.reduce(); @@ -1148,6 +1193,14 @@ export async function $onEmit(context: EmitContext) return result; } + #getNonNullableTsType(union: Union): { type: Type; nullable: boolean } | undefined { + const types = [...union.variants.values()]; + const nulls = types.flatMap((v) => v.type).filter((t) => isNullType(t)); + const nonNulls = types.flatMap((v) => v.type).filter((t) => !isNullType(t)); + if (nonNulls.length === 1) return { type: nonNulls[0], nullable: nulls.length > 0 }; + return undefined; + } + #coalesceTypes(types: Type[]): [CSharpType, boolean] { const defaultValue: [CSharpType, boolean] = [ new CSharpType({ @@ -1158,8 +1211,9 @@ export async function $onEmit(context: EmitContext) true, ]; let current: CSharpType | undefined = undefined; + let nullable: boolean = false; for (const type of types) { - let candidate: CSharpType; + let candidate: CSharpType | undefined = undefined; switch (type.kind) { case "Boolean": candidate = new CSharpType({ name: "bool", namespace: "System", isValueType: true }); @@ -1186,14 +1240,24 @@ export async function $onEmit(context: EmitContext) case "Scalar": candidate = getCSharpTypeForScalar(this.emitter.getProgram(), type); break; + case "Intrinsic": + if (isNullType(type)) { + nullable = true; + candidate = current; + } else { + return defaultValue; + } + break; default: return defaultValue; } current = current ?? candidate; - if (current === undefined || !candidate.equals(current)) return defaultValue; + if (current === undefined || (candidate !== undefined && !candidate.equals(current))) + return defaultValue; } + if (current !== undefined && nullable) current.isNullable = true; return current === undefined ? defaultValue : [current, false]; } diff --git a/packages/http-server-csharp/src/utils.ts b/packages/http-server-csharp/src/utils.ts index c345973b7c..ff667b0ca0 100644 --- a/packages/http-server-csharp/src/utils.ts +++ b/packages/http-server-csharp/src/utils.ts @@ -41,10 +41,13 @@ import { } from "./interfaces.js"; import { reportDiagnostic } from "./lib.js"; +const _scalars: Map = new Map(); export function getCSharpTypeForScalar(program: Program, scalar: Scalar): CSharpType { + if (_scalars.has(scalar)) return _scalars.get(scalar)!; if (program.checker.isStdType(scalar)) { return getCSharpTypeForStdScalars(program, scalar); } + if (scalar.baseScalar) { return getCSharpTypeForScalar(program, scalar.baseScalar); } @@ -54,12 +57,16 @@ export function getCSharpTypeForScalar(program: Program, scalar: Scalar): CSharp format: { typeName: scalar.name }, target: scalar, }); - return new CSharpType({ + + const result = new CSharpType({ name: "Object", namespace: "System", isBuiltIn: true, isValueType: false, }); + + _scalars.set(scalar, result); + return result; } export const UnknownType: CSharpType = new CSharpType({ @@ -71,7 +78,7 @@ export const UnknownType: CSharpType = new CSharpType({ export function getCSharpType( program: Program, type: Type, - namespace: string, + namespace?: string, ): { type: CSharpType; value?: CSharpValue } | undefined { const known = getKnownType(program, type); if (known !== undefined) return { type: known }; @@ -118,7 +125,7 @@ export function getCSharpType( return { type: new CSharpType({ name: ensureCSharpIdentifier(program, type, type.name, NameCasingType.Class), - namespace: namespace, + namespace: namespace || "Models", isBuiltIn: false, isValueType: false, }), @@ -167,24 +174,26 @@ export function getCSharpType( export function coalesceTypes( program: Program, types: Type[], - namespace: string, + namespace?: string, ): { type: CSharpType; value?: CSharpValue } { const visited = new Map(); let candidateType: CSharpType | undefined = undefined; let candidateValue: CSharpValue | undefined = undefined; for (const type of types) { - if (!visited.has(type)) { - const resolvedType = getCSharpType(program, type, namespace); - if (resolvedType === undefined) return { type: UnknownType }; - if (resolvedType.type === UnknownType) return resolvedType; - if (candidateType === undefined) { - candidateType = resolvedType.type; - candidateValue = resolvedType.value; - } else { - if (candidateValue !== resolvedType.value) candidateValue = undefined; - if (candidateType !== resolvedType.type) return { type: UnknownType }; + if (!isNullType(type)) { + if (!visited.has(type)) { + const resolvedType = getCSharpType(program, type, namespace); + if (resolvedType === undefined) return { type: UnknownType }; + if (resolvedType.type === UnknownType) return resolvedType; + if (candidateType === undefined) { + candidateType = resolvedType.type; + candidateValue = resolvedType.value; + } else { + if (candidateValue !== resolvedType.value) candidateValue = undefined; + if (candidateType !== resolvedType.type) return { type: UnknownType }; + } + visited.set(type, resolvedType); } - visited.set(type, resolvedType); } } @@ -364,8 +373,11 @@ export function getCSharpTypeForStdScalars( program: Program, scalar: Scalar & { name: ExtendedIntrinsicScalarName }, ): CSharpType { + const cached: CSharpType | undefined = _scalars.get(scalar); + if (cached !== undefined) return cached; const builtIn: CSharpType | undefined = standardScalars.get(scalar.name); if (builtIn !== undefined) { + _scalars.set(scalar, builtIn); if (scalar.name === "numeric" || scalar.name === "integer" || scalar.name === "float") { reportDiagnostic(program, { code: "no-numeric", @@ -390,10 +402,18 @@ export function getCSharpTypeForStdScalars( } export function isValueType(program: Program, type: Type): boolean { - if (type.kind === "Boolean" || type.kind === "Number" || type.kind === "Enum") return true; - if (type.kind !== "Scalar") return false; - const scalarType = getCSharpTypeForScalar(program, type); - return scalarType.isValueType; + if ( + type.kind === "Boolean" || + type.kind === "Number" || + type.kind === "Enum" || + type.kind === "EnumMember" + ) + return true; + if (type.kind === "Scalar") return getCSharpTypeForScalar(program, type).isValueType; + if (type.kind !== "Union") return false; + return [...type.variants.values()] + .flatMap((v) => v.type) + .every((t) => isNullType(t) || isValueType(program, t)); } export function formatComment( diff --git a/packages/http-server-csharp/test/generation.test.ts b/packages/http-server-csharp/test/generation.test.ts index cc1f17441b..78328daf5b 100644 --- a/packages/http-server-csharp/test/generation.test.ts +++ b/packages/http-server-csharp/test/generation.test.ts @@ -1024,3 +1024,77 @@ it("generates valid code for anonymous models", async () => { ], ); }); + +it("handles nullable types correctly", async () => { + await compileAndValidateMultiple( + runner, + ` + /** A simple test model*/ + model Foo { + /** Nullable numeric property */ + intProp: int32 | null; + /** Nullable reference type */ + stringProp: string | null; + #suppress "@typespec/http-server-csharp/anonymous-model" "This is a test" + /** A complex property */ + modelProp: { + bar: string; + } | null; + #suppress "@typespec/http-server-csharp/anonymous-model" "This is a test" + anotherModelProp: { + baz: string; + }; + + yetAnother: Foo.modelProp | null; + + } + + @route("/foo") op foo(): void; + `, + [ + ["Model0.cs", ["public partial class Model0", "public string Bar { get; set; }"]], + ["Model1.cs", ["public partial class Model1", "public string Baz { get; set; }"]], + [ + "Foo.cs", + [ + "public partial class Foo", + "public int? IntProp { get; set; }", + "public string StringProp { get; set; }", + "public Model0 ModelProp { get; set; }", + "public Model1 AnotherModelProp { get; set; }", + "public Model0 YetAnother { get; set; }", + ], + ], + ["ContosoOperationsControllerBase.cs", [`public virtual async Task Foo()`]], + ["IContosoOperations.cs", [`Task FooAsync( );`]], + ], + ); +}); + +it("handles implicit request body models correctly", async () => { + await compileAndValidateMultiple( + runner, + ` + #suppress "@typespec/http-server-csharp/anonymous-model" "Test" + @route("/foo") @post op foo(intProp?: int32, arrayProp?: string[]): void; + `, + [ + [ + "Model0.cs", + [ + "public partial class Model0", + "public int? IntProp { get; set; }", + "public string[] ArrayProp { get; set; }", + ], + ], + [ + "ContosoOperationsControllerBase.cs", + [ + `public virtual async Task Foo(Model0 body)`, + ".FooAsync(body?.IntProp, body?.ArrayProp)", + ], + ], + ["IContosoOperations.cs", [`Task FooAsync( int? intProp, string[]? arrayProp);`]], + ], + ); +}); From c0aeebeb006c9fd23c201f18d5d6710a274dd5f7 Mon Sep 17 00:00:00 2001 From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:08:54 -0800 Subject: [PATCH 31/71] Fix to cadlranch attribute (#5291) Linux filepaths are case-sensitive so updating to use the correct casing for the non kebab-case scenarios. --- .../Infrastructure/CadlRanchTestAttribute.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs index 8e4e8f2729..29897ff980 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Infrastructure/CadlRanchTestAttribute.cs @@ -82,14 +82,19 @@ private static string GetGeneratedDirectory(Test test, bool kebabCaseDirectories var clientCodeDirectory = Path.Combine(TestContext.CurrentContext.TestDirectory, "..", "..", "..", "..", "..", "TestProjects", "CadlRanch"); foreach (var part in namespaceParts) { - clientCodeDirectory = Path.Combine(clientCodeDirectory, kebabCaseDirectories ? FixName(part) : part); + clientCodeDirectory = Path.Combine(clientCodeDirectory, FixName(part, kebabCaseDirectories)); } return Path.Combine(clientCodeDirectory, "src", "Generated"); } - private static string FixName(string part) + private static string FixName(string part, bool kebabCaseDirectories) { - return ToKebabCase().Replace(part.StartsWith("_", StringComparison.Ordinal) ? part.Substring(1) : part, "-$1").ToLower(); + if (kebabCaseDirectories) + { + return ToKebabCase().Replace(part.StartsWith("_", StringComparison.Ordinal) ? part.Substring(1) : part, "-$1").ToLowerInvariant(); + } + // Use camelCase + return char.ToLowerInvariant(part[0]) + part[1..]; } } } From 57f9b206cad48424497fbeb67e52a79030317c21 Mon Sep 17 00:00:00 2001 From: Allen Zhang Date: Fri, 6 Dec 2024 16:18:33 -0800 Subject: [PATCH 32/71] Add 1_0_E2E label (#5292) --- eng/common/config/labels.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/common/config/labels.ts b/eng/common/config/labels.ts index cb9c284ec0..ce4ec6b35d 100644 --- a/eng/common/config/labels.ts +++ b/eng/common/config/labels.ts @@ -194,6 +194,10 @@ export default defineConfig({ misc: { description: "Misc labels", labels: { + "1_0_E2E": { + color: "5319E7", + description: "", + }, "Client Emitter Migration": { color: "FD92F0", description: "", From e70c152f9b244949a946ab1330596c5950340653 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 9 Dec 2024 10:29:41 +0800 Subject: [PATCH 33/71] bump http-client-python to 0.4.0 (#5284) --- packages/http-client-python/CHANGELOG.md | 10 ++++++++++ packages/http-client-python/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index 8248785288..96e457430b 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log - @typespec/http-client-python +## 0.4.0 + +### Features + +- Refine exception handling logic and support exception with ranged status code (#5270) + +### Bug Fixes + +- Filter out credential that python does not support for now (#5282) + ## 0.3.12 ### Other Changes diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index 34627e8a8d..dcb769ab3f 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-python", - "version": "0.3.12", + "version": "0.4.0", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io", From f132db1bf803d5691b56e4af26bba71c8f34e9e4 Mon Sep 17 00:00:00 2001 From: iscai-msft <43154838+iscai-msft@users.noreply.github.com> Date: Sun, 8 Dec 2024 23:34:18 -0500 Subject: [PATCH 34/71] [python] ignore final envelope result models for DI (#5290) Co-authored-by: iscai-msft Co-authored-by: Yuchao Yan --- packages/http-client-python/CHANGELOG.md | 6 ++++++ .../http-client-python/emitter/src/code-model.ts | 16 ++++++++++++++++ packages/http-client-python/package-lock.json | 14 +++++++------- packages/http-client-python/package.json | 6 +++--- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index 96e457430b..b143c2cff5 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log - @typespec/http-client-python +## 0.4.1 + +### Bug Fixes + +- Ignore models only used as LRO envelope results because we don't do anything with them + ## 0.4.0 ### Features diff --git a/packages/http-client-python/emitter/src/code-model.ts b/packages/http-client-python/emitter/src/code-model.ts index 0199c7de21..3afb945f30 100644 --- a/packages/http-client-python/emitter/src/code-model.ts +++ b/packages/http-client-python/emitter/src/code-model.ts @@ -269,6 +269,9 @@ export function emitCodeModel( } // loop through models and enums since there may be some orphaned models needs to be generated for (const model of sdkPackage.models) { + if (isAzureCoreModel(model)) { + continue; + } // filter out spread models if ( model.name === "" || @@ -278,6 +281,16 @@ export function emitCodeModel( ) { continue; } + // filter out models only used for polling and or envelope result + if ( + ((model.usage & UsageFlags.LroInitial) > 0 || + (model.usage & UsageFlags.LroFinalEnvelope) > 0 || + (model.usage & UsageFlags.LroPolling) > 0) && + (model.usage & UsageFlags.Input) === 0 && + (model.usage & UsageFlags.Output) === 0 + ) { + continue; + } // filter out specific models not used in python, e.g., pageable models if (disableGenerationMap.has(model)) { continue; @@ -289,6 +302,9 @@ export function emitCodeModel( getType(sdkContext, model); } for (const sdkEnum of sdkPackage.enums) { + if (isAzureCoreModel(sdkEnum)) { + continue; + } // filter out api version enum since python do not generate it if (sdkEnum.usage === UsageFlags.ApiVersionEnum) { continue; diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index 9921931204..4acecf6d8a 100644 --- a/packages/http-client-python/package-lock.json +++ b/packages/http-client-python/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-python", - "version": "0.3.12", + "version": "0.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.3.12", + "version": "0.4.1", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -21,7 +21,7 @@ "@azure-tools/typespec-azure-core": "~0.48.0", "@azure-tools/typespec-azure-resource-manager": "~0.48.0", "@azure-tools/typespec-azure-rulesets": "~0.48.0", - "@azure-tools/typespec-client-generator-core": "~0.48.0", + "@azure-tools/typespec-client-generator-core": "~0.48.5", "@types/js-yaml": "~4.0.5", "@types/node": "~22.5.4", "@types/semver": "7.5.8", @@ -45,7 +45,7 @@ "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.48.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.48.5 <1.0.0", "@typespec/compiler": ">=0.62.0 <1.0.0", "@typespec/http": ">=0.62.0 <1.0.0", "@typespec/openapi": ">=0.62.0 <1.0.0", @@ -237,9 +237,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.0.tgz", - "integrity": "sha512-+fmKjapz0kP7ONPZap8dgcIKIdQw+YBSrf89csbIyhPTcLnVAk/BKljo8FoNypKXwqKHenslLm0njBKPllkopg==", + "version": "0.48.5", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.5.tgz", + "integrity": "sha512-oAGyH99f3FMzTVE82A/hHupMlpDhxBUTL63wCUab9DM6Rqk+liBGobGl/EPdiOxpvcvhm1drEhkFCkqJt6JenA==", "dev": true, "dependencies": { "change-case": "~5.4.4", diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index dcb769ab3f..02c12bbc48 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-python", - "version": "0.4.0", + "version": "0.4.1", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io", @@ -60,7 +60,7 @@ "@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0", "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.48.0 <3.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.48.0 <1.0.0" + "@azure-tools/typespec-client-generator-core": ">=0.48.5 <1.0.0" }, "dependencies": { "js-yaml": "~4.1.0", @@ -77,7 +77,7 @@ "@azure-tools/typespec-azure-core": "~0.48.0", "@azure-tools/typespec-azure-rulesets": "~0.48.0", "@azure-tools/typespec-azure-resource-manager": "~0.48.0", - "@azure-tools/typespec-client-generator-core": "~0.48.0", + "@azure-tools/typespec-client-generator-core": "~0.48.5", "@azure-tools/cadl-ranch-specs": "~0.39.1", "@azure-tools/cadl-ranch-expect": "~0.15.6", "@types/js-yaml": "~4.0.5", From b654807b2c25da7c9d2f95bcad0553dae9463fb1 Mon Sep 17 00:00:00 2001 From: mcgallan <88413158+mcgallan@users.noreply.github.com> Date: Mon, 9 Dec 2024 14:37:25 +0800 Subject: [PATCH 35/71] [http-spec] Update Versioning/Removed Project And Removed Type/Model/Templated (#5217) Fixed the two issues mentioned in [Issue5216](https://github.com/microsoft/typespec/issues/5216), upgraded the code for Versioning/Removed, and removed the Type/Model/Templated code that has already been reverted in Cadl Ranch. Fix https://github.com/microsoft/typespec/issues/5216 --- ...moved-in-cadl-ranch-2024-10-28-15-49-29.md | 7 + packages/http-specs/spec-summary.md | 114 ++++++--------- .../specs/type/model/templated/main.tsp | 130 ------------------ .../specs/type/model/templated/mockapi.ts | 66 --------- .../specs/versioning/removed/main.tsp | 64 ++++++++- .../specs/versioning/removed/mockapi.ts | 47 +++++++ 6 files changed, 160 insertions(+), 268 deletions(-) create mode 100644 .chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md delete mode 100644 packages/http-specs/specs/type/model/templated/main.tsp delete mode 100644 packages/http-specs/specs/type/model/templated/mockapi.ts diff --git a/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md b/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md new file mode 100644 index 0000000000..3704e00677 --- /dev/null +++ b/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/http-specs" +--- + +update code in versioning/removed and removed type/model/templated. diff --git a/packages/http-specs/spec-summary.md b/packages/http-specs/spec-summary.md index 9fbaa6e661..ff4a3ec4d5 100644 --- a/packages/http-specs/spec-summary.md +++ b/packages/http-specs/spec-summary.md @@ -4360,77 +4360,6 @@ Expected input body: } ``` -### Type_Model_Templated_float32Type - -- Endpoint: `put /type/model/templated/float32ValuesType` - -Expected input body: - -```json -{ - "kind": "Float32Values", - "values": [0.5], - "value": 0.5 -} -``` - -Expected response body: - -```json -{ - "kind": "Float32Values", - "values": [0.5], - "value": 0.5 -} -``` - -### Type_Model_Templated_int32Type - -- Endpoint: `put /type/model/templated/int32ValuesType` - -Expected input body: - -```json -{ - "kind": "Int32Values", - "values": [1234], - "value": 1234 -} -``` - -Expected response body: - -```json -{ - "kind": "Int32Values", - "values": [1234], - "value": 1234 -} -``` - -### Type_Model_Templated_numericType - -- Endpoint: `put /type/model/templated/numericType` - -Expected input body: - -```json -{ - "kind": "Int32Values", - "values": [1234], - "value": 1234 -} -``` - -Expected response body: - -```json -{ - "values": [1234], - "value": 1234 -} -``` - ### Type_Model_Usage_input - Endpoint: `get /type/model/usage/input` @@ -7436,6 +7365,49 @@ Expected request body: { "prop": "foo" } ``` +### Versioning_Removed_modelV3 + +- Endpoint: `post /versioning/removed/api-version:{version}/v3` + +path: "/versioning/removed/api-version[:]v1/v3" +Expected request body: + +```json +{ "id": "123", "enumProp": "enumMemberV1" } +``` + +Expected response body: + +```json +{ "id": "123", "enumProp": "enumMemberV1" } +``` + +path: "/versioning/removed/api-version[:]v2preview/v3" +Expected request body: + +```json +{ "id": "123" } +``` + +Expected response body: + +```json +{ "id": "123" } +``` + +path: "/versioning/removed/api-version[:]v2/v3" +Expected request body: + +```json +{ "id": "123", "enumProp": "enumMemberV1" } +``` + +Expected response body: + +```json +{ "id": "123", "enumProp": "enumMemberV1" } +``` + ### Versioning_Removed_v2 - Endpoint: `post /versioning/removed/api-version:{version}/v2` diff --git a/packages/http-specs/specs/type/model/templated/main.tsp b/packages/http-specs/specs/type/model/templated/main.tsp deleted file mode 100644 index 3d9bc1d92e..0000000000 --- a/packages/http-specs/specs/type/model/templated/main.tsp +++ /dev/null @@ -1,130 +0,0 @@ -import "@typespec/http"; -import "@typespec/spector"; - -using Http; -using Spector; - -/** - * Illustrates the model templated cases. There is a base templated type and an instantiated type extending from it. - */ -@scenarioService("/type/model/templated") -namespace Type.Model.Templated; - -@friendlyName("{name}Type", T) -model NumericType { - /** - * An array of numeric values. - */ - values: T[]; - - value: T; -} - -/** - * An instantiated type representing int32 values type. - */ -model Int32ValuesType extends NumericType { - /** - * The Kind of the Int32ValuesType. - */ - kind: "Int32Values"; -} - -/** - * An instantiated type representing float32 values type. - */ -model Float32ValuesType extends NumericType { - /** - * The Kind of the Float32ValuesType. - */ - kind: "Float32Values"; -} - -@scenario -@scenarioDoc(""" - Expected input body: - ```json - { - "kind": "Int32Values", - "values": - [ - 1234 - ], - "value": 1234 - } - ``` - - Expected response body: - ```json - { - "values": - [ - 1234 - ], - "value": 1234 - } - ``` - """) -@route("/numericType") -@put -op numericType(@body input: NumericType): NumericType; - -@scenario -@scenarioDoc(""" - Expected input body: - ```json - { - "kind": "Float32Values", - "values": - [ - 0.5 - ], - "value": 0.5 - } - ``` - - Expected response body: - ```json - { - "kind": "Float32Values", - "values": - [ - 0.5 - ], - "value": 0.5 - } - ``` - """) -@route("/float32ValuesType") -@put -op float32Type(@body input: Float32ValuesType): Float32ValuesType; - -@scenario -@scenarioDoc(""" - Expected input body: - ```json - { - "kind": "Int32Values", - "values": - [ - 1234 - ], - "value": 1234 - } - ``` - - Expected response body: - ```json - { - "kind": "Int32Values", - "values": - [ - 1234 - ], - "value": 1234 - } - ``` - """) -@route("/int32ValuesType") -@put -op int32Type(@body input: Int32ValuesType): Int32ValuesType; diff --git a/packages/http-specs/specs/type/model/templated/mockapi.ts b/packages/http-specs/specs/type/model/templated/mockapi.ts deleted file mode 100644 index cd69b9bfa8..0000000000 --- a/packages/http-specs/specs/type/model/templated/mockapi.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { json, passOnSuccess, ScenarioMockApi } from "@typespec/spec-api"; - -export const Scenarios: Record = {}; - -Scenarios.Type_Model_Templated_numericType = passOnSuccess({ - uri: "/type/model/templated/numericType", - method: "put", - request: { - body: { - kind: "Int32Values", - values: [1234], - value: 1234, - }, - }, - response: { - status: 200, - body: json({ - kind: "Int32Values", - values: [1234], - value: 1234, - }), - }, - kind: "MockApiDefinition", -}); - -Scenarios.Type_Model_Templated_float32Type = passOnSuccess({ - uri: "/type/model/templated/float32ValuesType", - method: "put", - request: { - body: { - kind: "Float32Values", - values: [0.5], - value: 0.5, - }, - }, - response: { - status: 200, - body: json({ - kind: "Float32Values", - values: [0.5], - value: 0.5, - }), - }, - kind: "MockApiDefinition", -}); - -Scenarios.Type_Model_Templated_int32Type = passOnSuccess({ - uri: "/type/model/templated/int32ValuesType", - method: "put", - request: { - body: { - kind: "Int32Values", - values: [1234], - value: 1234, - }, - }, - response: { - status: 200, - body: json({ - kind: "Int32Values", - values: [1234], - value: 1234, - }), - }, - kind: "MockApiDefinition", -}); diff --git a/packages/http-specs/specs/versioning/removed/main.tsp b/packages/http-specs/specs/versioning/removed/main.tsp index 609df7c6d3..17bb7b0be2 100644 --- a/packages/http-specs/specs/versioning/removed/main.tsp +++ b/packages/http-specs/specs/versioning/removed/main.tsp @@ -21,7 +21,7 @@ using TypeSpec.Versioning; endpoint: url, /** - * Need to be set as 'v1' or 'v2' in client. + * Need to be set as 'v1', 'v2preview' or 'v2' in client. */ version: Versions, } @@ -37,6 +37,11 @@ enum Versions { */ v1: "v1", + /** + * The V2 Preview version. + */ + v2preview: "v2preview", + /** * The version v2. */ @@ -67,6 +72,14 @@ model ModelV2 { unionProp: UnionV2; } +model ModelV3 { + id: string; + + @removed(Versions.v2preview) + @added(Versions.v2) + enumProp: EnumV3; +} + enum EnumV2 { @removed(Versions.v2) enumMemberV1, @@ -74,6 +87,14 @@ enum EnumV2 { enumMemberV2, } +enum EnumV3 { + @removed(Versions.v2preview) + @added(Versions.v2) + enumMemberV1, + + enumMemberV2Preview, +} + @removed(Versions.v2) union UnionV1 { string, @@ -124,3 +145,44 @@ interface InterfaceV1 { @route("/v1") v1InInterface(@body body: ModelV1): ModelV1; } + +/** This operation will pass different paths and different request bodies based on different versions. */ +@scenario +@scenarioDoc(""" + path: "/versioning/removed/api-version[:]v1/v3" + Expected request body: + ```json + { "id": "123", "enumProp": "enumMemberV1" } + ``` + + Expected response body: + ```json + { "id": "123", "enumProp": "enumMemberV1" } + ``` + + path: "/versioning/removed/api-version[:]v2preview/v3" + Expected request body: + ```json + { "id": "123"} + ``` + + Expected response body: + ```json + { "id": "123"} + ``` + + path: "/versioning/removed/api-version[:]v2/v3" + Expected request body: + ```json + { "id": "123", "enumProp": "enumMemberV1" } + ``` + + Expected response body: + ```json + { "id": "123", "enumProp": "enumMemberV1" } + ``` + + """) +@post +@route("/v3") +op modelV3(@body body: ModelV3): ModelV3; diff --git a/packages/http-specs/specs/versioning/removed/mockapi.ts b/packages/http-specs/specs/versioning/removed/mockapi.ts index 7f4e2534cf..c197f161d0 100644 --- a/packages/http-specs/specs/versioning/removed/mockapi.ts +++ b/packages/http-specs/specs/versioning/removed/mockapi.ts @@ -18,3 +18,50 @@ Scenarios.Versioning_Removed_v2 = passOnSuccess({ }, kind: "MockApiDefinition", }); + +Scenarios.Versioning_Removed_modelV3 = passOnSuccess({ + uri: `/versioning/removed/api-version[:]v1/v3`, + method: "post", + request: { + body: { + id: "123", + enumProp: "enumMemberV1", + }, + }, + response: { + status: 200, + body: json({ id: "123", enumProp: "enumMemberV1" }), + }, + kind: "MockApiDefinition", +}); + +Scenarios.Versioning_Removed_modelV3_V2 = passOnSuccess({ + uri: `/versioning/removed/api-version[:]v2/v3`, + method: "post", + request: { + body: { + id: "123", + enumProp: "enumMemberV1", + }, + }, + response: { + status: 200, + body: json({ id: "123", enumProp: "enumMemberV1" }), + }, + kind: "MockApiDefinition", +}); + +Scenarios.Versioning_Removed_modelV3_V2preview = passOnSuccess({ + uri: `/versioning/removed/api-version[:]v2preview/v3`, + method: "post", + request: { + body: { + id: "123", + }, + }, + response: { + status: 200, + body: json({ id: "123" }), + }, + kind: "MockApiDefinition", +}); From 55f313eb267f09de6d4b7eda08a4fc48479be989 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Mon, 9 Dec 2024 16:45:05 +0800 Subject: [PATCH 36/71] [http-client-python] fix vanilla legacy test (#5306) Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> --- packages/http-client-python/CHANGELOG.md | 7 +++++ .../emitter/src/code-model.ts | 27 ++++++++++--------- .../pygen/codegen/models/operation.py | 2 +- packages/http-client-python/package-lock.json | 4 +-- packages/http-client-python/package.json | 2 +- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md index b143c2cff5..3e48e543ab 100644 --- a/packages/http-client-python/CHANGELOG.md +++ b/packages/http-client-python/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @typespec/http-client-python +## 0.4.2 + +### Bug Fixes + +- Ignore models/enum only used as LRO envelope results +- Refine exception handling logic to keep compatibility for legacy SDK + ## 0.4.1 ### Bug Fixes diff --git a/packages/http-client-python/emitter/src/code-model.ts b/packages/http-client-python/emitter/src/code-model.ts index 3afb945f30..87518b2546 100644 --- a/packages/http-client-python/emitter/src/code-model.ts +++ b/packages/http-client-python/emitter/src/code-model.ts @@ -250,6 +250,16 @@ function emitClient( }; } +function onlyUsedByPolling(usage: UsageFlags): boolean { + return ( + ((usage & UsageFlags.LroInitial) > 0 || + (usage & UsageFlags.LroFinalEnvelope) > 0 || + (usage & UsageFlags.LroPolling) > 0) && + (usage & UsageFlags.Input) === 0 && + (usage & UsageFlags.Output) === 0 + ); +} + export function emitCodeModel( sdkContext: PythonSdkContext, ) { @@ -269,9 +279,6 @@ export function emitCodeModel( } // loop through models and enums since there may be some orphaned models needs to be generated for (const model of sdkPackage.models) { - if (isAzureCoreModel(model)) { - continue; - } // filter out spread models if ( model.name === "" || @@ -282,13 +289,7 @@ export function emitCodeModel( continue; } // filter out models only used for polling and or envelope result - if ( - ((model.usage & UsageFlags.LroInitial) > 0 || - (model.usage & UsageFlags.LroFinalEnvelope) > 0 || - (model.usage & UsageFlags.LroPolling) > 0) && - (model.usage & UsageFlags.Input) === 0 && - (model.usage & UsageFlags.Output) === 0 - ) { + if (onlyUsedByPolling(model.usage)) { continue; } // filter out specific models not used in python, e.g., pageable models @@ -302,13 +303,13 @@ export function emitCodeModel( getType(sdkContext, model); } for (const sdkEnum of sdkPackage.enums) { - if (isAzureCoreModel(sdkEnum)) { - continue; - } // filter out api version enum since python do not generate it if (sdkEnum.usage === UsageFlags.ApiVersionEnum) { continue; } + if (onlyUsedByPolling(sdkEnum.usage)) { + continue; + } // filter out core enums if (isAzureCoreModel(sdkEnum)) { continue; diff --git a/packages/http-client-python/generator/pygen/codegen/models/operation.py b/packages/http-client-python/generator/pygen/codegen/models/operation.py index 0ce0c62aee..22aed0fdb2 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/operation.py +++ b/packages/http-client-python/generator/pygen/codegen/models/operation.py @@ -202,7 +202,7 @@ def default_error_deserialization(self) -> Optional[str]: exception_schema = default_exceptions[0].type if isinstance(exception_schema, ModelType): return exception_schema.type_annotation(skip_quote=True) - return None + return None if self.code_model.options["models_mode"] == "dpg" else "'object'" @property def non_default_errors(self) -> List[Response]: diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json index 4acecf6d8a..aa6c583052 100644 --- a/packages/http-client-python/package-lock.json +++ b/packages/http-client-python/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-python", - "version": "0.4.1", + "version": "0.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-python", - "version": "0.4.1", + "version": "0.4.2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index 02c12bbc48..94ebdc2c53 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-python", - "version": "0.4.1", + "version": "0.4.2", "author": "Microsoft Corporation", "description": "TypeSpec emitter for Python SDKs", "homepage": "https://typespec.io", From c4b26ab2aaa43b97b941dced289b310410948956 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Mon, 9 Dec 2024 18:30:47 +0000 Subject: [PATCH 37/71] Release http specs alpha4 (#5303) Releasing the changes related to PR https://github.com/microsoft/typespec/pull/5217. Please review and approve the PR. Thanks --- .../changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md | 7 +++++++ packages/http-specs/CHANGELOG.md | 4 ++++ packages/http-specs/package.json | 4 ++-- .../src/components/generator-information.tsx | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md diff --git a/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md b/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md new file mode 100644 index 0000000000..3cc09f4932 --- /dev/null +++ b/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/http-specs" +--- + +Modifies Spec Scenarios \ No newline at end of file diff --git a/packages/http-specs/CHANGELOG.md b/packages/http-specs/CHANGELOG.md index a64b980f23..58bad29b66 100644 --- a/packages/http-specs/CHANGELOG.md +++ b/packages/http-specs/CHANGELOG.md @@ -1,5 +1,9 @@ # @typespec/http-specs +## 0.1.0-alpha.4 + +- Update Versioning/Removed Project And Removed Type/Model/Templated. Please refer [PR #5217](https://github.com/microsoft/typespec/pull/5217) for further details. + ## 0.1.0-alpha.3 - Create coverages container if not existing diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index 18ad38dd70..93ca09e3fa 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-specs", - "version": "0.1.0-alpha.3", + "version": "0.1.0-alpha.4", "description": "Spec scenarios and mock apis", "main": "dist/index.js", "type": "module", @@ -13,7 +13,7 @@ "generate-scenarios-summary": "tsp-spector generate-scenarios-summary ./specs", "regen-docs": "pnpm generate-scenarios-summary", "upload-manifest": "tsp-spector upload-manifest ./specs --setName @typespec/http-specs --containerName manifests-typespec --storageAccountName typespec", - "upload-coverage": "tsp-spector upload-coverage --generatorName @typespec/http-specs --generatorVersion 0.1.0-alpha.3 --containerName coverages --generatorMode standard --storageAccountName typespec", + "upload-coverage": "tsp-spector upload-coverage --generatorName @typespec/http-specs --generatorVersion 0.1.0-alpha.4 --containerName coverages --generatorMode standard --storageAccountName typespec", "validate-mock-apis": "tsp-spector validate-mock-apis ./specs", "check-scenario-coverage": "tsp-spector check-coverage ./specs", "validate-client-server": "concurrently \"tsp-spector server start ./specs\" \"npm run client\" && tsp-spector server stop", diff --git a/packages/spec-dashboard/src/components/generator-information.tsx b/packages/spec-dashboard/src/components/generator-information.tsx index fc94af7db4..014f51485b 100644 --- a/packages/spec-dashboard/src/components/generator-information.tsx +++ b/packages/spec-dashboard/src/components/generator-information.tsx @@ -21,7 +21,7 @@ export const GeneratorInformation: FunctionComponent valueTitle={report.createdAt} /> From 86f3649aec3f90e049f4f36fd900b078646a3da1 Mon Sep 17 00:00:00 2001 From: Tomer Aberbach Date: Mon, 9 Dec 2024 14:37:14 -0500 Subject: [PATCH 38/71] docs: fix incorrect default (#5257) Co-authored-by: Allen Zhang Co-authored-by: Mark Cowlishaw --- .../changes/fix-js-source-file-docs-2024-12-06-22-57-43.md | 7 +++++++ packages/compiler/src/testing/types.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md diff --git a/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md b/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md new file mode 100644 index 0000000000..b7152c7566 --- /dev/null +++ b/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/compiler" +--- + +Fixes incorrect default value in dev doc diff --git a/packages/compiler/src/testing/types.ts b/packages/compiler/src/testing/types.ts index c0c7b6e22a..833c052097 100644 --- a/packages/compiler/src/testing/types.ts +++ b/packages/compiler/src/testing/types.ts @@ -41,7 +41,7 @@ export interface TypeSpecTestLibraryInit { typespecFileFolder?: string; /** - * JS files folder. @default "dist" + * JS files folder. @default "dist/src" */ jsFileFolder?: string; } From 8919ac839e024edc98134d478b91490e61b751ad Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Tue, 10 Dec 2024 11:07:58 +0800 Subject: [PATCH 39/71] http-client-java, fix client accessor method parameter description (#5313) fix autorest CI: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4395471&view=logs&j=ca395085-040a-526b-2ce8-bdc85f692774&t=0750e130-1e9a-5b8a-35b2-9986f25ac898 Similar to client method parameter, assign a default parameter description if not exists. --- .../core/template/ClientMethodTemplateBase.java | 12 ++---------- .../core/template/ServiceAsyncClientTemplate.java | 3 ++- .../core/template/ServiceClientTemplate.java | 3 ++- .../client/generator/core/util/MethodUtil.java | 15 +++++++++++++++ .../ClientInitializationAsyncClient.java | 2 +- .../ClientInitializationClient.java | 2 +- .../ClientInitializationClientImpl.java | 2 +- 7 files changed, 24 insertions(+), 15 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ClientMethodTemplateBase.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ClientMethodTemplateBase.java index a64f72c7db..ecd24a326e 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ClientMethodTemplateBase.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ClientMethodTemplateBase.java @@ -9,7 +9,6 @@ import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClassType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientEnumValue; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientMethod; -import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientMethodParameter; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientModel; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientModelProperty; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.EnumType; @@ -25,6 +24,7 @@ import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaType; import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; import com.microsoft.typespec.http.client.generator.core.util.CodeNamer; +import com.microsoft.typespec.http.client.generator.core.util.MethodUtil; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; @@ -136,7 +136,7 @@ protected static void generateProtocolMethodJavadoc(ClientMethod clientMethod, J } clientMethod.getParameters() - .forEach(p -> commentBlock.param(p.getName(), methodParameterDescriptionOrDefault(p))); + .forEach(p -> commentBlock.param(p.getName(), MethodUtil.methodParameterDescriptionOrDefault(p))); if (clientMethod.getProxyMethod() != null) { generateJavadocExceptions(clientMethod, commentBlock, false); } @@ -353,14 +353,6 @@ private static String parameterDescriptionOrDefault(ProxyMethodParameter paramet return description; } - private static String methodParameterDescriptionOrDefault(ClientMethodParameter p) { - String doc = p.getDescription(); - if (CoreUtils.isNullOrEmpty(doc)) { - doc = String.format("The %1$s parameter", p.getName()); - } - return doc; - } - private static String appendOptionalOrRequiredAttribute(boolean isRequired, boolean isRequiredForCreate, boolean isRootSchema) { if (isRootSchema) { diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java index f705fba329..ef10d3853f 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceAsyncClientTemplate.java @@ -23,6 +23,7 @@ import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaFile; import com.microsoft.typespec.http.client.generator.core.model.javamodel.JavaVisibility; import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; +import com.microsoft.typespec.http.client.generator.core.util.MethodUtil; import com.microsoft.typespec.http.client.generator.core.util.ModelNamer; import com.microsoft.typespec.http.client.generator.core.util.TemplateUtil; import java.util.HashSet; @@ -241,7 +242,7 @@ static void writeSubClientAccessors(ServiceClient serviceClient, JavaClass class classBlock.javadocComment(comment -> { comment.description("Gets an instance of " + subClientClassName + " class."); for (ClientMethodParameter property : methodParameters) { - comment.param(property.getName(), property.getDescription()); + comment.param(property.getName(), MethodUtil.methodParameterDescriptionOrDefault(property)); } comment.methodReturns("an instance of " + subClientClassName + "class"); }); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientTemplate.java index 0cfc5529e9..7a2895d282 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ServiceClientTemplate.java @@ -19,6 +19,7 @@ import com.microsoft.typespec.http.client.generator.core.template.prototype.MethodTemplate; import com.microsoft.typespec.http.client.generator.core.util.ClientModelUtil; import com.microsoft.typespec.http.client.generator.core.util.CodeNamer; +import com.microsoft.typespec.http.client.generator.core.util.MethodUtil; import com.microsoft.typespec.http.client.generator.core.util.ModelNamer; import com.microsoft.typespec.http.client.generator.core.util.TemplateUtil; import java.util.ArrayList; @@ -386,7 +387,7 @@ private static void writeClientAccessorMethods(JavaClass classBlock, classBlock.javadocComment(comment -> { comment.description("Gets an instance of " + subClientName + " class."); for (ClientMethodParameter parameter : methodParameters) { - comment.param(parameter.getName(), parameter.getDescription()); + comment.param(parameter.getName(), MethodUtil.methodParameterDescriptionOrDefault(parameter)); } comment.methodReturns("an instance of " + subClientName + "class"); }); diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/MethodUtil.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/MethodUtil.java index 8a9e82b252..a969e90168 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/MethodUtil.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/util/MethodUtil.java @@ -23,6 +23,7 @@ import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClassType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientEnumValue; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientMethod; +import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClientMethodParameter; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.EnumType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.IType; import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ProxyMethod; @@ -326,6 +327,20 @@ public static Optional serializedNameOfMaxPageSizeParameter(ProxyMethod .findFirst(); } + /** + * Gets method parameter description, or a default description if not exists. + * + * @param p the client method parameter + * @return the method parameter description + */ + public static String methodParameterDescriptionOrDefault(ClientMethodParameter p) { + String doc = p.getDescription(); + if (CoreUtils.isNullOrEmpty(doc)) { + doc = String.format("The %1$s parameter", p.getName()); + } + return doc; + } + /** * * @param request the input request diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationAsyncClient.java index 051373763a..900212ff45 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationAsyncClient.java @@ -29,7 +29,7 @@ public final class ClientInitializationAsyncClient { /** * Gets an instance of SubAsyncClient class. * - * @param name + * @param name The name parameter. * @return an instance of SubAsyncClientclass. */ public SubAsyncClient getSubAsyncClient(String name) { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationClient.java index 02ac901b5e..705ea2577b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/ClientInitializationClient.java @@ -29,7 +29,7 @@ public final class ClientInitializationClient { /** * Gets an instance of SubClient class. * - * @param name + * @param name The name parameter. * @return an instance of SubClientclass. */ public SubClient getSubClient(String name) { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/implementation/ClientInitializationClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/implementation/ClientInitializationClientImpl.java index 3bd2efbe5c..52de55218f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/implementation/ClientInitializationClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/clientinitialization/implementation/ClientInitializationClientImpl.java @@ -95,7 +95,7 @@ public ClientInitializationClientImpl(HttpPipeline httpPipeline, SerializerAdapt /** * Gets an instance of SubClientImpl class. * - * @param name + * @param name The name parameter. * @return an instance of SubClientImplclass. */ public SubClientImpl getSubClient(String name) { From 4f95f6354761b612741407fb6ee19d3a54a75c28 Mon Sep 17 00:00:00 2001 From: Yuchao Yan Date: Tue, 10 Dec 2024 17:58:47 +0800 Subject: [PATCH 40/71] [python] add lint check for src code in CI (#5320) Add lint check in CI. After this PR merge, please remember to run following command to make sure src code is clean before trigger CI: ``` PS D:\dev\typespec\packages\http-client-python> npm run format PS D:\dev\typespec\packages\http-client-python> npm run lint:py ``` --- .../eng/scripts/Build-Packages.ps1 | 3 ++ .../eng/scripts/ci/utils.ts | 2 ++ .../generator/pygen/black.py | 1 + .../generator/pygen/codegen/__init__.py | 13 +++++++-- .../codegen/models/lro_paging_operation.py | 4 +-- .../pygen/codegen/models/operation.py | 13 +++++---- .../codegen/serializers/builder_serializer.py | 29 +++++++++++-------- .../test_azure_arm_resource_async.py | 4 +-- .../mock_api_tests/test_azure_arm_resource.py | 4 +-- packages/http-client-python/package.json | 2 +- 10 files changed, 45 insertions(+), 30 deletions(-) diff --git a/packages/http-client-python/eng/scripts/Build-Packages.ps1 b/packages/http-client-python/eng/scripts/Build-Packages.ps1 index f4601edb32..2044c5a6df 100644 --- a/packages/http-client-python/eng/scripts/Build-Packages.ps1 +++ b/packages/http-client-python/eng/scripts/Build-Packages.ps1 @@ -57,6 +57,9 @@ try { Invoke-LoggedCommand "npm run build" -GroupOutput + Write-Host "run lint check for pygen" + Invoke-LoggedCommand "npm run lint:py" -GroupOutput + # pack the emitter Invoke-LoggedCommand "npm pack" Copy-Item "typespec-http-client-python-$emitterVersion.tgz" -Destination "$outputPath/packages" diff --git a/packages/http-client-python/eng/scripts/ci/utils.ts b/packages/http-client-python/eng/scripts/ci/utils.ts index 3c3bc83e17..2beb167fb3 100644 --- a/packages/http-client-python/eng/scripts/ci/utils.ts +++ b/packages/http-client-python/eng/scripts/ci/utils.ts @@ -11,6 +11,8 @@ const argv = parseArgs({ args: process.argv.slice(2), options: { pythonPath: { type: "string" }, + folderName: { type: "string" }, + command: { type: "string" }, }, }); diff --git a/packages/http-client-python/generator/pygen/black.py b/packages/http-client-python/generator/pygen/black.py index f8fd58b223..39dee18947 100644 --- a/packages/http-client-python/generator/pygen/black.py +++ b/packages/http-client-python/generator/pygen/black.py @@ -51,6 +51,7 @@ def process(self) -> bool: return True def format_file(self, file: Path) -> None: + file_content = "" try: file_content = self.read_file(file) file_content = black.format_file_contents(file_content, fast=True, mode=_BLACK_MODE) diff --git a/packages/http-client-python/generator/pygen/codegen/__init__.py b/packages/http-client-python/generator/pygen/codegen/__init__.py index 1ab9bd6237..8a08e8e6a2 100644 --- a/packages/http-client-python/generator/pygen/codegen/__init__.py +++ b/packages/http-client-python/generator/pygen/codegen/__init__.py @@ -249,8 +249,15 @@ def sort_exceptions(yaml_data: Dict[str, Any]) -> None: if not operation.get("exceptions"): continue # sort exceptions by status code, first single status code, then range, then default - operation["exceptions"] = sorted(operation["exceptions"], key=lambda x: 3 if x["statusCodes"][0] == "default" else (1 if isinstance(x["statusCodes"][0], int) else 2)) - + operation["exceptions"] = sorted( + operation["exceptions"], + key=lambda x: ( + 3 + if x["statusCodes"][0] == "default" + else (1 if isinstance(x["statusCodes"][0], int) else 2) + ), + ) + @staticmethod def remove_cloud_errors(yaml_data: Dict[str, Any]) -> None: for client in yaml_data["clients"]: @@ -325,7 +332,7 @@ def process(self) -> bool: self._validate_code_model_options() options = self._build_code_model_options() yaml_data = self.get_yaml() - + self.sort_exceptions(yaml_data) if self.options_retriever.azure_arm: diff --git a/packages/http-client-python/generator/pygen/codegen/models/lro_paging_operation.py b/packages/http-client-python/generator/pygen/codegen/models/lro_paging_operation.py index 326ed2aac9..ae6cd4936b 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/lro_paging_operation.py +++ b/packages/http-client-python/generator/pygen/codegen/models/lro_paging_operation.py @@ -3,7 +3,7 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from typing import Any +from typing import Any, List, Union from .imports import FileImport from .lro_operation import LROOperationBase from .paging_operation import PagingOperationBase @@ -12,7 +12,7 @@ class LROPagingOperation(LROOperationBase[LROPagingResponse], PagingOperationBase[LROPagingResponse]): @property - def success_status_codes(self): + def success_status_codes(self) -> List[Union[int, str, List[int]]]: """The list of all successfull status code.""" return [200] diff --git a/packages/http-client-python/generator/pygen/codegen/models/operation.py b/packages/http-client-python/generator/pygen/codegen/models/operation.py index 22aed0fdb2..78e9b2d8dc 100644 --- a/packages/http-client-python/generator/pygen/codegen/models/operation.py +++ b/packages/http-client-python/generator/pygen/codegen/models/operation.py @@ -3,19 +3,16 @@ # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- -from itertools import chain from typing import ( Dict, List, Any, Optional, - Tuple, Union, TYPE_CHECKING, Generic, TypeVar, cast, - Sequence, ) from .request_builder_parameter import RequestBuilderParameter @@ -206,7 +203,9 @@ def default_error_deserialization(self) -> Optional[str]: @property def non_default_errors(self) -> List[Response]: - return [e for e in self.exceptions if "default" not in e.status_codes and e.type and isinstance(e.type, ModelType)] + return [ + e for e in self.exceptions if "default" not in e.status_codes and e.type and isinstance(e.type, ModelType) + ] def _imports_shared(self, async_mode: bool, **kwargs: Any) -> FileImport: # pylint: disable=unused-argument file_import = FileImport(self.code_model) @@ -419,7 +418,9 @@ def imports( # pylint: disable=too-many-branches, disable=too-many-statements elif any(r.type for r in self.responses): file_import.add_submodule_import(f"{relative_path}_model_base", "_deserialize", ImportType.LOCAL) if self.default_error_deserialization or self.non_default_errors: - file_import.add_submodule_import(f"{relative_path}_model_base", "_failsafe_deserialize", ImportType.LOCAL) + file_import.add_submodule_import( + f"{relative_path}_model_base", "_failsafe_deserialize", ImportType.LOCAL + ) return file_import def get_response_from_status(self, status_code: Optional[Union[str, int]]) -> ResponseType: @@ -429,7 +430,7 @@ def get_response_from_status(self, status_code: Optional[Union[str, int]]) -> Re raise ValueError(f"Incorrect status code {status_code}, operation {self.name}") from exc @property - def success_status_codes(self) -> Sequence[Union[str, int]]: + def success_status_codes(self) -> List[Union[int, str, List[int]]]: """The list of all successfull status code.""" return sorted([code for response in self.responses for code in response.status_codes]) diff --git a/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py b/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py index 34924397e1..2293b5e6b4 100644 --- a/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py +++ b/packages/http-client-python/generator/pygen/codegen/serializers/builder_serializer.py @@ -991,9 +991,7 @@ def handle_error_response(self, builder: OperationType) -> List[str]: elif isinstance(builder.stream_value, str): # _stream is not sure, so we need to judge it retval.append(" if _stream:") retval.extend([f" {l}" for l in response_read]) - retval.append( - f" map_error(status_code=response.status_code, response=response, error_map=error_map)" - ) + retval.append(" map_error(status_code=response.status_code, response=response, error_map=error_map)") error_model = "" if builder.non_default_errors and self.code_model.options["models_mode"]: error_model = ", model=error" @@ -1005,10 +1003,10 @@ def handle_error_response(self, builder: OperationType) -> List[str]: for status_code in e.status_codes: retval.append(f" {condition} response.status_code == {status_code}:") if self.code_model.options["models_mode"] == "dpg": - retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") + retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") # type: ignore # pylint: disable=line-too-long else: retval.append( - f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " + f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " # type: ignore # pylint: disable=line-too-long "pipeline_response)" ) # add build-in error type @@ -1043,12 +1041,14 @@ def handle_error_response(self, builder: OperationType) -> List[str]: ) # ranged status code only exist in typespec and will not have multiple status codes else: - retval.append(f" {condition} {e.status_codes[0][0]} <= response.status_code <= {e.status_codes[0][1]}:") + retval.append( + f" {condition} {e.status_codes[0][0]} <= response.status_code <= {e.status_codes[0][1]}:" + ) if self.code_model.options["models_mode"] == "dpg": - retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") + retval.append(f" error = _failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, response.json())") # type: ignore # pylint: disable=line-too-long else: retval.append( - f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " + f" error = self._deserialize.failsafe_deserialize({e.type.type_annotation(is_operation_file=True, skip_quote=True)}, " # type: ignore # pylint: disable=line-too-long "pipeline_response)" ) condition = "elif" @@ -1059,7 +1059,9 @@ def handle_error_response(self, builder: OperationType) -> List[str]: if builder.non_default_errors: retval.append(" else:") if self.code_model.options["models_mode"] == "dpg": - retval.append(f"{indent}error = _failsafe_deserialize({builder.default_error_deserialization}, response.json())") + retval.append( + f"{indent}error = _failsafe_deserialize({builder.default_error_deserialization}, response.json())" + ) else: retval.append( f"{indent}error = self._deserialize.failsafe_deserialize({builder.default_error_deserialization}, " @@ -1086,7 +1088,7 @@ def handle_response(self, builder: OperationType) -> List[str]: if len(builder.responses) > 1: status_codes, res_headers, res_deserialization = [], [], [] for status_code in builder.success_status_codes: - response = builder.get_response_from_status(status_code) + response = builder.get_response_from_status(status_code) # type: ignore if response.headers or response.type: status_codes.append(status_code) res_headers.append(self.response_headers(response)) @@ -1143,10 +1145,13 @@ def _need_specific_error_map(self, code: int, builder: OperationType) -> bool: if code in non_default_error.status_codes: return False # ranged status code - if isinstance(non_default_error.status_codes[0], list) and non_default_error.status_codes[0][0] <= code <= non_default_error.status_codes[0][1]: + if ( + isinstance(non_default_error.status_codes[0], list) + and non_default_error.status_codes[0][0] <= code <= non_default_error.status_codes[0][1] + ): return False return True - + def error_map(self, builder: OperationType) -> List[str]: retval = ["error_map: MutableMapping = {"] if builder.non_default_errors and self.code_model.options["models_mode"]: diff --git a/packages/http-client-python/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py b/packages/http-client-python/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py index 1e8fbe0213..abf03c911c 100644 --- a/packages/http-client-python/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py +++ b/packages/http-client-python/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_resource_async.py @@ -36,9 +36,7 @@ async def test_client_signature(credential, authentication_policy): # make sure signautre order is correct await client.top_level.get(RESOURCE_GROUP_NAME, "top") # make sure signautre name is correct - await client.top_level.get( - resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top" - ) + await client.top_level.get(resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top") @pytest.mark.asyncio diff --git a/packages/http-client-python/generator/test/azure/mock_api_tests/test_azure_arm_resource.py b/packages/http-client-python/generator/test/azure/mock_api_tests/test_azure_arm_resource.py index d79bc05168..ecc550477e 100644 --- a/packages/http-client-python/generator/test/azure/mock_api_tests/test_azure_arm_resource.py +++ b/packages/http-client-python/generator/test/azure/mock_api_tests/test_azure_arm_resource.py @@ -35,9 +35,7 @@ def test_client_signature(credential, authentication_policy): # make sure signautre order is correct client.top_level.get(RESOURCE_GROUP_NAME, "top") # make sure signautre name is correct - client.top_level.get( - resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top" - ) + client.top_level.get(resource_group_name=RESOURCE_GROUP_NAME, top_level_tracked_resource_name="top") def test_top_level_begin_create_or_replace(client): diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json index 94ebdc2c53..a0aa6378bf 100644 --- a/packages/http-client-python/package.json +++ b/packages/http-client-python/package.json @@ -33,7 +33,7 @@ "build": "tsc -p ./emitter/tsconfig.build.json", "watch": "tsc -p ./emitter/tsconfig.build.json --watch", "lint": "eslint . --max-warnings=0", - "lint:py": "tsx ./eng/scripts/ci/lint.ts --folderName generator", + "lint:py": "tsx ./eng/scripts/ci/lint.ts --folderName generator/pygen", "format": "pnpm -w format:dir packages/http-client-python && tsx ./eng/scripts/ci/format.ts", "install": "tsx ./eng/scripts/setup/run-python3.ts ./eng/scripts/setup/install.py", "prepare": "tsx ./eng/scripts/setup/run-python3.ts ./eng/scripts/setup/prepare.py", From 2a032944f23c21638b1bc7d8e4452d2b744c4531 Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Tue, 10 Dec 2024 17:52:39 +0000 Subject: [PATCH 41/71] [@typespec/spector] Update start server scenario paths (#5309) With my earlier PRs, I have already moved all the `scenarioPath` parameters to `scenarioPaths` parameter i.e. made that parameter from a single value to an array of values. But, this start script was missed earlier. But, the Go SDK generator uses this script and need this to be updated. This PR acoomplishes that. Please review and approve this PR. Thanks --- ...rtServerScenarioPaths-2024-11-9-11-3-38.md | 7 ++++ ...tServerScenarioPaths-2024-11-9-17-21-55.md | 7 ++++ packages/spec-coverage-sdk/CHANGELOG.md | 4 +++ packages/spec-coverage-sdk/package.json | 2 +- packages/spec-coverage-sdk/src/types.ts | 1 + packages/spec-dashboard/src/apis.ts | 36 ++++++++++--------- packages/spector/CHANGELOG.md | 4 +++ packages/spector/package.json | 2 +- packages/spector/src/actions/serve.ts | 6 ++-- packages/spector/src/cli/cli.ts | 9 ++--- packages/spector/src/coverage/common.ts | 1 + 11 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 .chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md create mode 100644 .chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md diff --git a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md new file mode 100644 index 0000000000..b12a7add0d --- /dev/null +++ b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/spector" +--- + +Update `server start` script parameter - `scenarioPath` to `scenarioPaths`. \ No newline at end of file diff --git a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md new file mode 100644 index 0000000000..7afadab420 --- /dev/null +++ b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@typespec/spec-coverage-sdk" +--- + +Added packageName property to metadata \ No newline at end of file diff --git a/packages/spec-coverage-sdk/CHANGELOG.md b/packages/spec-coverage-sdk/CHANGELOG.md index a4aa9dfce2..9cded5a7fd 100644 --- a/packages/spec-coverage-sdk/CHANGELOG.md +++ b/packages/spec-coverage-sdk/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/spec-coverage-sdk +## 0.1.0-alpha.2 + +- Added `packageName` to `scenariosMetadata`. + ## 0.1.0-alpha.1 No changes, version bump only. diff --git a/packages/spec-coverage-sdk/package.json b/packages/spec-coverage-sdk/package.json index 286eb09abb..759a183d2e 100644 --- a/packages/spec-coverage-sdk/package.json +++ b/packages/spec-coverage-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/spec-coverage-sdk", - "version": "0.1.0-alpha.1", + "version": "0.1.0-alpha.2", "description": "Spec utility to manage the reported coverage", "main": "dist/index.js", "type": "module", diff --git a/packages/spec-coverage-sdk/src/types.ts b/packages/spec-coverage-sdk/src/types.ts index 8347560e60..db80653900 100644 --- a/packages/spec-coverage-sdk/src/types.ts +++ b/packages/spec-coverage-sdk/src/types.ts @@ -58,6 +58,7 @@ export interface ResolvedCoverageReport extends CoverageReport { export interface ScenariosMetadata { version: string; commit: string; + packageName: string; } export interface GeneratorMetadata { diff --git a/packages/spec-dashboard/src/apis.ts b/packages/spec-dashboard/src/apis.ts index b731ff9ada..82ea1166ad 100644 --- a/packages/spec-dashboard/src/apis.ts +++ b/packages/spec-dashboard/src/apis.ts @@ -7,27 +7,31 @@ import { const storageAccountName = "typespec"; export type GeneratorNames = - | "python" - | "typescript/rlc" - | "typescript/modular" - | "csharp" + | "@typespec/http-client-python" + | "@azure-tools/typespec-python" + | "@azure-tools/typespec-go" + | "@azure-tools/typespec-csharp" | "@typespec/http-client-csharp" - | "java" - | "go" - | "cpp" - | "rust" + | "@azure-tools/typespec-ts-rlc" + | "@azure-tools/typespec-ts-modular" + | "@azure-tools/typespec-java" + | "@typespec/http-client-java" + | "@azure-tools/typespec-cpp" + | "@azure-tools/typespec-rust" | "test"; const query = new URLSearchParams(window.location.search); const generatorNames: GeneratorNames[] = [ - "python", - "typescript/rlc", - "typescript/modular", - "csharp", + "@typespec/http-client-python", + "@azure-tools/typespec-python", + "@azure-tools/typespec-go", + "@azure-tools/typespec-csharp", "@typespec/http-client-csharp", - "java", - "go", - "cpp", - "rust", + "@azure-tools/typespec-ts-rlc", + "@azure-tools/typespec-ts-modular", + "@azure-tools/typespec-java", + "@typespec/http-client-java", + "@azure-tools/typespec-cpp", + "@azure-tools/typespec-rust", ...(query.has("showtest") ? (["test"] as const) : []), ]; diff --git a/packages/spector/CHANGELOG.md b/packages/spector/CHANGELOG.md index 9c289f07cf..c3376411c5 100644 --- a/packages/spector/CHANGELOG.md +++ b/packages/spector/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/spector +## 0.1.0-alpha.4 + +- Update `server start` script parameter - `scenarioPath` to `scenarioPaths`. + ## 0.1.0-alpha.3 No changes, version bump only. diff --git a/packages/spector/package.json b/packages/spector/package.json index 7b25e966de..29099c4231 100644 --- a/packages/spector/package.json +++ b/packages/spector/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/spector", - "version": "0.1.0-alpha.3", + "version": "0.1.0-alpha.4", "description": "Typespec Core Tool to validate, run mock api, collect coverage.", "exports": { ".": { diff --git a/packages/spector/src/actions/serve.ts b/packages/spector/src/actions/serve.ts index 4655f218b8..ef03d7c481 100644 --- a/packages/spector/src/actions/serve.ts +++ b/packages/spector/src/actions/serve.ts @@ -39,14 +39,14 @@ export async function startInBackground(config: ServeConfig) { const [nodeExe, entrypoint] = process.argv; logger.info(`Starting server in background at port ${config.port}`); const scenariosPath = Array.isArray(config.scenariosPath) - ? config.scenariosPath.join(" ") - : config.scenariosPath; + ? config.scenariosPath + : [config.scenariosPath]; const cp = spawn( nodeExe, [ entrypoint, "serve", - scenariosPath, + ...scenariosPath, "--port", config.port.toString(), "--coverageFile", diff --git a/packages/spector/src/cli/cli.ts b/packages/spector/src/cli/cli.ts index 65be2b6f1a..4df5ba4419 100644 --- a/packages/spector/src/cli/cli.ts +++ b/packages/spector/src/cli/cli.ts @@ -92,13 +92,14 @@ async function main() { .command("server", "Server management", (cmd) => { cmd .command( - "start ", + "start ", "Start the server in the background.", (cmd) => { return cmd - .positional("scenariosPath", { - description: "Path to the scenarios and mock apis", + .positional("scenariosPaths", { + description: "Path(s) to the scenarios and mock apis", type: "string", + array: true, demandOption: true, }) .option("port", { @@ -115,7 +116,7 @@ async function main() { }, async (args) => startInBackground({ - scenariosPath: resolve(process.cwd(), args.scenariosPath), + scenariosPath: args.scenariosPaths, port: args.port, coverageFile: args.coverageFile, }), diff --git a/packages/spector/src/coverage/common.ts b/packages/spector/src/coverage/common.ts index fff4d080c9..a9d1ff8f93 100644 --- a/packages/spector/src/coverage/common.ts +++ b/packages/spector/src/coverage/common.ts @@ -6,5 +6,6 @@ export async function getScenarioMetadata(scenariosPath: string): Promise Date: Tue, 10 Dec 2024 12:33:28 -0800 Subject: [PATCH 42/71] Delete XML cadl-ranch projects (#5324) Fixes https://github.com/microsoft/typespec/issues/5322 --- .../eng/scripts/Generate.ps1 | 1 + .../src/Properties/launchSettings.json | 5 - .../http/payload/xml/Configuration.json | 6 - .../http/payload/xml/Payload.Xml.sln | 48 - .../Generated/ModelWithArrayOfModelValue.cs | 35 - .../src/Generated/ModelWithAttributesValue.cs | 35 - .../src/Generated/ModelWithDictionaryValue.cs | 35 - .../src/Generated/ModelWithEmptyArrayValue.cs | 35 - .../Generated/ModelWithEncodedNamesValue.cs | 35 - .../Generated/ModelWithOptionalFieldValue.cs | 35 - .../Generated/ModelWithRenamedArraysValue.cs | 35 - .../Generated/ModelWithRenamedFieldsValue.cs | 35 - .../Generated/ModelWithSimpleArraysValue.cs | 35 - .../xml/src/Generated/ModelWithTextValue.cs | 35 - .../Generated/ModelWithUnwrappedArrayValue.cs | 35 - .../ModelWithArrayOfModel.Serialization.cs | 36 - .../Generated/Models/ModelWithArrayOfModel.cs | 13 - .../ModelWithAttributes.Serialization.cs | 36 - .../Generated/Models/ModelWithAttributes.cs | 15 - .../ModelWithDictionary.Serialization.cs | 36 - .../Generated/Models/ModelWithDictionary.cs | 13 - .../ModelWithEmptyArray.Serialization.cs | 36 - .../Generated/Models/ModelWithEmptyArray.cs | 13 - .../ModelWithEncodedNames.Serialization.cs | 36 - .../Generated/Models/ModelWithEncodedNames.cs | 15 - .../ModelWithOptionalField.Serialization.cs | 36 - .../Models/ModelWithOptionalField.cs | 13 - .../ModelWithRenamedArrays.Serialization.cs | 36 - .../Models/ModelWithRenamedArrays.cs | 15 - .../ModelWithRenamedFields.Serialization.cs | 36 - .../Models/ModelWithRenamedFields.cs | 13 - .../ModelWithSimpleArrays.Serialization.cs | 36 - .../Generated/Models/ModelWithSimpleArrays.cs | 15 - .../Models/ModelWithText.Serialization.cs | 36 - .../xml/src/Generated/Models/ModelWithText.cs | 13 - .../ModelWithUnwrappedArray.Serialization.cs | 36 - .../Models/ModelWithUnwrappedArray.cs | 15 - .../Models/SimpleModel.Serialization.cs | 36 - .../xml/src/Generated/Models/SimpleModel.cs | 13 - .../src/Generated/PayloadXmlModelFactory.cs | 35 - .../xml/src/Generated/SimpleModelValue.cs | 35 - .../payload/xml/src/Generated/XmlClient.cs | 42 - .../xml/src/Generated/XmlClientOptions.cs | 12 - .../http/payload/xml/src/Payload.Xml.csproj | 16 - .../http/payload/xml/tspCodeModel.json | 3150 ----------------- 45 files changed, 1 insertion(+), 4332 deletions(-) delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Configuration.json delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Payload.Xml.sln delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithAttributesValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithTextValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.Serialization.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/PayloadXmlModelFactory.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/SimpleModelValue.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClient.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClientOptions.cs delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Payload.Xml.csproj delete mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/tspCodeModel.json diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1 index 05134142c8..09eb3be3db 100644 --- a/packages/http-client-csharp/eng/scripts/Generate.ps1 +++ b/packages/http-client-csharp/eng/scripts/Generate.ps1 @@ -50,6 +50,7 @@ function IsSpecDir { $failingSpecs = @( Join-Path 'http' 'payload' 'pageable' + Join-Path 'http' 'payload' 'xml' Join-Path 'http' 'special-headers' 'conditional-request' Join-Path 'http' 'type' 'model' 'flatten' Join-Path 'http' 'type' 'model' 'templated' diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json index f2d5ebb72d..7e1721b39f 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json @@ -115,11 +115,6 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, - "http-payload-xml": { - "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/payload/xml -p StubLibraryPlugin", - "commandName": "Executable", - "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" - }, "http-resiliency-srv-driven-v1": { "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/resiliency/srv-driven/v1 -p StubLibraryPlugin", "commandName": "Executable", diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Configuration.json deleted file mode 100644 index 8c15e60ef5..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Configuration.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "output-folder": ".", - "namespace": "Payload.Xml", - "library-name": "Payload.Xml", - "use-model-reader-writer": true -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Payload.Xml.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Payload.Xml.sln deleted file mode 100644 index cc8a0e28df..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/Payload.Xml.sln +++ /dev/null @@ -1,48 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29709.97 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Payload.Xml", "src\Payload.Xml.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU - {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} - EndGlobalSection -EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs deleted file mode 100644 index d97bb23104..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithArrayOfModelValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithArrayOfModelValue - { - protected ModelWithArrayOfModelValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithArrayOfModel input) => throw null; - - public virtual Task PutAsync(ModelWithArrayOfModel input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithAttributesValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithAttributesValue.cs deleted file mode 100644 index d36d1a98e4..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithAttributesValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithAttributesValue - { - protected ModelWithAttributesValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithAttributes input) => throw null; - - public virtual Task PutAsync(ModelWithAttributes input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs deleted file mode 100644 index 5326a01610..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithDictionaryValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithDictionaryValue - { - protected ModelWithDictionaryValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithDictionary input) => throw null; - - public virtual Task PutAsync(ModelWithDictionary input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs deleted file mode 100644 index 4f8a338ad1..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEmptyArrayValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithEmptyArrayValue - { - protected ModelWithEmptyArrayValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithEmptyArray input) => throw null; - - public virtual Task PutAsync(ModelWithEmptyArray input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs deleted file mode 100644 index ef8d42468c..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithEncodedNamesValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithEncodedNamesValue - { - protected ModelWithEncodedNamesValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithEncodedNames input) => throw null; - - public virtual Task PutAsync(ModelWithEncodedNames input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs deleted file mode 100644 index 22a25317dd..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithOptionalFieldValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithOptionalFieldValue - { - protected ModelWithOptionalFieldValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithOptionalField input) => throw null; - - public virtual Task PutAsync(ModelWithOptionalField input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs deleted file mode 100644 index 15bb6208eb..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedArraysValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithRenamedArraysValue - { - protected ModelWithRenamedArraysValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithRenamedArrays input) => throw null; - - public virtual Task PutAsync(ModelWithRenamedArrays input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs deleted file mode 100644 index 6878af75f0..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithRenamedFieldsValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithRenamedFieldsValue - { - protected ModelWithRenamedFieldsValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithRenamedFields input) => throw null; - - public virtual Task PutAsync(ModelWithRenamedFields input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs deleted file mode 100644 index f9db5db5d8..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithSimpleArraysValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithSimpleArraysValue - { - protected ModelWithSimpleArraysValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithSimpleArrays input) => throw null; - - public virtual Task PutAsync(ModelWithSimpleArrays input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithTextValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithTextValue.cs deleted file mode 100644 index 4c9d646f8c..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithTextValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithTextValue - { - protected ModelWithTextValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithText input) => throw null; - - public virtual Task PutAsync(ModelWithText input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs deleted file mode 100644 index bd6624fdfb..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/ModelWithUnwrappedArrayValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class ModelWithUnwrappedArrayValue - { - protected ModelWithUnwrappedArrayValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(ModelWithUnwrappedArray input) => throw null; - - public virtual Task PutAsync(ModelWithUnwrappedArray input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.Serialization.cs deleted file mode 100644 index 9374603f7d..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithArrayOfModel : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithArrayOfModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithArrayOfModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithArrayOfModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithArrayOfModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithArrayOfModel modelWithArrayOfModel) => throw null; - - public static explicit operator ModelWithArrayOfModel(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.cs deleted file mode 100644 index c6aa97238d..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithArrayOfModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithArrayOfModel - { - public IList Items => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.Serialization.cs deleted file mode 100644 index a76524203b..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithAttributes : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithAttributes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithAttributes JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithAttributes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithAttributes PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithAttributes modelWithAttributes) => throw null; - - public static explicit operator ModelWithAttributes(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.cs deleted file mode 100644 index 1af505fadb..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithAttributes.cs +++ /dev/null @@ -1,15 +0,0 @@ -// - -#nullable disable - -namespace Payload.Xml.Models -{ - public partial class ModelWithAttributes - { - public int Id1 => throw null; - - public string Id2 => throw null; - - public bool Enabled => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.Serialization.cs deleted file mode 100644 index 0ff9e516be..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithDictionary : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithDictionary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithDictionary JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithDictionary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithDictionary PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithDictionary modelWithDictionary) => throw null; - - public static explicit operator ModelWithDictionary(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.cs deleted file mode 100644 index 90b7a25c09..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithDictionary.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithDictionary - { - public IDictionary Metadata => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.Serialization.cs deleted file mode 100644 index 1c4f4ebb18..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithEmptyArray : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithEmptyArray IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithEmptyArray JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithEmptyArray IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithEmptyArray PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithEmptyArray modelWithEmptyArray) => throw null; - - public static explicit operator ModelWithEmptyArray(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.cs deleted file mode 100644 index 358abeb230..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEmptyArray.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithEmptyArray - { - public IList Items => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.Serialization.cs deleted file mode 100644 index 34aa38cdc7..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithEncodedNames : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithEncodedNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithEncodedNames JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithEncodedNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithEncodedNames PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithEncodedNames modelWithEncodedNames) => throw null; - - public static explicit operator ModelWithEncodedNames(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.cs deleted file mode 100644 index eb05d8493b..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithEncodedNames.cs +++ /dev/null @@ -1,15 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithEncodedNames - { - public SimpleModel ModelData => throw null; - - public IList Colors => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.Serialization.cs deleted file mode 100644 index 596502a4b1..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithOptionalField : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithOptionalField IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithOptionalField JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithOptionalField IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithOptionalField PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithOptionalField modelWithOptionalField) => throw null; - - public static explicit operator ModelWithOptionalField(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.cs deleted file mode 100644 index f5f569907d..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithOptionalField.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -namespace Payload.Xml.Models -{ - public partial class ModelWithOptionalField - { - public string Item => throw null; - - public int? Value => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.Serialization.cs deleted file mode 100644 index 47e521601c..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithRenamedArrays : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithRenamedArrays IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithRenamedArrays JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithRenamedArrays IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithRenamedArrays PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithRenamedArrays modelWithRenamedArrays) => throw null; - - public static explicit operator ModelWithRenamedArrays(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.cs deleted file mode 100644 index 1abe0a1d4e..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedArrays.cs +++ /dev/null @@ -1,15 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithRenamedArrays - { - public IList Colors => throw null; - - public IList Counts => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.Serialization.cs deleted file mode 100644 index cf9ebc10b7..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithRenamedFields : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithRenamedFields IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithRenamedFields JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithRenamedFields IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithRenamedFields PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithRenamedFields modelWithRenamedFields) => throw null; - - public static explicit operator ModelWithRenamedFields(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.cs deleted file mode 100644 index fcab9c7b22..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithRenamedFields.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -namespace Payload.Xml.Models -{ - public partial class ModelWithRenamedFields - { - public SimpleModel InputData => throw null; - - public SimpleModel OutputData => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.Serialization.cs deleted file mode 100644 index cc65a22823..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithSimpleArrays : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithSimpleArrays IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithSimpleArrays JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithSimpleArrays IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithSimpleArrays PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithSimpleArrays modelWithSimpleArrays) => throw null; - - public static explicit operator ModelWithSimpleArrays(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.cs deleted file mode 100644 index cd1896fdb2..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithSimpleArrays.cs +++ /dev/null @@ -1,15 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithSimpleArrays - { - public IList Colors => throw null; - - public IList Counts => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.Serialization.cs deleted file mode 100644 index 7fea64586a..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithText : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithText IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithText JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithText IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithText PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithText modelWithText) => throw null; - - public static explicit operator ModelWithText(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.cs deleted file mode 100644 index 339fa6614e..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithText.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -namespace Payload.Xml.Models -{ - public partial class ModelWithText - { - public string Language => throw null; - - public string Content => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.Serialization.cs deleted file mode 100644 index ae74fce859..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class ModelWithUnwrappedArray : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - ModelWithUnwrappedArray IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithUnwrappedArray JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - ModelWithUnwrappedArray IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual ModelWithUnwrappedArray PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(ModelWithUnwrappedArray modelWithUnwrappedArray) => throw null; - - public static explicit operator ModelWithUnwrappedArray(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.cs deleted file mode 100644 index 21f18aec28..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/ModelWithUnwrappedArray.cs +++ /dev/null @@ -1,15 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public partial class ModelWithUnwrappedArray - { - public IList Colors => throw null; - - public IList Counts => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.Serialization.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.Serialization.cs deleted file mode 100644 index 52b932b4a0..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.Serialization.cs +++ /dev/null @@ -1,36 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Payload.Xml.Models -{ - public partial class SimpleModel : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) => throw null; - - SimpleModel IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - protected virtual SimpleModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => throw null; - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => throw null; - - protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) => throw null; - - SimpleModel IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => throw null; - - protected virtual SimpleModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) => throw null; - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => throw null; - - public static implicit operator BinaryContent(SimpleModel simpleModel) => throw null; - - public static explicit operator SimpleModel(ClientResult result) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.cs deleted file mode 100644 index e02e208422..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/Models/SimpleModel.cs +++ /dev/null @@ -1,13 +0,0 @@ -// - -#nullable disable - -namespace Payload.Xml.Models -{ - public partial class SimpleModel - { - public string Name => throw null; - - public int Age => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/PayloadXmlModelFactory.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/PayloadXmlModelFactory.cs deleted file mode 100644 index a9bedbe182..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/PayloadXmlModelFactory.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.Collections.Generic; - -namespace Payload.Xml.Models -{ - public static partial class PayloadXmlModelFactory - { - public static ModelWithEncodedNames ModelWithEncodedNames(SimpleModel modelData = default, IEnumerable colors = default) => throw null; - - public static SimpleModel SimpleModel(string name = default, int age = default) => throw null; - - public static ModelWithDictionary ModelWithDictionary(IDictionary metadata = default) => throw null; - - public static ModelWithText ModelWithText(string language = default, string content = default) => throw null; - - public static ModelWithEmptyArray ModelWithEmptyArray(IEnumerable items = default) => throw null; - - public static ModelWithRenamedFields ModelWithRenamedFields(SimpleModel inputData = default, SimpleModel outputData = default) => throw null; - - public static ModelWithRenamedArrays ModelWithRenamedArrays(IEnumerable colors = default, IEnumerable counts = default) => throw null; - - public static ModelWithUnwrappedArray ModelWithUnwrappedArray(IEnumerable colors = default, IEnumerable counts = default) => throw null; - - public static ModelWithAttributes ModelWithAttributes(int id1 = default, string id2 = default, bool enabled = default) => throw null; - - public static ModelWithOptionalField ModelWithOptionalField(string item = default, int? value = default) => throw null; - - public static ModelWithArrayOfModel ModelWithArrayOfModel(IEnumerable items = default) => throw null; - - public static ModelWithSimpleArrays ModelWithSimpleArrays(IEnumerable colors = default, IEnumerable counts = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/SimpleModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/SimpleModelValue.cs deleted file mode 100644 index abcdd7dc3b..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/SimpleModelValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -// - -#nullable disable - -using System.ClientModel; -using System.ClientModel.Primitives; -using System.Threading; -using System.Threading.Tasks; -using Payload.Xml.Models; - -namespace Payload.Xml -{ - public partial class SimpleModelValue - { - protected SimpleModelValue() => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual ClientResult Get(RequestOptions options) => throw null; - - public virtual Task GetAsync(RequestOptions options) => throw null; - - public virtual ClientResult Get() => throw null; - - public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null; - - public virtual ClientResult Put(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null; - - public virtual ClientResult Put(SimpleModel input) => throw null; - - public virtual Task PutAsync(SimpleModel input, CancellationToken cancellationToken = default) => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClient.cs deleted file mode 100644 index 980b4fce21..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClient.cs +++ /dev/null @@ -1,42 +0,0 @@ -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; - -namespace Payload.Xml -{ - public partial class XmlClient - { - public XmlClient() : this(new Uri("http://localhost:3000"), new XmlClientOptions()) => throw null; - - public XmlClient(Uri endpoint, XmlClientOptions options) => throw null; - - public ClientPipeline Pipeline => throw null; - - public virtual SimpleModelValue GetSimpleModelValueClient() => throw null; - - public virtual ModelWithSimpleArraysValue GetModelWithSimpleArraysValueClient() => throw null; - - public virtual ModelWithArrayOfModelValue GetModelWithArrayOfModelValueClient() => throw null; - - public virtual ModelWithOptionalFieldValue GetModelWithOptionalFieldValueClient() => throw null; - - public virtual ModelWithAttributesValue GetModelWithAttributesValueClient() => throw null; - - public virtual ModelWithUnwrappedArrayValue GetModelWithUnwrappedArrayValueClient() => throw null; - - public virtual ModelWithRenamedArraysValue GetModelWithRenamedArraysValueClient() => throw null; - - public virtual ModelWithRenamedFieldsValue GetModelWithRenamedFieldsValueClient() => throw null; - - public virtual ModelWithEmptyArrayValue GetModelWithEmptyArrayValueClient() => throw null; - - public virtual ModelWithTextValue GetModelWithTextValueClient() => throw null; - - public virtual ModelWithDictionaryValue GetModelWithDictionaryValueClient() => throw null; - - public virtual ModelWithEncodedNamesValue GetModelWithEncodedNamesValueClient() => throw null; - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClientOptions.cs deleted file mode 100644 index 467bebf98b..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Generated/XmlClientOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// - -#nullable disable - -using System.ClientModel.Primitives; - -namespace Payload.Xml -{ - public partial class XmlClientOptions : ClientPipelineOptions - { - } -} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Payload.Xml.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Payload.Xml.csproj deleted file mode 100644 index 8e68e7a868..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/src/Payload.Xml.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - This is the Payload.Xml client library for developing .NET applications with rich experience. - SDK Code Generation Payload.Xml - 1.0.0-beta.1 - Payload.Xml - netstandard2.0 - latest - true - - - - - - - diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/tspCodeModel.json deleted file mode 100644 index 526887cef4..0000000000 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/xml/tspCodeModel.json +++ /dev/null @@ -1,3150 +0,0 @@ -{ - "$id": "1", - "Name": "Payload.Xml", - "ApiVersions": [], - "Enums": [], - "Models": [ - { - "$id": "2", - "kind": "model", - "name": "ModelWithEncodedNames", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithEncodedNames", - "usage": "Input,Output,Xml", - "description": "Uses encodedName instead of Xml.Name which is functionally equivalent.", - "decorators": [], - "properties": [ - { - "$id": "3", - "kind": "property", - "name": "modelData", - "serializedName": "modelData", - "type": { - "$id": "4", - "kind": "model", - "name": "SimpleModel", - "crossLanguageDefinitionId": "Payload.Xml.SimpleModel", - "usage": "Input,Output,Xml", - "description": "Contains fields of primitive types.", - "decorators": [], - "properties": [ - { - "$id": "5", - "kind": "property", - "name": "name", - "serializedName": "name", - "type": { - "$id": "6", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.SimpleModel.name" - }, - { - "$id": "7", - "kind": "property", - "name": "age", - "serializedName": "age", - "type": { - "$id": "8", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.SimpleModel.age" - } - ] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithEncodedNames.modelData" - }, - { - "$id": "9", - "kind": "property", - "name": "colors", - "serializedName": "colors", - "type": { - "$id": "10", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "11", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithEncodedNames.colors" - } - ] - }, - { - "$ref": "4" - }, - { - "$id": "12", - "kind": "model", - "name": "ModelWithDictionary", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithDictionary", - "usage": "Input,Output,Xml", - "description": "Contains a dictionary of key value pairs.", - "decorators": [], - "properties": [ - { - "$id": "13", - "kind": "property", - "name": "metadata", - "serializedName": "metadata", - "type": { - "$id": "14", - "kind": "dict", - "keyType": { - "$id": "15", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "valueType": { - "$id": "16", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithDictionary.metadata" - } - ] - }, - { - "$id": "17", - "kind": "model", - "name": "ModelWithText", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithText", - "usage": "Input,Output,Xml", - "description": "Contains an attribute and text.", - "decorators": [], - "properties": [ - { - "$id": "18", - "kind": "property", - "name": "language", - "serializedName": "language", - "type": { - "$id": "19", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "20", - "name": "TypeSpec.Xml.@attribute", - "arguments": { - "$id": "21" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithText.language" - }, - { - "$id": "22", - "kind": "property", - "name": "content", - "serializedName": "content", - "type": { - "$id": "23", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "24", - "name": "TypeSpec.Xml.@unwrapped", - "arguments": { - "$id": "25" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithText.content" - } - ] - }, - { - "$id": "26", - "kind": "model", - "name": "ModelWithEmptyArray", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithEmptyArray", - "usage": "Input,Output,Xml", - "description": "Contains an array of models that's supposed to be sent/received as an empty XML element.", - "decorators": [], - "properties": [ - { - "$id": "27", - "kind": "property", - "name": "items", - "serializedName": "items", - "type": { - "$id": "28", - "kind": "array", - "name": "ArraySimpleModel", - "valueType": { - "$ref": "4" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithEmptyArray.items" - } - ] - }, - { - "$id": "29", - "kind": "model", - "name": "ModelWithRenamedFields", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedFields", - "usage": "Input,Output,Xml", - "description": "Contains fields of the same type that have different XML representation.", - "decorators": [ - { - "$id": "30", - "name": "TypeSpec.Xml.@name", - "arguments": { - "$id": "31", - "name": "ModelWithRenamedFieldsSrc" - } - } - ], - "properties": [ - { - "$id": "32", - "kind": "property", - "name": "inputData", - "serializedName": "inputData", - "type": { - "$ref": "4" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "33", - "name": "TypeSpec.Xml.@name", - "arguments": { - "$id": "34", - "name": "InputData" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedFields.inputData" - }, - { - "$id": "35", - "kind": "property", - "name": "outputData", - "serializedName": "outputData", - "type": { - "$ref": "4" - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "36", - "name": "TypeSpec.Xml.@name", - "arguments": { - "$id": "37", - "name": "OutputData" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedFields.outputData" - } - ] - }, - { - "$id": "38", - "kind": "model", - "name": "ModelWithRenamedArrays", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedArrays", - "usage": "Input,Output,Xml", - "description": "Contains fields of wrapped and unwrapped arrays of primitive types that have different XML representations.", - "decorators": [], - "properties": [ - { - "$id": "39", - "kind": "property", - "name": "colors", - "serializedName": "colors", - "type": { - "$id": "40", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "41", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "42", - "name": "TypeSpec.Xml.@unwrapped", - "arguments": { - "$id": "43" - } - }, - { - "$id": "44", - "name": "TypeSpec.Xml.@name", - "arguments": { - "$id": "45", - "name": "Colors" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedArrays.colors" - }, - { - "$id": "46", - "kind": "property", - "name": "counts", - "serializedName": "counts", - "type": { - "$id": "47", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "48", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "49", - "name": "TypeSpec.Xml.@name", - "arguments": { - "$id": "50", - "name": "Counts" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedArrays.counts" - } - ] - }, - { - "$id": "51", - "kind": "model", - "name": "ModelWithUnwrappedArray", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithUnwrappedArray", - "usage": "Input,Output,Xml", - "description": "Contains fields of wrapped and unwrapped arrays of primitive types.", - "decorators": [], - "properties": [ - { - "$id": "52", - "kind": "property", - "name": "colors", - "serializedName": "colors", - "type": { - "$id": "53", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "54", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "55", - "name": "TypeSpec.Xml.@unwrapped", - "arguments": { - "$id": "56" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithUnwrappedArray.colors" - }, - { - "$id": "57", - "kind": "property", - "name": "counts", - "serializedName": "counts", - "type": { - "$id": "58", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "59", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithUnwrappedArray.counts" - } - ] - }, - { - "$id": "60", - "kind": "model", - "name": "ModelWithAttributes", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithAttributes", - "usage": "Input,Output,Xml", - "description": "Contains fields that are XML attributes.", - "decorators": [], - "properties": [ - { - "$id": "61", - "kind": "property", - "name": "id1", - "serializedName": "id1", - "type": { - "$id": "62", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "63", - "name": "TypeSpec.Xml.@attribute", - "arguments": { - "$id": "64" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithAttributes.id1" - }, - { - "$id": "65", - "kind": "property", - "name": "id2", - "serializedName": "id2", - "type": { - "$id": "66", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [ - { - "$id": "67", - "name": "TypeSpec.Xml.@attribute", - "arguments": { - "$id": "68" - } - } - ], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithAttributes.id2" - }, - { - "$id": "69", - "kind": "property", - "name": "enabled", - "serializedName": "enabled", - "type": { - "$id": "70", - "kind": "boolean", - "name": "boolean", - "crossLanguageDefinitionId": "TypeSpec.boolean", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithAttributes.enabled" - } - ] - }, - { - "$id": "71", - "kind": "model", - "name": "ModelWithOptionalField", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithOptionalField", - "usage": "Input,Output,Xml", - "description": "Contains an optional field.", - "decorators": [], - "properties": [ - { - "$id": "72", - "kind": "property", - "name": "item", - "serializedName": "item", - "type": { - "$id": "73", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithOptionalField.item" - }, - { - "$id": "74", - "kind": "property", - "name": "value", - "serializedName": "value", - "type": { - "$id": "75", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "optional": true, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithOptionalField.value" - } - ] - }, - { - "$id": "76", - "kind": "model", - "name": "ModelWithArrayOfModel", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithArrayOfModel", - "usage": "Input,Output,Xml", - "description": "Contains an array of models.", - "decorators": [], - "properties": [ - { - "$id": "77", - "kind": "property", - "name": "items", - "serializedName": "items", - "type": { - "$id": "78", - "kind": "array", - "name": "ArraySimpleModel", - "valueType": { - "$ref": "4" - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithArrayOfModel.items" - } - ] - }, - { - "$id": "79", - "kind": "model", - "name": "ModelWithSimpleArrays", - "crossLanguageDefinitionId": "Payload.Xml.ModelWithSimpleArrays", - "usage": "Input,Output,Xml", - "description": "Contains fields of arrays of primitive types.", - "decorators": [], - "properties": [ - { - "$id": "80", - "kind": "property", - "name": "colors", - "serializedName": "colors", - "type": { - "$id": "81", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "82", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithSimpleArrays.colors" - }, - { - "$id": "83", - "kind": "property", - "name": "counts", - "serializedName": "counts", - "type": { - "$id": "84", - "kind": "array", - "name": "Array", - "valueType": { - "$id": "85", - "kind": "int32", - "name": "int32", - "crossLanguageDefinitionId": "TypeSpec.int32", - "decorators": [] - }, - "crossLanguageDefinitionId": "TypeSpec.Array", - "decorators": [] - }, - "optional": false, - "readOnly": false, - "discriminator": false, - "flatten": false, - "decorators": [], - "crossLanguageDefinitionId": "Payload.Xml.ModelWithSimpleArrays.counts" - } - ] - } - ], - "Clients": [ - { - "$id": "86", - "Name": "XmlClient", - "Description": "Sends and receives bodies in XML format.", - "Operations": [], - "Protocol": { - "$id": "87" - }, - "Parameters": [ - { - "$id": "88", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "89", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "90", - "Type": { - "$id": "91", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "92", - "Name": "SimpleModelValue", - "Description": "Operations for the SimpleModel type.", - "Operations": [ - { - "$id": "93", - "Name": "get", - "ResourceName": "SimpleModelValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "94", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "95", - "kind": "constant", - "valueType": { - "$id": "96", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "97", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "4" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "98", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "99", - "kind": "constant", - "valueType": { - "$id": "100", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/simpleModel", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.SimpleModelValue.get", - "Decorators": [] - }, - { - "$id": "101", - "Name": "put", - "ResourceName": "SimpleModelValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "102", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "103", - "kind": "constant", - "valueType": { - "$id": "104", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "105", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "4" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "106", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/simpleModel", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.SimpleModelValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "107" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "108", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "109", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "110", - "Type": { - "$id": "111", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "112", - "Name": "ModelWithSimpleArraysValue", - "Description": "Operations for the ModelWithSimpleArrays type.", - "Operations": [ - { - "$id": "113", - "Name": "get", - "ResourceName": "ModelWithSimpleArraysValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "114", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "115", - "kind": "constant", - "valueType": { - "$id": "116", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "117", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "79" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "118", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "119", - "kind": "constant", - "valueType": { - "$id": "120", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithSimpleArrays", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithSimpleArraysValue.get", - "Decorators": [] - }, - { - "$id": "121", - "Name": "put", - "ResourceName": "ModelWithSimpleArraysValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "122", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "123", - "kind": "constant", - "valueType": { - "$id": "124", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "125", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "79" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "126", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithSimpleArrays", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithSimpleArraysValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "127" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "128", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "129", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "130", - "Type": { - "$id": "131", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "132", - "Name": "ModelWithArrayOfModelValue", - "Description": "Operations for the ModelWithArrayOfModel type.", - "Operations": [ - { - "$id": "133", - "Name": "get", - "ResourceName": "ModelWithArrayOfModelValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "134", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "135", - "kind": "constant", - "valueType": { - "$id": "136", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "137", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "76" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "138", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "139", - "kind": "constant", - "valueType": { - "$id": "140", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithArrayOfModel", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithArrayOfModelValue.get", - "Decorators": [] - }, - { - "$id": "141", - "Name": "put", - "ResourceName": "ModelWithArrayOfModelValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "142", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "143", - "kind": "constant", - "valueType": { - "$id": "144", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "145", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "76" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "146", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithArrayOfModel", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithArrayOfModelValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "147" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "148", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "149", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "150", - "Type": { - "$id": "151", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "152", - "Name": "ModelWithOptionalFieldValue", - "Description": "Operations for the ModelWithOptionalField type.", - "Operations": [ - { - "$id": "153", - "Name": "get", - "ResourceName": "ModelWithOptionalFieldValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "154", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "155", - "kind": "constant", - "valueType": { - "$id": "156", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "157", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "71" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "158", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "159", - "kind": "constant", - "valueType": { - "$id": "160", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithOptionalField", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithOptionalFieldValue.get", - "Decorators": [] - }, - { - "$id": "161", - "Name": "put", - "ResourceName": "ModelWithOptionalFieldValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "162", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "163", - "kind": "constant", - "valueType": { - "$id": "164", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "165", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "71" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "166", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithOptionalField", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithOptionalFieldValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "167" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "168", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "169", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "170", - "Type": { - "$id": "171", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "172", - "Name": "ModelWithAttributesValue", - "Description": "Operations for the ModelWithAttributes type.", - "Operations": [ - { - "$id": "173", - "Name": "get", - "ResourceName": "ModelWithAttributesValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "174", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "175", - "kind": "constant", - "valueType": { - "$id": "176", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "177", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "60" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "178", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "179", - "kind": "constant", - "valueType": { - "$id": "180", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithAttributes", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithAttributesValue.get", - "Decorators": [] - }, - { - "$id": "181", - "Name": "put", - "ResourceName": "ModelWithAttributesValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "182", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "183", - "kind": "constant", - "valueType": { - "$id": "184", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "185", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "60" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "186", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithAttributes", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithAttributesValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "187" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "188", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "189", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "190", - "Type": { - "$id": "191", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "192", - "Name": "ModelWithUnwrappedArrayValue", - "Description": "Operations for the ModelWithUnwrappedArray type.", - "Operations": [ - { - "$id": "193", - "Name": "get", - "ResourceName": "ModelWithUnwrappedArrayValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "194", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "195", - "kind": "constant", - "valueType": { - "$id": "196", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "197", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "51" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "198", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "199", - "kind": "constant", - "valueType": { - "$id": "200", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithUnwrappedArray", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithUnwrappedArrayValue.get", - "Decorators": [] - }, - { - "$id": "201", - "Name": "put", - "ResourceName": "ModelWithUnwrappedArrayValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "202", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "203", - "kind": "constant", - "valueType": { - "$id": "204", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "205", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "51" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "206", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithUnwrappedArray", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithUnwrappedArrayValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "207" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "208", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "209", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "210", - "Type": { - "$id": "211", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "212", - "Name": "ModelWithRenamedArraysValue", - "Description": "Operations for the ModelWithRenamedArrays type.", - "Operations": [ - { - "$id": "213", - "Name": "get", - "ResourceName": "ModelWithRenamedArraysValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "214", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "215", - "kind": "constant", - "valueType": { - "$id": "216", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "217", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "38" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "218", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "219", - "kind": "constant", - "valueType": { - "$id": "220", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithRenamedArrays", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedArraysValue.get", - "Decorators": [] - }, - { - "$id": "221", - "Name": "put", - "ResourceName": "ModelWithRenamedArraysValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "222", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "223", - "kind": "constant", - "valueType": { - "$id": "224", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "225", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "38" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "226", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithRenamedArrays", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedArraysValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "227" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "228", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "229", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "230", - "Type": { - "$id": "231", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "232", - "Name": "ModelWithRenamedFieldsValue", - "Description": "Operations for the ModelWithRenamedFields type.", - "Operations": [ - { - "$id": "233", - "Name": "get", - "ResourceName": "ModelWithRenamedFieldsValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "234", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "235", - "kind": "constant", - "valueType": { - "$id": "236", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "237", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "29" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "238", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "239", - "kind": "constant", - "valueType": { - "$id": "240", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithRenamedFields", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedFieldsValue.get", - "Decorators": [] - }, - { - "$id": "241", - "Name": "put", - "ResourceName": "ModelWithRenamedFieldsValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "242", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "243", - "kind": "constant", - "valueType": { - "$id": "244", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "245", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "29" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "246", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithRenamedFields", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithRenamedFieldsValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "247" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "248", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "249", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "250", - "Type": { - "$id": "251", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "252", - "Name": "ModelWithEmptyArrayValue", - "Description": "Operations for the ModelWithEmptyArray type.", - "Operations": [ - { - "$id": "253", - "Name": "get", - "ResourceName": "ModelWithEmptyArrayValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "254", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "255", - "kind": "constant", - "valueType": { - "$id": "256", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "257", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "26" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "258", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "259", - "kind": "constant", - "valueType": { - "$id": "260", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithEmptyArray", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithEmptyArrayValue.get", - "Decorators": [] - }, - { - "$id": "261", - "Name": "put", - "ResourceName": "ModelWithEmptyArrayValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "262", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "263", - "kind": "constant", - "valueType": { - "$id": "264", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "265", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "26" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "266", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithEmptyArray", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithEmptyArrayValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "267" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "268", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "269", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "270", - "Type": { - "$id": "271", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "272", - "Name": "ModelWithTextValue", - "Description": "Operations for the ModelWithText type.", - "Operations": [ - { - "$id": "273", - "Name": "get", - "ResourceName": "ModelWithTextValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "274", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "275", - "kind": "constant", - "valueType": { - "$id": "276", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "277", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "17" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "278", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "279", - "kind": "constant", - "valueType": { - "$id": "280", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithText", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithTextValue.get", - "Decorators": [] - }, - { - "$id": "281", - "Name": "put", - "ResourceName": "ModelWithTextValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "282", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "283", - "kind": "constant", - "valueType": { - "$id": "284", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "285", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "17" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "286", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithText", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithTextValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "287" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "288", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "289", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "290", - "Type": { - "$id": "291", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "292", - "Name": "ModelWithDictionaryValue", - "Description": "Operations for the ModelWithDictionary type.", - "Operations": [ - { - "$id": "293", - "Name": "get", - "ResourceName": "ModelWithDictionaryValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "294", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "295", - "kind": "constant", - "valueType": { - "$id": "296", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "297", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "12" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "298", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "299", - "kind": "constant", - "valueType": { - "$id": "300", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithDictionary", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithDictionaryValue.get", - "Decorators": [] - }, - { - "$id": "301", - "Name": "put", - "ResourceName": "ModelWithDictionaryValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "302", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "303", - "kind": "constant", - "valueType": { - "$id": "304", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "305", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "12" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "306", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithDictionary", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithDictionaryValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "307" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "308", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "309", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "310", - "Type": { - "$id": "311", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - }, - { - "$id": "312", - "Name": "ModelWithEncodedNamesValue", - "Description": "Operations for the ModelWithEncodedNames type.", - "Operations": [ - { - "$id": "313", - "Name": "get", - "ResourceName": "ModelWithEncodedNamesValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "314", - "Name": "accept", - "NameInRequest": "Accept", - "Type": { - "$id": "315", - "kind": "constant", - "valueType": { - "$id": "316", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "317", - "StatusCodes": [ - 200 - ], - "BodyType": { - "$ref": "2" - }, - "BodyMediaType": "Json", - "Headers": [ - { - "$id": "318", - "Name": "contentType", - "NameInResponse": "content-type", - "Type": { - "$id": "319", - "kind": "constant", - "valueType": { - "$id": "320", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - } - } - ], - "IsErrorResponse": false, - "ContentTypes": [ - "application/xml" - ] - } - ], - "HttpMethod": "GET", - "RequestBodyMediaType": "None", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithEncodedNames", - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithEncodedNamesValue.get", - "Decorators": [] - }, - { - "$id": "321", - "Name": "put", - "ResourceName": "ModelWithEncodedNamesValue", - "Accessibility": "public", - "Parameters": [ - { - "$id": "322", - "Name": "contentType", - "NameInRequest": "Content-Type", - "Type": { - "$id": "323", - "kind": "constant", - "valueType": { - "$id": "324", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string", - "decorators": [] - }, - "value": "application/xml", - "decorators": [] - }, - "Location": "Header", - "IsApiVersion": false, - "IsContentType": true, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Constant", - "Decorators": [], - "SkipUrlEncoding": false - }, - { - "$id": "325", - "Name": "input", - "NameInRequest": "input", - "Type": { - "$ref": "2" - }, - "Location": "Body", - "IsApiVersion": false, - "IsContentType": false, - "IsEndpoint": false, - "Explode": false, - "IsRequired": true, - "Kind": "Method", - "Decorators": [], - "SkipUrlEncoding": false - } - ], - "Responses": [ - { - "$id": "326", - "StatusCodes": [ - 204 - ], - "BodyMediaType": "Json", - "Headers": [], - "IsErrorResponse": false - } - ], - "HttpMethod": "PUT", - "RequestBodyMediaType": "Json", - "Uri": "{endpoint}", - "Path": "/payload/xml/modelWithEncodedNames", - "RequestMediaTypes": [ - "application/xml" - ], - "BufferResponse": true, - "GenerateProtocolMethod": true, - "GenerateConvenienceMethod": true, - "CrossLanguageDefinitionId": "Payload.Xml.ModelWithEncodedNamesValue.put", - "Decorators": [] - } - ], - "Protocol": { - "$id": "327" - }, - "Parent": "XmlClient", - "Parameters": [ - { - "$id": "328", - "Name": "endpoint", - "NameInRequest": "endpoint", - "Description": "Service host", - "Type": { - "$id": "329", - "kind": "url", - "name": "url", - "crossLanguageDefinitionId": "TypeSpec.url" - }, - "Location": "Uri", - "IsApiVersion": false, - "IsResourceParameter": false, - "IsContentType": false, - "IsRequired": true, - "IsEndpoint": true, - "SkipUrlEncoding": false, - "Explode": false, - "Kind": "Client", - "DefaultValue": { - "$id": "330", - "Type": { - "$id": "331", - "kind": "string", - "name": "string", - "crossLanguageDefinitionId": "TypeSpec.string" - }, - "Value": "http://localhost:3000" - } - } - ], - "Decorators": [] - } - ] -} From 7a997365ec1b992383d08651c9279cf59cfd36af Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Tue, 10 Dec 2024 13:22:34 -0800 Subject: [PATCH 43/71] Add release notes for December 2024 release (#5323) Release notes for 2024 December --- .../docs/release-notes/release-2024-12-10.md | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 website/src/content/docs/docs/release-notes/release-2024-12-10.md diff --git a/website/src/content/docs/docs/release-notes/release-2024-12-10.md b/website/src/content/docs/docs/release-notes/release-2024-12-10.md new file mode 100644 index 0000000000..629d81a747 --- /dev/null +++ b/website/src/content/docs/docs/release-notes/release-2024-12-10.md @@ -0,0 +1,69 @@ +--- +title: 0.63 - December 2024 +releaseDate: 2024-12-10 +version: "0.63" +--- + +## Notable changes + +### Experimental: Improve Realm, Mutator, and Typekit implementations + +The compiler strongly binds a Realm and Typekit together, and changes mutators so that new types are cloned within the mutator's realm. The default Typekit now creates a default typekit realm for the current program, and a Typekit can be easily created to work in a specific Program or Realm as needed. + +### Enum-driven Visibility + +A new mechanism for visibility that defines valid visibility values in enums and provides tools for filtering types by visibility. A new `LifecycleVisibility` enum defines standard protocol-agnostic visibility values for operations that manage the lifecycle (creation, update, deletion) of a resource. More details on visibility enums are available [in website documentation](../language-basics/visibility.md) + +## Features + +### @typespec/compiler + +- [#4937](https://github.com/microsoft/typespec/pull/4937) Add mutateSubgraphWithNamespace as a separate API +- [#4837](https://github.com/microsoft/typespec/pull/4837) Allow trailing delimiter in array values, tuple, decorator declaration, scalar initializer, etc. +- [#5149](https://github.com/microsoft/typespec/pull/5149) Experimental: Improve Realm, Mutator, and Typekit implementations. + +- [#4825](https://github.com/microsoft/typespec/pull/4825) Adds support for enum-driven visibility in the compiler core. + +### @typespec/openapi3 + +- [#5029](https://github.com/microsoft/typespec/pull/5029) Add support for `#deprecated` for OpenAPI3Parameter + +## Bug Fixes + +### @typespec/compiler + +- [#5252](https://github.com/microsoft/typespec/pull/5252) Added RegEx validation for @pattern and will throw warning for invalid RegEx string + +### @typespec/http + +- [#5016](https://github.com/microsoft/typespec/pull/5016) Uri template attributes were not extracted when parameter was explicitly mark with `@path` or `@query` as well + +### @typespec/http-server-csharp + +- [#4308](https://github.com/microsoft/typespec/issues/4308) Process sub-namespaces of a service +- [#4998](https://github.com/microsoft/typespec/issues/4998) Handle void returnType +- [#5000](https://github.com/microsoft/typespec/issues/5000) Handle tuple literals +- [#5001](https://github.com/microsoft/typespec/issues/5001) Skip envelope types withpout properties +- [#5024](https://github.com/microsoft/typespec/issues/5024) Literal type is not properly generated +- [#5124](https://github.com/microsoft/typespec/issues/5124) Skip uninstantiated templates +- [#5125](https://github.com/microsoft/typespec/issues/5125) Process operations outside interfaces +- Handle nullable types and anonymous typesin all contexts +- Add server-side numeric constraints for safeInt + +### @typespec/http-server-javascript + +- Add an additional check for the presence of a property before performing a bounds check on integer properties constrained to a range. +- [5185](https://github.com/microsoft/typespec/issues/5185) Add logic to handle invalid identifier names (#5185) + +### @typespec/versioning + +- [#5262](https://github.com/microsoft/typespec/pull/5262) Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template, union, or tuple. + +### @typespec/openapi3 + +- [#5006](https://github.com/microsoft/typespec/pull/5006) Illegal characters in component keys +- [#5274](https://github.com/microsoft/typespec/pull/5274) Added missing peer dependency "openapi-types" + +### @typespec/json-schema + +- [#5189](https://github.com/microsoft/typespec/pull/5189) Fixes crash that occurred when a template instantiation's template argument was a union that references a declaration. From 7e344d4ae6af65297adaac7b874218e703bbbdfa Mon Sep 17 00:00:00 2001 From: Mark Cowlishaw Date: Tue, 10 Dec 2024 16:22:14 -0800 Subject: [PATCH 44/71] Prepare Publish for December Release (#5329) --- ...rameterObjectMissing-2024-10-8-14-57-38.md | 7 ---- ...leaseDashboardsStep1-2024-11-5-14-40-39.md | 8 ----- ...leaseHttpSpecsAlpha4-2024-11-8-23-14-16.md | 7 ---- .../SpecDashBoard-2024-10-13-22-23-40.md | 8 ----- .../SpecsAlpha2-2024-10-26-15-58-19.md | 7 ---- .../TagMetadataDoc-2024-10-6-14-53-10.md | 7 ---- ...rtServerScenarioPaths-2024-11-9-11-3-38.md | 7 ---- ...tServerScenarioPaths-2024-11-9-17-21-55.md | 7 ---- ...ValidatePatternRegEx-2024-11-3-11-32-36.md | 7 ---- ...eckAvailableTypeName-2024-10-7-15-22-31.md | 7 ---- ...dep-update-2024-11-2-2024-10-20-22-1-27.md | 33 ------------------- .../docs-directives-2024-10-7-18-13-59.md | 6 ---- ...te-namespaces-cascade-2024-9-31-21-41-8.md | 7 ---- ...js-source-file-docs-2024-12-06-22-57-43.md | 7 ---- ...-schema-union-crash-2024-10-25-12-38-51.md | 7 ---- .chronus/changes/fix-ns-2024-10-18-4-22-4.md | 14 -------- ...licit-allow-reserved-2024-10-7-20-13-23.md | 8 ----- ...sioning-typechangeof-2024-11-3-22-56-22.md | 6 ---- ...rsioning-typechangeof-2024-11-3-22-56-4.md | 7 ---- ...ompatibility-failure-2024-10-11-16-9-50.md | 7 ---- ...fix-api-key-mockapi-2024-10-25-15-53-24.md | 7 ---- ...list_operation_test-2024-10-27-18-41-40.md | 7 ---- .../none_visibility-2024-10-27-17-8-46.md | 7 ---- .../changes/nullable-2024-11-6-1-23-27.md | 8 ----- .../openapi3-peer-2024-11-5-18-44-45.md | 7 ---- .../peer-dependencies-2024-9-10-22-53-58.md | 7 ---- ...moved-in-cadl-ranch-2024-10-28-15-49-29.md | 7 ---- ...mited-most-locations-2024-9-23-16-28-11.md | 8 ----- ...-additional-guard-in-2024-11-3-13-53-46.md | 7 ---- ...-additional-guard-in-2024-11-3-14-29-16.md | 7 ---- ...-ignore-unspeakable-2024-10-25-15-54-27.md | 7 ---- ...ypekit-mutator-docs-2024-10-19-10-24-24.md | 11 ------- ...-msft-visibility-enum-2024-10-6-16-50-9.md | 7 ---- ...msft-visibility-enum-2024-10-6-16-53-11.md | 8 ----- packages/bundler/CHANGELOG.md | 4 +++ packages/bundler/package.json | 2 +- packages/compiler/CHANGELOG.md | 18 ++++++++++ packages/compiler/package.json | 2 +- packages/compiler/templates/scaffolding.json | 8 ++--- packages/eslint-plugin-typespec/CHANGELOG.md | 4 +++ packages/eslint-plugin-typespec/package.json | 2 +- packages/events/CHANGELOG.md | 4 +++ packages/events/package.json | 2 +- packages/html-program-viewer/CHANGELOG.md | 4 +++ packages/html-program-viewer/package.json | 2 +- packages/http-server-csharp/CHANGELOG.md | 14 ++++++++ packages/http-server-csharp/package.json | 2 +- packages/http-server-javascript/CHANGELOG.md | 9 +++++ packages/http-server-javascript/package.json | 2 +- packages/http-specs/CHANGELOG.md | 14 ++++++++ packages/http-specs/package.json | 2 +- packages/http/CHANGELOG.md | 7 ++++ packages/http/package.json | 2 +- packages/internal-build-utils/CHANGELOG.md | 4 +++ packages/internal-build-utils/package.json | 2 +- packages/json-schema/CHANGELOG.md | 7 ++++ packages/json-schema/package.json | 2 +- packages/library-linter/CHANGELOG.md | 4 +++ packages/library-linter/package.json | 2 +- packages/openapi/CHANGELOG.md | 4 +++ packages/openapi/package.json | 2 +- packages/openapi3/CHANGELOG.md | 12 +++++++ packages/openapi3/package.json | 2 +- packages/playground/CHANGELOG.md | 4 +++ packages/playground/package.json | 2 +- .../prettier-plugin-typespec/CHANGELOG.md | 4 +++ .../prettier-plugin-typespec/package.json | 2 +- packages/protobuf/CHANGELOG.md | 4 +++ packages/protobuf/package.json | 2 +- packages/rest/CHANGELOG.md | 4 +++ packages/rest/package.json | 2 +- packages/spec-api/CHANGELOG.md | 4 +++ packages/spec-coverage-sdk/CHANGELOG.md | 4 +++ packages/spector/CHANGELOG.md | 4 +++ packages/spector/package.json | 2 +- packages/sse/CHANGELOG.md | 4 +++ packages/sse/package.json | 2 +- packages/streams/CHANGELOG.md | 4 +++ packages/streams/package.json | 2 +- packages/tmlanguage-generator/CHANGELOG.md | 4 +++ packages/typespec-vs/CHANGELOG.md | 4 +++ packages/typespec-vs/package.json | 2 +- packages/typespec-vscode/CHANGELOG.md | 4 +++ packages/typespec-vscode/package.json | 2 +- packages/versioning/CHANGELOG.md | 7 ++++ packages/versioning/package.json | 2 +- packages/xml/CHANGELOG.md | 4 +++ packages/xml/package.json | 2 +- 88 files changed, 197 insertions(+), 308 deletions(-) delete mode 100644 .chronus/changes/ParameterObjectMissing-2024-10-8-14-57-38.md delete mode 100644 .chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md delete mode 100644 .chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md delete mode 100644 .chronus/changes/SpecDashBoard-2024-10-13-22-23-40.md delete mode 100644 .chronus/changes/SpecsAlpha2-2024-10-26-15-58-19.md delete mode 100644 .chronus/changes/TagMetadataDoc-2024-10-6-14-53-10.md delete mode 100644 .chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md delete mode 100644 .chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md delete mode 100644 .chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md delete mode 100644 .chronus/changes/checkAvailableTypeName-2024-10-7-15-22-31.md delete mode 100644 .chronus/changes/dep-update-2024-11-2-2024-10-20-22-1-27.md delete mode 100644 .chronus/changes/docs-directives-2024-10-7-18-13-59.md delete mode 100644 .chronus/changes/feature-mutate-namespaces-cascade-2024-9-31-21-41-8.md delete mode 100644 .chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md delete mode 100644 .chronus/changes/fix-json-schema-union-crash-2024-10-25-12-38-51.md delete mode 100644 .chronus/changes/fix-ns-2024-10-18-4-22-4.md delete mode 100644 .chronus/changes/fix-path-explicit-allow-reserved-2024-10-7-20-13-23.md delete mode 100644 .chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md delete mode 100644 .chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md delete mode 100644 .chronus/changes/http-specs-fix-dotnet-compatibility-failure-2024-10-11-16-9-50.md delete mode 100644 .chronus/changes/http-specs_fix-api-key-mockapi-2024-10-25-15-53-24.md delete mode 100644 .chronus/changes/list_operation_test-2024-10-27-18-41-40.md delete mode 100644 .chronus/changes/none_visibility-2024-10-27-17-8-46.md delete mode 100644 .chronus/changes/nullable-2024-11-6-1-23-27.md delete mode 100644 .chronus/changes/openapi3-peer-2024-11-5-18-44-45.md delete mode 100644 .chronus/changes/peer-dependencies-2024-9-10-22-53-58.md delete mode 100644 .chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md delete mode 100644 .chronus/changes/trailing-delimited-most-locations-2024-9-23-16-28-11.md delete mode 100644 .chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md delete mode 100644 .chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md delete mode 100644 .chronus/changes/witemple-msft-hsj-ignore-unspeakable-2024-10-25-15-54-27.md delete mode 100644 .chronus/changes/witemple-msft-realm-typekit-mutator-docs-2024-10-19-10-24-24.md delete mode 100644 .chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-50-9.md delete mode 100644 .chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-53-11.md diff --git a/.chronus/changes/ParameterObjectMissing-2024-10-8-14-57-38.md b/.chronus/changes/ParameterObjectMissing-2024-10-8-14-57-38.md deleted file mode 100644 index 88ae53a89e..0000000000 --- a/.chronus/changes/ParameterObjectMissing-2024-10-8-14-57-38.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/openapi3" ---- - -Add support for `#deprecated` for OpenAPI3Parameter \ No newline at end of file diff --git a/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md b/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md deleted file mode 100644 index e3e74262ca..0000000000 --- a/.chronus/changes/ReleaseDashboardsStep1-2024-11-5-14-40-39.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-specs" - - "@typespec/spector" ---- - -Adding scripts to package.json \ No newline at end of file diff --git a/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md b/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md deleted file mode 100644 index 3cc09f4932..0000000000 --- a/.chronus/changes/ReleaseHttpSpecsAlpha4-2024-11-8-23-14-16.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-specs" ---- - -Modifies Spec Scenarios \ No newline at end of file diff --git a/.chronus/changes/SpecDashBoard-2024-10-13-22-23-40.md b/.chronus/changes/SpecDashBoard-2024-10-13-22-23-40.md deleted file mode 100644 index 2100dd2b2a..0000000000 --- a/.chronus/changes/SpecDashBoard-2024-10-13-22-23-40.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/spec-coverage-sdk" - - "@typespec/spector" ---- - -Modify code to be handled in spec-dashboard \ No newline at end of file diff --git a/.chronus/changes/SpecsAlpha2-2024-10-26-15-58-19.md b/.chronus/changes/SpecsAlpha2-2024-10-26-15-58-19.md deleted file mode 100644 index 25bb9f084c..0000000000 --- a/.chronus/changes/SpecsAlpha2-2024-10-26-15-58-19.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http-specs" ---- - -Change Key Values in spec file \ No newline at end of file diff --git a/.chronus/changes/TagMetadataDoc-2024-10-6-14-53-10.md b/.chronus/changes/TagMetadataDoc-2024-10-6-14-53-10.md deleted file mode 100644 index b79f53e1a4..0000000000 --- a/.chronus/changes/TagMetadataDoc-2024-10-6-14-53-10.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/openapi" ---- - -Update Docs for `@tagMetadata` \ No newline at end of file diff --git a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md deleted file mode 100644 index b12a7add0d..0000000000 --- a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-11-3-38.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/spector" ---- - -Update `server start` script parameter - `scenarioPath` to `scenarioPaths`. \ No newline at end of file diff --git a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md b/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md deleted file mode 100644 index 7afadab420..0000000000 --- a/.chronus/changes/UpdateStartServerScenarioPaths-2024-11-9-17-21-55.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/spec-coverage-sdk" ---- - -Added packageName property to metadata \ No newline at end of file diff --git a/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md b/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md deleted file mode 100644 index 28de1e3a7d..0000000000 --- a/.chronus/changes/azhang_ValidatePatternRegEx-2024-11-3-11-32-36.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/compiler" ---- - -Added RegEx validation for @pattern and will throw warning for invalid RegEx string \ No newline at end of file diff --git a/.chronus/changes/checkAvailableTypeName-2024-10-7-15-22-31.md b/.chronus/changes/checkAvailableTypeName-2024-10-7-15-22-31.md deleted file mode 100644 index ca3ef47771..0000000000 --- a/.chronus/changes/checkAvailableTypeName-2024-10-7-15-22-31.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/openapi3" ---- - -Illegal characters in component keys diff --git a/.chronus/changes/dep-update-2024-11-2-2024-10-20-22-1-27.md b/.chronus/changes/dep-update-2024-11-2-2024-10-20-22-1-27.md deleted file mode 100644 index ae1be1b82e..0000000000 --- a/.chronus/changes/dep-update-2024-11-2-2024-10-20-22-1-27.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/bundler" - - "@typespec/compiler" - - "@typespec/eslint-plugin" - - "@typespec/events" - - "@typespec/html-program-viewer" - - "@typespec/http-server-csharp" - - "@typespec/http-server-javascript" - - "@typespec/http-specs" - - "@typespec/http" - - "@typespec/internal-build-utils" - - "@typespec/json-schema" - - "@typespec/library-linter" - - "@typespec/openapi" - - "@typespec/openapi3" - - "@typespec/playground" - - "@typespec/prettier-plugin-typespec" - - "@typespec/protobuf" - - "@typespec/rest" - - "@typespec/spec-api" - - "@typespec/spec-coverage-sdk" - - "@typespec/spector" - - "@typespec/sse" - - "@typespec/streams" - - tmlanguage-generator - - typespec-vscode - - "@typespec/versioning" - - "@typespec/xml" ---- - -update dev deps \ No newline at end of file diff --git a/.chronus/changes/docs-directives-2024-10-7-18-13-59.md b/.chronus/changes/docs-directives-2024-10-7-18-13-59.md deleted file mode 100644 index 57aaaf2b18..0000000000 --- a/.chronus/changes/docs-directives-2024-10-7-18-13-59.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: internal -packages: - - "@typespec/compiler" ---- diff --git a/.chronus/changes/feature-mutate-namespaces-cascade-2024-9-31-21-41-8.md b/.chronus/changes/feature-mutate-namespaces-cascade-2024-9-31-21-41-8.md deleted file mode 100644 index 8333e554f5..0000000000 --- a/.chronus/changes/feature-mutate-namespaces-cascade-2024-9-31-21-41-8.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Add mutateSubgraphWithNamespace as a separate API diff --git a/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md b/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md deleted file mode 100644 index b7152c7566..0000000000 --- a/.chronus/changes/fix-js-source-file-docs-2024-12-06-22-57-43.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/compiler" ---- - -Fixes incorrect default value in dev doc diff --git a/.chronus/changes/fix-json-schema-union-crash-2024-10-25-12-38-51.md b/.chronus/changes/fix-json-schema-union-crash-2024-10-25-12-38-51.md deleted file mode 100644 index 9239921e6e..0000000000 --- a/.chronus/changes/fix-json-schema-union-crash-2024-10-25-12-38-51.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/json-schema" ---- - -Fixes crash that occurred when a template instantiation's template argument was a union that references a declaration. diff --git a/.chronus/changes/fix-ns-2024-10-18-4-22-4.md b/.chronus/changes/fix-ns-2024-10-18-4-22-4.md deleted file mode 100644 index 6596e6329b..0000000000 --- a/.chronus/changes/fix-ns-2024-10-18-4-22-4.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/http-server-csharp" ---- - -Fix #4308 Process sub-namespace of a service in csharp service emitter -Fix #4998 Generator throws on void return type -Fix #5000 Tuple types are not properly generated -Fix #5001 OkResponse is generated as a model -Fix #5024 Literal type is not properly generated -Fix #5124 Templated model reported error while generating -Fix #5125 No interfaces and controllers are generated for ops in a namespace diff --git a/.chronus/changes/fix-path-explicit-allow-reserved-2024-10-7-20-13-23.md b/.chronus/changes/fix-path-explicit-allow-reserved-2024-10-7-20-13-23.md deleted file mode 100644 index e8d36271d6..0000000000 --- a/.chronus/changes/fix-path-explicit-allow-reserved-2024-10-7-20-13-23.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/http" ---- - -Uri template attributes were not extracted when parameter was explicitly mark with `@path` or `@query` as well diff --git a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md deleted file mode 100644 index 65426bb013..0000000000 --- a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-22.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/versioning" ---- - diff --git a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md b/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md deleted file mode 100644 index 463f4eb094..0000000000 --- a/.chronus/changes/fix-versioning-typechangeof-2024-11-3-22-56-4.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/versioning" ---- - -Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template, union, or tuple. \ No newline at end of file diff --git a/.chronus/changes/http-specs-fix-dotnet-compatibility-failure-2024-10-11-16-9-50.md b/.chronus/changes/http-specs-fix-dotnet-compatibility-failure-2024-10-11-16-9-50.md deleted file mode 100644 index 0038556198..0000000000 --- a/.chronus/changes/http-specs-fix-dotnet-compatibility-failure-2024-10-11-16-9-50.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-specs" ---- - -Fix dotnet compatibility failure in http-specs \ No newline at end of file diff --git a/.chronus/changes/http-specs_fix-api-key-mockapi-2024-10-25-15-53-24.md b/.chronus/changes/http-specs_fix-api-key-mockapi-2024-10-25-15-53-24.md deleted file mode 100644 index 37290d5adc..0000000000 --- a/.chronus/changes/http-specs_fix-api-key-mockapi-2024-10-25-15-53-24.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-specs" ---- - -Fix api-key mockapi \ No newline at end of file diff --git a/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md b/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md deleted file mode 100644 index f542056d7f..0000000000 --- a/.chronus/changes/list_operation_test-2024-10-27-18-41-40.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-specs" ---- - -add link case of server driven pagination test \ No newline at end of file diff --git a/.chronus/changes/none_visibility-2024-10-27-17-8-46.md b/.chronus/changes/none_visibility-2024-10-27-17-8-46.md deleted file mode 100644 index 5cbe193a4a..0000000000 --- a/.chronus/changes/none_visibility-2024-10-27-17-8-46.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/http-specs" ---- - -add none visibility test \ No newline at end of file diff --git a/.chronus/changes/nullable-2024-11-6-1-23-27.md b/.chronus/changes/nullable-2024-11-6-1-23-27.md deleted file mode 100644 index 5aa6b8945c..0000000000 --- a/.chronus/changes/nullable-2024-11-6-1-23-27.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: fix -packages: - - "@typespec/http-server-csharp" ---- - -Fix nullable types, anonymous types, and safeInt diff --git a/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md b/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md deleted file mode 100644 index d6e39adaf3..0000000000 --- a/.chronus/changes/openapi3-peer-2024-11-5-18-44-45.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/openapi3" ---- - -Added missing peer dependency "openapi-types" \ No newline at end of file diff --git a/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md b/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md deleted file mode 100644 index f846ae4fa1..0000000000 --- a/.chronus/changes/peer-dependencies-2024-9-10-22-53-58.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/compiler" ---- - -Set `@typespec/compiler` as a `peerDependency` in library templates \ No newline at end of file diff --git a/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md b/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md deleted file mode 100644 index 3704e00677..0000000000 --- a/.chronus/changes/synced-with-versioning-removed-in-cadl-ranch-2024-10-28-15-49-29.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-specs" ---- - -update code in versioning/removed and removed type/model/templated. diff --git a/.chronus/changes/trailing-delimited-most-locations-2024-9-23-16-28-11.md b/.chronus/changes/trailing-delimited-most-locations-2024-9-23-16-28-11.md deleted file mode 100644 index c305222010..0000000000 --- a/.chronus/changes/trailing-delimited-most-locations-2024-9-23-16-28-11.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Allow trailing delimiter in array values, tuple, decorator declaration, scalar initializer, etc. diff --git a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md deleted file mode 100644 index 055349a9b8..0000000000 --- a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-13-53-46.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-javascript" ---- - -Added an additional check for the presence of a property before performing a bounds check on integer properties constrained to a range. \ No newline at end of file diff --git a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md b/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md deleted file mode 100644 index b3aab707a6..0000000000 --- a/.chronus/changes/witemple-msft-hsj-additional-guard-in-2024-11-3-14-29-16.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-javascript" ---- - -Fixed a null check in query parameter requiredness check by replacing it with a falseness check. diff --git a/.chronus/changes/witemple-msft-hsj-ignore-unspeakable-2024-10-25-15-54-27.md b/.chronus/changes/witemple-msft-hsj-ignore-unspeakable-2024-10-25-15-54-27.md deleted file mode 100644 index 22eac4d51a..0000000000 --- a/.chronus/changes/witemple-msft-hsj-ignore-unspeakable-2024-10-25-15-54-27.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: fix -packages: - - "@typespec/http-server-javascript" ---- - -Added logic to handle "unspeakable" identifier names (#5185) \ No newline at end of file diff --git a/.chronus/changes/witemple-msft-realm-typekit-mutator-docs-2024-10-19-10-24-24.md b/.chronus/changes/witemple-msft-realm-typekit-mutator-docs-2024-10-19-10-24-24.md deleted file mode 100644 index 4855dd2fcd..0000000000 --- a/.chronus/changes/witemple-msft-realm-typekit-mutator-docs-2024-10-19-10-24-24.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Experimental: Improve Realm, Mutator, and Typekit implementations. - -This change strongly binds a Realm and Typekit together, and changes mutators so that new types are cloned within the -mutator's realm. The default Typekit now creates a default typekit realm for the current program, and a Typekit can be -easily created to work in a specific Program or Realm as needed. diff --git a/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-50-9.md b/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-50-9.md deleted file mode 100644 index 082815372a..0000000000 --- a/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-50-9.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -changeKind: feature -packages: - - "@typespec/compiler" ---- - -Adds support for enum-driven visibility in the compiler core. diff --git a/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-53-11.md b/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-53-11.md deleted file mode 100644 index a2c7cd59bc..0000000000 --- a/.chronus/changes/witemple-msft-visibility-enum-2024-10-6-16-53-11.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -changeKind: internal -packages: - - "@typespec/http" - - "@typespec/openapi" ---- - -Mask deprecation on getVisibility diff --git a/packages/bundler/CHANGELOG.md b/packages/bundler/CHANGELOG.md index e4e9e470cc..a38c542174 100644 --- a/packages/bundler/CHANGELOG.md +++ b/packages/bundler/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/bundler +## 0.1.10 + +No changes, version bump only. + ## 0.1.9 ### Bump dependencies diff --git a/packages/bundler/package.json b/packages/bundler/package.json index f1bfc53580..864a362c2f 100644 --- a/packages/bundler/package.json +++ b/packages/bundler/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/bundler", - "version": "0.1.9", + "version": "0.1.10", "author": "Microsoft Corporation", "description": "Package to bundle a TypeSpec library.", "homepage": "https://typespec.io", diff --git a/packages/compiler/CHANGELOG.md b/packages/compiler/CHANGELOG.md index 40f8861dae..01335efba6 100644 --- a/packages/compiler/CHANGELOG.md +++ b/packages/compiler/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log - @typespec/compiler +## 0.63.0 + +### Bug Fixes + +- [#5252](https://github.com/microsoft/typespec/pull/5252) Added RegEx validation for @pattern and will throw warning for invalid RegEx string + +### Features + +- [#4937](https://github.com/microsoft/typespec/pull/4937) Add mutateSubgraphWithNamespace as a separate API +- [#4837](https://github.com/microsoft/typespec/pull/4837) Allow trailing delimiter in array values, tuple, decorator declaration, scalar initializer, etc. +- [#5149](https://github.com/microsoft/typespec/pull/5149) Experimental: Improve Realm, Mutator, and Typekit implementations. + +This change strongly binds a Realm and Typekit together, and changes mutators so that new types are cloned within the +mutator's realm. The default Typekit now creates a default typekit realm for the current program, and a Typekit can be +easily created to work in a specific Program or Realm as needed. +- [#4825](https://github.com/microsoft/typespec/pull/4825) Adds support for enum-driven visibility in the compiler core. + + ## 0.62.0 ### Bug Fixes diff --git a/packages/compiler/package.json b/packages/compiler/package.json index 58e46ce4a3..1b482997d1 100644 --- a/packages/compiler/package.json +++ b/packages/compiler/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/compiler", - "version": "0.62.0", + "version": "0.63.0", "description": "TypeSpec Compiler Preview", "author": "Microsoft Corporation", "license": "MIT", diff --git a/packages/compiler/templates/scaffolding.json b/packages/compiler/templates/scaffolding.json index f70c8b9e60..2ae2fdb4e9 100644 --- a/packages/compiler/templates/scaffolding.json +++ b/packages/compiler/templates/scaffolding.json @@ -3,12 +3,12 @@ "title": "Empty project", "description": "Create an empty project.", "libraries": [], - "compilerVersion": "0.62.0" + "compilerVersion": "0.63.0" }, "rest": { "title": "Generic REST API", "description": "Create a project representing a generic REST API", - "compilerVersion": "0.62.0", + "compilerVersion": "0.63.0", "libraries": [ "@typespec/http", "@typespec/rest", @@ -23,7 +23,7 @@ "library-ts": { "title": "TypeSpec Library (With TypeScript)", "description": "Create a new package to add decorators or linters to typespec.", - "compilerVersion": "0.62.0", + "compilerVersion": "0.63.0", "libraries": [], "files": [ { @@ -99,7 +99,7 @@ "emitter-ts": { "title": "TypeSpec Emitter (With TypeScript)", "description": "Create a new package that will be emitting typespec", - "compilerVersion": "0.62.0", + "compilerVersion": "0.63.0", "libraries": [], "files": [ { diff --git a/packages/eslint-plugin-typespec/CHANGELOG.md b/packages/eslint-plugin-typespec/CHANGELOG.md index 0691b70b93..9b7073e7aa 100644 --- a/packages/eslint-plugin-typespec/CHANGELOG.md +++ b/packages/eslint-plugin-typespec/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/eslint-plugin +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/eslint-plugin-typespec/package.json b/packages/eslint-plugin-typespec/package.json index 0b01186df7..d3003f15f0 100644 --- a/packages/eslint-plugin-typespec/package.json +++ b/packages/eslint-plugin-typespec/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/eslint-plugin", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "Eslint plugin providing set of rules to be used in the JS/TS code of TypeSpec libraries", "homepage": "https://typespec.io", diff --git a/packages/events/CHANGELOG.md b/packages/events/CHANGELOG.md index 1474e30d0c..5420f563f9 100644 --- a/packages/events/CHANGELOG.md +++ b/packages/events/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog - @typespec/events +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/events/package.json b/packages/events/package.json index 8a5dcbb766..b596f8f5a4 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/events", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library providing events bindings", "homepage": "https://typespec.io", diff --git a/packages/html-program-viewer/CHANGELOG.md b/packages/html-program-viewer/CHANGELOG.md index bf4ae5e0a2..3bff611110 100644 --- a/packages/html-program-viewer/CHANGELOG.md +++ b/packages/html-program-viewer/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/html-program-viewer +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/html-program-viewer/package.json b/packages/html-program-viewer/package.json index 2a793254c3..e858fea5b5 100644 --- a/packages/html-program-viewer/package.json +++ b/packages/html-program-viewer/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/html-program-viewer", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library for emitting an html view of the program.", "homepage": "https://typespec.io", diff --git a/packages/http-server-csharp/CHANGELOG.md b/packages/http-server-csharp/CHANGELOG.md index 355f070d67..e56af66ddf 100644 --- a/packages/http-server-csharp/CHANGELOG.md +++ b/packages/http-server-csharp/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log - @typespec/http-server-csharp +## 0.58.0-alpha.6 + +### Bug Fixes + +- [#5140](https://github.com/microsoft/typespec/pull/5140) Fix #4308 Process sub-namespace of a service in csharp service emitter +Fix #4998 Generator throws on void return type +Fix #5000 Tuple types are not properly generated +Fix #5001 OkResponse is generated as a model +Fix #5024 Literal type is not properly generated +Fix #5124 Templated model reported error while generating +Fix #5125 No interfaces and controllers are generated for ops in a namespace +- [#5279](https://github.com/microsoft/typespec/pull/5279) Fix nullable types, anonymous types, and safeInt + + ## 0.58.0-alpha.5 ### Bump dependencies diff --git a/packages/http-server-csharp/package.json b/packages/http-server-csharp/package.json index 207e92b6c1..d7fbe5f909 100644 --- a/packages/http-server-csharp/package.json +++ b/packages/http-server-csharp/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-server-csharp", - "version": "0.58.0-alpha.5", + "version": "0.58.0-alpha.6", "author": "Microsoft Corporation", "description": "TypeSpec service code generator for c-sharp", "homepage": "https://typespec.io", diff --git a/packages/http-server-javascript/CHANGELOG.md b/packages/http-server-javascript/CHANGELOG.md index c4a901ff0b..d37183674f 100644 --- a/packages/http-server-javascript/CHANGELOG.md +++ b/packages/http-server-javascript/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog - @typespec/http-server-javascript +## 0.58.0-alpha.6 + +### Bug Fixes + +- [#5253](https://github.com/microsoft/typespec/pull/5253) Added an additional check for the presence of a property before performing a bounds check on integer properties constrained to a range. +- [#5253](https://github.com/microsoft/typespec/pull/5253) Fixed a null check in query parameter requiredness check by replacing it with a falseness check. +- [#5188](https://github.com/microsoft/typespec/pull/5188) Added logic to handle "unspeakable" identifier names (#5185) + + ## 0.58.0-alpha.5 ### Bump dependencies diff --git a/packages/http-server-javascript/package.json b/packages/http-server-javascript/package.json index f01721be96..6cb073d561 100644 --- a/packages/http-server-javascript/package.json +++ b/packages/http-server-javascript/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-server-javascript", - "version": "0.58.0-alpha.5", + "version": "0.58.0-alpha.6", "author": "Microsoft Corporation", "description": "TypeSpec HTTP server code generator for JavaScript", "homepage": "https://github.com/microsoft/typespec", diff --git a/packages/http-specs/CHANGELOG.md b/packages/http-specs/CHANGELOG.md index 58bad29b66..a314de139e 100644 --- a/packages/http-specs/CHANGELOG.md +++ b/packages/http-specs/CHANGELOG.md @@ -1,5 +1,19 @@ # @typespec/http-specs +## 0.1.0-alpha.5 + +### Bug Fixes + +- [#5049](https://github.com/microsoft/typespec/pull/5049) Fix dotnet compatibility failure in http-specs +- [#5184](https://github.com/microsoft/typespec/pull/5184) Fix api-key mockapi +- [#5217](https://github.com/microsoft/typespec/pull/5217) update code in versioning/removed and removed type/model/templated. + +### Features + +- [#5211](https://github.com/microsoft/typespec/pull/5211) add link case of server driven pagination test +- [#5210](https://github.com/microsoft/typespec/pull/5210) add none visibility test + + ## 0.1.0-alpha.4 - Update Versioning/Removed Project And Removed Type/Model/Templated. Please refer [PR #5217](https://github.com/microsoft/typespec/pull/5217) for further details. diff --git a/packages/http-specs/package.json b/packages/http-specs/package.json index 93ca09e3fa..b0a541b37c 100644 --- a/packages/http-specs/package.json +++ b/packages/http-specs/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-specs", - "version": "0.1.0-alpha.4", + "version": "0.1.0-alpha.5", "description": "Spec scenarios and mock apis", "main": "dist/index.js", "type": "module", diff --git a/packages/http/CHANGELOG.md b/packages/http/CHANGELOG.md index 9b6fd20a04..878a8f6b6b 100644 --- a/packages/http/CHANGELOG.md +++ b/packages/http/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @typespec/http +## 0.63.0 + +### Bug Fixes + +- [#5016](https://github.com/microsoft/typespec/pull/5016) Uri template attributes were not extracted when parameter was explicitly mark with `@path` or `@query` as well + + ## 0.62.0 ### Bug Fixes diff --git a/packages/http/package.json b/packages/http/package.json index dec104b430..c3de64462c 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec HTTP protocol binding", "homepage": "https://github.com/microsoft/typespec", diff --git a/packages/internal-build-utils/CHANGELOG.md b/packages/internal-build-utils/CHANGELOG.md index 462085dad1..9013dbafa1 100644 --- a/packages/internal-build-utils/CHANGELOG.md +++ b/packages/internal-build-utils/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/internal-build-utils +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/internal-build-utils/package.json b/packages/internal-build-utils/package.json index 94a5a42ee0..ceb679302e 100644 --- a/packages/internal-build-utils/package.json +++ b/packages/internal-build-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/internal-build-utils", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "Internal library to TypeSpec providing helpers to build.", "homepage": "https://typespec.io", diff --git a/packages/json-schema/CHANGELOG.md b/packages/json-schema/CHANGELOG.md index db7cae8cda..642001b75f 100644 --- a/packages/json-schema/CHANGELOG.md +++ b/packages/json-schema/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @typespec/json-schema +## 0.63.0 + +### Bug Fixes + +- [#5189](https://github.com/microsoft/typespec/pull/5189) Fixes crash that occurred when a template instantiation's template argument was a union that references a declaration. + + ## 0.62.0 ### Bug Fixes diff --git a/packages/json-schema/package.json b/packages/json-schema/package.json index 882278b308..62ce76104c 100644 --- a/packages/json-schema/package.json +++ b/packages/json-schema/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/json-schema", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library for emitting TypeSpec to JSON Schema and converting JSON Schema to TypeSpec", "homepage": "https://github.com/microsoft/typespec", diff --git a/packages/library-linter/CHANGELOG.md b/packages/library-linter/CHANGELOG.md index c302a1fafa..76f7c950b1 100644 --- a/packages/library-linter/CHANGELOG.md +++ b/packages/library-linter/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/library-linter +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/library-linter/package.json b/packages/library-linter/package.json index 8f96278a44..ea7b757ed9 100644 --- a/packages/library-linter/package.json +++ b/packages/library-linter/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/library-linter", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library for linting another library.", "homepage": "https://typespec.io", diff --git a/packages/openapi/CHANGELOG.md b/packages/openapi/CHANGELOG.md index c26a8216d7..e5c25c6d98 100644 --- a/packages/openapi/CHANGELOG.md +++ b/packages/openapi/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/openapi +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/openapi/package.json b/packages/openapi/package.json index 3ea8b9718c..b5787d4cb1 100644 --- a/packages/openapi/package.json +++ b/packages/openapi/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/openapi", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library providing OpenAPI concepts", "homepage": "https://typespec.io", diff --git a/packages/openapi3/CHANGELOG.md b/packages/openapi3/CHANGELOG.md index d9d3f78596..bbabcbd6f8 100644 --- a/packages/openapi3/CHANGELOG.md +++ b/packages/openapi3/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log - @typespec/openapi3 +## 0.63.0 + +### Bug Fixes + +- [#5006](https://github.com/microsoft/typespec/pull/5006) Illegal characters in component keys +- [#5274](https://github.com/microsoft/typespec/pull/5274) Added missing peer dependency "openapi-types" + +### Features + +- [#5029](https://github.com/microsoft/typespec/pull/5029) Add support for `#deprecated` for OpenAPI3Parameter + + ## 0.62.0 ### Bug Fixes diff --git a/packages/openapi3/package.json b/packages/openapi3/package.json index ddc25e531b..b66afceb1b 100644 --- a/packages/openapi3/package.json +++ b/packages/openapi3/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/openapi3", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library for emitting OpenAPI 3.0 from the TypeSpec REST protocol binding and converting OpenAPI3 to TypeSpec", "homepage": "https://typespec.io", diff --git a/packages/playground/CHANGELOG.md b/packages/playground/CHANGELOG.md index 1fac613ada..46ea32ecc5 100644 --- a/packages/playground/CHANGELOG.md +++ b/packages/playground/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/playground +## 0.6.1 + +No changes, version bump only. + ## 0.6.0 ### Bug Fixes diff --git a/packages/playground/package.json b/packages/playground/package.json index 647713c0d1..49b543fe33 100644 --- a/packages/playground/package.json +++ b/packages/playground/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/playground", - "version": "0.6.0", + "version": "0.6.1", "author": "Microsoft Corporation", "description": "TypeSpec playground UI components.", "homepage": "https://typespec.io", diff --git a/packages/prettier-plugin-typespec/CHANGELOG.md b/packages/prettier-plugin-typespec/CHANGELOG.md index 4920d6242b..66263f7046 100644 --- a/packages/prettier-plugin-typespec/CHANGELOG.md +++ b/packages/prettier-plugin-typespec/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/prettier-plugin-typespec +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/prettier-plugin-typespec/package.json b/packages/prettier-plugin-typespec/package.json index d37e0a7684..bd3c81370f 100644 --- a/packages/prettier-plugin-typespec/package.json +++ b/packages/prettier-plugin-typespec/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/prettier-plugin-typespec", - "version": "0.62.0", + "version": "0.63.0", "description": "", "main": "dist/index.js", "scripts": { diff --git a/packages/protobuf/CHANGELOG.md b/packages/protobuf/CHANGELOG.md index 8f26512189..baecd3ce1a 100644 --- a/packages/protobuf/CHANGELOG.md +++ b/packages/protobuf/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/protobuf +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/protobuf/package.json b/packages/protobuf/package.json index 6ebf2617f1..e4d6651cd7 100644 --- a/packages/protobuf/package.json +++ b/packages/protobuf/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/protobuf", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library and emitter for Protobuf (gRPC)", "homepage": "https://github.com/microsoft/typespec", diff --git a/packages/rest/CHANGELOG.md b/packages/rest/CHANGELOG.md index 5d6d5b7335..24e3055148 100644 --- a/packages/rest/CHANGELOG.md +++ b/packages/rest/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/rest +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/rest/package.json b/packages/rest/package.json index 452d30938f..bdc479251a 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/rest", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec REST protocol binding", "homepage": "https://typespec.io", diff --git a/packages/spec-api/CHANGELOG.md b/packages/spec-api/CHANGELOG.md index 8db935f406..3b4b904787 100644 --- a/packages/spec-api/CHANGELOG.md +++ b/packages/spec-api/CHANGELOG.md @@ -4,3 +4,7 @@ No changes, version bump only. +## 0.1.0-alpha.0 + +No changes, version bump only. + diff --git a/packages/spec-coverage-sdk/CHANGELOG.md b/packages/spec-coverage-sdk/CHANGELOG.md index 9cded5a7fd..84f70c9c06 100644 --- a/packages/spec-coverage-sdk/CHANGELOG.md +++ b/packages/spec-coverage-sdk/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.1.0-alpha.2 +No changes, version bump only. + +## 0.1.0-alpha.2 + - Added `packageName` to `scenariosMetadata`. ## 0.1.0-alpha.1 diff --git a/packages/spector/CHANGELOG.md b/packages/spector/CHANGELOG.md index c3376411c5..f851e7ba55 100644 --- a/packages/spector/CHANGELOG.md +++ b/packages/spector/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - @typespec/spector +## 0.1.0-alpha.5 + +No changes, version bump only. + ## 0.1.0-alpha.4 - Update `server start` script parameter - `scenarioPath` to `scenarioPaths`. diff --git a/packages/spector/package.json b/packages/spector/package.json index 29099c4231..a91d478ca0 100644 --- a/packages/spector/package.json +++ b/packages/spector/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/spector", - "version": "0.1.0-alpha.4", + "version": "0.1.0-alpha.5", "description": "Typespec Core Tool to validate, run mock api, collect coverage.", "exports": { ".": { diff --git a/packages/sse/CHANGELOG.md b/packages/sse/CHANGELOG.md index 5189870839..6e463f2746 100644 --- a/packages/sse/CHANGELOG.md +++ b/packages/sse/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog - @typespec/sse +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/sse/package.json b/packages/sse/package.json index 2384ca9d07..0dbfdd045f 100644 --- a/packages/sse/package.json +++ b/packages/sse/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/sse", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library providing server sent events bindings", "homepage": "https://typespec.io", diff --git a/packages/streams/CHANGELOG.md b/packages/streams/CHANGELOG.md index 3e756ac647..abfce8d686 100644 --- a/packages/streams/CHANGELOG.md +++ b/packages/streams/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog - @typespec/streams +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/streams/package.json b/packages/streams/package.json index 1dcb871c4a..4960610e8a 100644 --- a/packages/streams/package.json +++ b/packages/streams/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/streams", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library providing stream bindings", "homepage": "https://typespec.io", diff --git a/packages/tmlanguage-generator/CHANGELOG.md b/packages/tmlanguage-generator/CHANGELOG.md index c47a402e22..fb514f0a99 100644 --- a/packages/tmlanguage-generator/CHANGELOG.md +++ b/packages/tmlanguage-generator/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.5.10 +No changes, version bump only. + +## 0.5.10 + ### Bump dependencies - [#4679](https://github.com/microsoft/typespec/pull/4679) Upgrade dependencies - October 2024 diff --git a/packages/typespec-vs/CHANGELOG.md b/packages/typespec-vs/CHANGELOG.md index 208a05506a..293069921a 100644 --- a/packages/typespec-vs/CHANGELOG.md +++ b/packages/typespec-vs/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - typespec-vs +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 No changes, version bump only. diff --git a/packages/typespec-vs/package.json b/packages/typespec-vs/package.json index 27c3b8acdb..1d180f5bb3 100644 --- a/packages/typespec-vs/package.json +++ b/packages/typespec-vs/package.json @@ -1,7 +1,7 @@ { "name": "typespec-vs", "author": "Microsoft Corporation", - "version": "0.62.0", + "version": "0.63.0", "description": "TypeSpec Language Support for Visual Studio", "homepage": "https://typespec.io", "readme": "https://github.com/microsoft/typespec/blob/main/README.md", diff --git a/packages/typespec-vscode/CHANGELOG.md b/packages/typespec-vscode/CHANGELOG.md index f0f4204f61..21abcf62c9 100644 --- a/packages/typespec-vscode/CHANGELOG.md +++ b/packages/typespec-vscode/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log - typespec-vscode +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bug Fixes diff --git a/packages/typespec-vscode/package.json b/packages/typespec-vscode/package.json index 710abd4a0a..a0d237dd78 100644 --- a/packages/typespec-vscode/package.json +++ b/packages/typespec-vscode/package.json @@ -1,6 +1,6 @@ { "name": "typespec-vscode", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec language support for VS Code", "homepage": "https://typespec.io", diff --git a/packages/versioning/CHANGELOG.md b/packages/versioning/CHANGELOG.md index 9915db7881..c2132a8b6d 100644 --- a/packages/versioning/CHANGELOG.md +++ b/packages/versioning/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log - @typespec/versioning +## 0.63.0 + +### Bug Fixes + +- [#5262](https://github.com/microsoft/typespec/pull/5262) Fixes diagnostics for @typeChangedFrom to properly detect when an incompatible version is referenced inside of a template, union, or tuple. + + ## 0.62.0 ### Bump dependencies diff --git a/packages/versioning/package.json b/packages/versioning/package.json index b29f04c705..15866bef9c 100644 --- a/packages/versioning/package.json +++ b/packages/versioning/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/versioning", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library for declaring and emitting versioned APIs", "homepage": "https://typespec.io", diff --git a/packages/xml/CHANGELOG.md b/packages/xml/CHANGELOG.md index 9defe29596..283d4d053e 100644 --- a/packages/xml/CHANGELOG.md +++ b/packages/xml/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog - @typespec/xml +## 0.63.0 + +No changes, version bump only. + ## 0.62.0 ### Bump dependencies diff --git a/packages/xml/package.json b/packages/xml/package.json index 5ac6d18727..a62a5c1e2a 100644 --- a/packages/xml/package.json +++ b/packages/xml/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/xml", - "version": "0.62.0", + "version": "0.63.0", "author": "Microsoft Corporation", "description": "TypeSpec library providing xml bindings", "homepage": "https://typespec.io", From 1b2899c1690505976e6631518fda5e3c1b4ff010 Mon Sep 17 00:00:00 2001 From: Rodge Fu Date: Wed, 11 Dec 2024 11:57:48 +0800 Subject: [PATCH 45/71] Redirect compiler trace to IDE through language server (#5316) fixes: #1437 --- .../compiler-trace-in-vscode-2024-11-10-12-32-36.md | 7 +++++++ packages/compiler/src/core/logger/console-sink.ts | 5 +++-- packages/compiler/src/server/serverlib.ts | 13 ++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .chronus/changes/compiler-trace-in-vscode-2024-11-10-12-32-36.md diff --git a/.chronus/changes/compiler-trace-in-vscode-2024-11-10-12-32-36.md b/.chronus/changes/compiler-trace-in-vscode-2024-11-10-12-32-36.md new file mode 100644 index 0000000000..a02b59edf1 --- /dev/null +++ b/.chronus/changes/compiler-trace-in-vscode-2024-11-10-12-32-36.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/compiler" +--- + +Compiler trace will be sent to IDE as trace log through language server \ No newline at end of file diff --git a/packages/compiler/src/core/logger/console-sink.ts b/packages/compiler/src/core/logger/console-sink.ts index 87f03d7fd8..b7c023319a 100644 --- a/packages/compiler/src/core/logger/console-sink.ts +++ b/packages/compiler/src/core/logger/console-sink.ts @@ -8,6 +8,7 @@ import { supportsHyperlink } from "./support-hyperlinks.js"; export interface FormatLogOptions { pathRelativeTo?: string; pretty?: boolean; + excludeLogLevel?: boolean; } export interface ConsoleSinkOptions extends FormatLogOptions {} @@ -33,8 +34,8 @@ function hyperlink(text: string, url: string | undefined, options: FormatLogOpti export function formatLog(log: ProcessedLog, options: FormatLogOptions): string { const code = log.code ? ` ${hyperlink(color(options, log.code, pc.gray), log.url, options)}` : ""; - const level = formatLevel(options, log.level); - const content = `${level}${code}: ${log.message}`; + const level: string = options.excludeLogLevel === true ? "" : formatLevel(options, log.level); + const content = level || code ? `${level}${code}: ${log.message}` : log.message; const root = log.sourceLocation; if (root?.file) { const formattedLocation = formatSourceLocation(options, root); diff --git a/packages/compiler/src/server/serverlib.ts b/packages/compiler/src/server/serverlib.ts index 0e883c04b7..eb47f25d09 100644 --- a/packages/compiler/src/server/serverlib.ts +++ b/packages/compiler/src/server/serverlib.ts @@ -50,7 +50,8 @@ import { resolveCodeFix } from "../core/code-fixes.js"; import { compilerAssert, getSourceLocation } from "../core/diagnostics.js"; import { formatTypeSpec } from "../core/formatter.js"; import { getEntityName, getTypeName } from "../core/helpers/type-name-utils.js"; -import { resolveModule, ResolveModuleHost } from "../core/index.js"; +import { ProcessedLog, resolveModule, ResolveModuleHost } from "../core/index.js"; +import { formatLog } from "../core/logger/index.js"; import { getPositionBeforeTrivia } from "../core/parser-utils.js"; import { getNodeAtPosition, getNodeAtPositionDetail, visitChildren } from "../core/parser.js"; import { ensureTrailingDirectorySeparator, getDirectoryPath } from "../core/path-utils.js"; @@ -963,6 +964,16 @@ export function createServer(host: ServerHost): Server { readFile, stat, getSourceFileKind, + logSink: { + log: (log: ProcessedLog) => { + const msg = formatLog(log, { excludeLogLevel: true }); + const sLog: ServerLog = { + level: log.level, + message: msg, + }; + host.log(sLog); + }, + }, }; async function readFile(path: string): Promise { From 8bbdf96202312e0a255e5c395c1cba44f7a29b94 Mon Sep 17 00:00:00 2001 From: Rodge Fu Date: Wed, 11 Dec 2024 12:00:06 +0800 Subject: [PATCH 46/71] Rename vscode extension typespec (#5314) --- ...rename-vscode-extension-typespec-2024-11-10-11-11-45.md | 7 +++++++ packages/typespec-vscode/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .chronus/changes/rename-vscode-extension-typespec-2024-11-10-11-11-45.md diff --git a/.chronus/changes/rename-vscode-extension-typespec-2024-11-10-11-11-45.md b/.chronus/changes/rename-vscode-extension-typespec-2024-11-10-11-11-45.md new file mode 100644 index 0000000000..a6bbf5dd5e --- /dev/null +++ b/.chronus/changes/rename-vscode-extension-typespec-2024-11-10-11-11-45.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - typespec-vscode +--- + +Rename vscode extension from "TypeSpec for VS Code" to "TypeSpec" \ No newline at end of file diff --git a/packages/typespec-vscode/package.json b/packages/typespec-vscode/package.json index a0d237dd78..722b29702e 100644 --- a/packages/typespec-vscode/package.json +++ b/packages/typespec-vscode/package.json @@ -18,7 +18,7 @@ ], "preview": true, "publisher": "typespec", - "displayName": "TypeSpec for VS Code", + "displayName": "TypeSpec", "categories": [ "Programming Languages", "Snippets" From 6ffff89594e56177f7b387240a20d817f7fdc203 Mon Sep 17 00:00:00 2001 From: Zhonglei Ma Date: Wed, 11 Dec 2024 12:46:48 +0800 Subject: [PATCH 47/71] [typespec-vscode] expose linter rule documentation url in codefixes (#5131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modifications best-practices: 1、Add a URL to the rule file to point to the relevant document.(for testing) compiler: 1、A new codefix file has been added to handle the Linter Rule doc URL. 2、Added OPEN_RULE_DOC command type. 3、If the diagnostic URL is not empty, add a codefix and process the send request in the server file. typespec-vscode: 1、Define the request and open the received URL document. samples: 1、Add lint-related configurations to the yaml configuration file to define a lowercase model type in the tsp file for functional testing. Such as "model foo {}". Related issues:https://github.com/microsoft/typespec/issues/3043 --------- Co-authored-by: Rodge Fu --- ...-rule-url-in-codefix-2024-10-21-9-17-32.md | 8 +++ .../src/code-action-provider.ts | 71 +++++++++++++++++++ packages/typespec-vscode/src/extension.ts | 5 ++ .../typespec-vscode/src/vscode-command.ts | 15 ++++ 4 files changed, 99 insertions(+) create mode 100644 .chronus/changes/show-linter-rule-url-in-codefix-2024-10-21-9-17-32.md create mode 100644 packages/typespec-vscode/src/code-action-provider.ts create mode 100644 packages/typespec-vscode/src/vscode-command.ts diff --git a/.chronus/changes/show-linter-rule-url-in-codefix-2024-10-21-9-17-32.md b/.chronus/changes/show-linter-rule-url-in-codefix-2024-10-21-9-17-32.md new file mode 100644 index 0000000000..b8effbc31c --- /dev/null +++ b/.chronus/changes/show-linter-rule-url-in-codefix-2024-10-21-9-17-32.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: fix +packages: + - typespec-vscode +--- + +Support 'See Document' quick action to view the details of linter rules diff --git a/packages/typespec-vscode/src/code-action-provider.ts b/packages/typespec-vscode/src/code-action-provider.ts new file mode 100644 index 0000000000..803242b392 --- /dev/null +++ b/packages/typespec-vscode/src/code-action-provider.ts @@ -0,0 +1,71 @@ +import vscode from "vscode"; +import { OPEN_URL_COMMAND } from "./vscode-command.js"; + +export function createCodeActionProvider() { + return vscode.languages.registerCodeActionsProvider( + "typespec", + new TypeSpecCodeActionProvider(), + { + providedCodeActionKinds: TypeSpecCodeActionProvider.providedCodeActionKinds, + }, + ); +} + +/** + * Provides code actions corresponding to diagnostic problems. + */ +export class TypeSpecCodeActionProvider implements vscode.CodeActionProvider { + public static readonly providedCodeActionKinds = [vscode.CodeActionKind.QuickFix]; + + provideCodeActions( + _document: vscode.TextDocument, + _range: vscode.Range | vscode.Selection, + context: vscode.CodeActionContext, + _token: vscode.CancellationToken, + ): vscode.CodeAction[] { + // for each diagnostic entry that has the matching `code`, create a code action command + // A CodeAction will only be created if it is a TypeSpec diagnostic and code is an object and has a target attribute + // target attribute is the URL to open + + // target is a Uri type, which corresponds to diagnostic.codeDescription.href in compiler + // When target is empty, it does not exist in the code object, so the code action will not be created + const actions: vscode.CodeAction[] = []; + context.diagnostics.forEach((diagnostic) => { + if ( + diagnostic.source === "TypeSpec" && + diagnostic.code && + typeof diagnostic.code === "object" && + "target" in diagnostic.code && + "value" in diagnostic.code + ) { + actions.push( + this.createOpenUrlCodeAction( + diagnostic, + diagnostic.code.target.toString(), + diagnostic.code.value.toString(), + ), + ); + } + }); + return actions; + } + + private createOpenUrlCodeAction( + diagnostic: vscode.Diagnostic, + url: string, + codeActionTitle: string, + ): vscode.CodeAction { + // 'vscode.CodeActionKind.Empty' does not generate a Code Action menu, You must use 'vscode.CodeActionKind.QuickFix' + const action = new vscode.CodeAction( + `See documentation for "${codeActionTitle}"`, + vscode.CodeActionKind.QuickFix, + ); + action.command = { + command: OPEN_URL_COMMAND, + title: diagnostic.message, + arguments: [url], + }; + action.diagnostics = [diagnostic]; + return action; + } +} diff --git a/packages/typespec-vscode/src/extension.ts b/packages/typespec-vscode/src/extension.ts index 3647a203f6..7fe2a5f468 100644 --- a/packages/typespec-vscode/src/extension.ts +++ b/packages/typespec-vscode/src/extension.ts @@ -1,10 +1,12 @@ import vscode, { commands, ExtensionContext } from "vscode"; +import { createCodeActionProvider } from "./code-action-provider.js"; import { SettingName } from "./const.js"; import { ExtensionLogListener } from "./log/extension-log-listener.js"; import logger from "./log/logger.js"; import { TypeSpecLogOutputChannel } from "./log/typespec-log-output-channel.js"; import { createTaskProvider } from "./task-provider.js"; import { TspLanguageClient } from "./tsp-language-client.js"; +import { createCommandOpenUrl } from "./vscode-command.js"; let client: TspLanguageClient | undefined; /** @@ -17,6 +19,9 @@ logger.registerLogListener("extension-log", new ExtensionLogListener(outputChann export async function activate(context: ExtensionContext) { context.subscriptions.push(createTaskProvider()); + context.subscriptions.push(createCodeActionProvider()); + context.subscriptions.push(createCommandOpenUrl()); + context.subscriptions.push( commands.registerCommand("typespec.showOutputChannel", () => { outputChannel.show(true /*preserveFocus*/); diff --git a/packages/typespec-vscode/src/vscode-command.ts b/packages/typespec-vscode/src/vscode-command.ts new file mode 100644 index 0000000000..c9a16a0138 --- /dev/null +++ b/packages/typespec-vscode/src/vscode-command.ts @@ -0,0 +1,15 @@ +import vscode from "vscode"; +import logger from "./log/logger.js"; + +export const OPEN_URL_COMMAND = "typespec.openUrl"; + +export function createCommandOpenUrl() { + return vscode.commands.registerCommand(OPEN_URL_COMMAND, (url: string) => { + // Although vscode has already dealt with the problem of wrong URL, try catch is still added here. + try { + vscode.env.openExternal(vscode.Uri.parse(url)); + } catch (error) { + logger.error(`Failed to open URL: ${url}`, [error as any]); + } + }); +} From f21484e71763ca09c0a17b65ec191f9e2d150d4e Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Wed, 11 Dec 2024 14:13:50 +0800 Subject: [PATCH 48/71] bump TCGC version to 0.48.4 (#5260) Fixes https://github.com/microsoft/typespec/issues/5261 --- .../emitter/src/lib/operation-converter.ts | 2 +- .../http-client-csharp/emitter/test/Unit/usage.test.ts | 3 ++- .../src/InputTypes/InputModelTypeUsage.cs | 4 +++- .../http/authentication/api-key/tspCodeModel.json | 2 +- .../http/authentication/http/custom/tspCodeModel.json | 2 +- .../http/authentication/oauth2/tspCodeModel.json | 2 +- packages/http-client-csharp/package-lock.json | 8 ++++---- packages/http-client-csharp/package.json | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts index dfe8cecdb7..ce895e80be 100644 --- a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts @@ -319,7 +319,7 @@ function getMediaTypes(type: SdkType): string[] { function loadOperationPaging( method: SdkServiceMethod, ): OperationPaging | undefined { - if (method.kind !== "paging") { + if (method.kind !== "paging" || method.__raw_paged_metadata === undefined) { return undefined; } diff --git a/packages/http-client-csharp/emitter/test/Unit/usage.test.ts b/packages/http-client-csharp/emitter/test/Unit/usage.test.ts index c6aef747a0..42e5899f49 100644 --- a/packages/http-client-csharp/emitter/test/Unit/usage.test.ts +++ b/packages/http-client-csharp/emitter/test/Unit/usage.test.ts @@ -664,6 +664,7 @@ interface LegacyLro { ); ok(radiologyInsightsInferenceResult); - strictEqual(radiologyInsightsInferenceResult.usage, UsageFlags.Output | UsageFlags.Json); + // TODO -- TCGC now has a bug that the LRO final result does not have Json usage when the polling operation does not have convenientAPI but the LRO has convenientAPI. https://github.com/Azure/typespec-azure/issues/1964 + //strictEqual(radiologyInsightsInferenceResult.usage, UsageFlags.Output | UsageFlags.Json); }); }); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputModelTypeUsage.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputModelTypeUsage.cs index 12fd1d6eb0..86ae8864fb 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputModelTypeUsage.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.Input/src/InputTypes/InputModelTypeUsage.cs @@ -16,6 +16,8 @@ public enum InputModelTypeUsage MultipartFormData = 32, Spread = 64, Error = 128, - Json = 256 + Json = 256, + Xml = 512, + Exception = 1024, } } diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/tspCodeModel.json index fc72c08e84..e482e7e3f6 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/tspCodeModel.json @@ -9,7 +9,7 @@ "kind": "model", "name": "InvalidAuth", "crossLanguageDefinitionId": "Authentication.ApiKey.InvalidAuth", - "usage": "Output,Error,Json", + "usage": "Error,Json,Exception", "decorators": [], "properties": [ { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/tspCodeModel.json index 3cb9614684..d3581f4452 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/tspCodeModel.json @@ -9,7 +9,7 @@ "kind": "model", "name": "InvalidAuth", "crossLanguageDefinitionId": "Authentication.Http.Custom.InvalidAuth", - "usage": "Output,Error,Json", + "usage": "Error,Json,Exception", "decorators": [], "properties": [ { diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/tspCodeModel.json index f6950afdf7..58548e8802 100644 --- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/tspCodeModel.json +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/tspCodeModel.json @@ -9,7 +9,7 @@ "kind": "model", "name": "InvalidAuth", "crossLanguageDefinitionId": "Authentication.OAuth2.InvalidAuth", - "usage": "Output,Error,Json", + "usage": "Error,Json,Exception", "decorators": [], "properties": [ { diff --git a/packages/http-client-csharp/package-lock.json b/packages/http-client-csharp/package-lock.json index 367625b668..7d35c77562 100644 --- a/packages/http-client-csharp/package-lock.json +++ b/packages/http-client-csharp/package-lock.json @@ -15,7 +15,7 @@ "@azure-tools/cadl-ranch": "0.16.1", "@azure-tools/cadl-ranch-specs": "0.39.3", "@azure-tools/typespec-azure-core": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.1", + "@azure-tools/typespec-client-generator-core": "0.48.4", "@microsoft/api-extractor": "^7.47.11", "@types/node": "~22.7.5", "@typespec/compiler": "0.62.0", @@ -215,9 +215,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.1", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.1.tgz", - "integrity": "sha512-pYEZDExltNNLAaA12EwEag5VLESyPoKNQQ/6Olj4rJouA4cBjZDTW80VYgKuPQBt/uCtA0Yn6xxl0nH7TGOwWQ==", + "version": "0.48.4", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz", + "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/packages/http-client-csharp/package.json b/packages/http-client-csharp/package.json index 0288ea2c50..39d2a2a9d8 100644 --- a/packages/http-client-csharp/package.json +++ b/packages/http-client-csharp/package.json @@ -58,7 +58,7 @@ "@azure-tools/cadl-ranch": "0.16.1", "@azure-tools/cadl-ranch-specs": "0.39.3", "@azure-tools/typespec-azure-core": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.1", + "@azure-tools/typespec-client-generator-core": "0.48.4", "@microsoft/api-extractor": "^7.47.11", "@types/node": "~22.7.5", "@typespec/compiler": "0.62.0", From a862ac7f18e66b1d93c9870bd8e50ad77b2ee07e Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:49:39 +0800 Subject: [PATCH 49/71] http-client-java, fix eclipse languageserver when tmp folder is corrupted (#5307) ### Situation I somehow encountered a folder corruption situation that the tmp folder for language server is there, but with no Jar file. Language server didn't start correctly, but the exception is thrown only when JSON RPC to the server is performed. Screenshot 2024-12-11 at 14 23 52 ### This PR - In case the language server did not start correctly, and user did not explicitly provide a language server path, force a re-download. - If the server failed to start anyway, throw with the process output. ### Test #### Normal first download Screenshot 2024-12-09 at 20 12 06 #### Normal downloaded Screenshot 2024-12-09 at 20 09 22 #### Corrupted folder, we do a re-download Screenshot 2024-12-09 at 20 08 35 #### Server failed to start anyway, we throw with server output Screenshot 2024-12-10 at 16 48 25 --- .../ls/EclipseLanguageServerFacade.java | 69 +++++++++++++++---- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/customization/implementation/ls/EclipseLanguageServerFacade.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/customization/implementation/ls/EclipseLanguageServerFacade.java index 04c37587f1..8e151d13a3 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/customization/implementation/ls/EclipseLanguageServerFacade.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/customization/implementation/ls/EclipseLanguageServerFacade.java @@ -4,8 +4,10 @@ package com.microsoft.typespec.http.client.generator.core.customization.implementation.ls; import com.microsoft.typespec.http.client.generator.core.customization.implementation.Utils; +import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.OutputStream; import java.io.UncheckedIOException; import java.net.URI; @@ -16,6 +18,7 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.TimeUnit; import java.util.zip.GZIPInputStream; import org.apache.tools.tar.TarEntry; import org.apache.tools.tar.TarInputStream; @@ -33,7 +36,7 @@ public EclipseLanguageServerFacade(String pathToLanguageServerPlugin, Logger log int javaVersion = Runtime.version().feature(); Path languageServerPath = (pathToLanguageServerPlugin == null) - ? getLanguageServerDirectory(javaVersion, logger) + ? getLanguageServerDirectory(javaVersion, logger, false) : Paths.get(pathToLanguageServerPlugin).resolve("jdt-language-server"); List command = new ArrayList<>(); @@ -71,18 +74,55 @@ public EclipseLanguageServerFacade(String pathToLanguageServerPlugin, Logger log command.add("./config_linux"); } - logger.info("Starting Eclipse JDT language server at {}", languageServerPath); - server = new ProcessBuilder(command).redirectOutput(ProcessBuilder.Redirect.PIPE) - .redirectInput(ProcessBuilder.Redirect.PIPE) - .redirectErrorStream(true) - .directory(languageServerPath.toFile()) - .start(); + Process server = startServer(command, languageServerPath, logger); + if (!server.isAlive()) { + if (pathToLanguageServerPlugin == null) { + // If user didn't specify language server path, we do a clean re-download. + logger + .warn("Eclipse language server failed to start. The folder may be corrupted. Try re-download."); + server = startServer(command, getLanguageServerDirectory(javaVersion, logger, true), logger); + if (!server.isAlive()) { + // if server failed to start anyway, throw with server output. + throw new RuntimeException(String.format( + "Eclipse language server failed to start, error output:\n %s", readServerOutput(server))); + } + } else { + // if user specify the language server path, we just throw with server output. + throw new RuntimeException(String.format( + "Eclipse language server failed to start, error output:\n %s", readServerOutput(server))); + } + } + this.server = server; } catch (Exception e) { throw new RuntimeException(e); } } - private static Path getLanguageServerDirectory(int javaVersion, Logger logger) throws IOException { + private String readServerOutput(Process server) throws IOException { + if (server.getInputStream() == null) { + return null; + } + StringBuilder stringBuilder = new StringBuilder(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(server.getInputStream()))) { + reader.lines().forEachOrdered(line -> stringBuilder.append(line).append("\n")); + } + return stringBuilder.toString(); + } + + private Process startServer(List command, Path languageServerPath, Logger logger) throws Exception { + logger.info("Starting Eclipse JDT language server at {}", languageServerPath); + final Process server; + server = new ProcessBuilder(command).redirectOutput(ProcessBuilder.Redirect.PIPE) + .redirectInput(ProcessBuilder.Redirect.PIPE) + .redirectErrorStream(true) + .directory(languageServerPath.toFile()) + .start(); + server.waitFor(1, TimeUnit.SECONDS); + return server; + } + + private static Path getLanguageServerDirectory(int javaVersion, Logger logger, boolean forceReDownload) + throws IOException { Path tmp = Paths.get(System.getProperty("java.io.tmpdir")); Path autorestLanguageServer = tmp.resolve("autorest-java-language-server"); @@ -104,9 +144,12 @@ private static Path getLanguageServerDirectory(int javaVersion, Logger logger) t } Path languageServer = languageServerPath.resolve("jdt-language-server"); - if (!Files.exists(languageServerPath) || !Files.exists(languageServer)) { - Files.createDirectories(languageServerPath); + + if (!Files.exists(languageServer) || forceReDownload) { + Files.createDirectories(languageServer); Path zipPath = languageServerPath.resolve("jdt-language-server.tar.gz"); + Files.deleteIfExists(zipPath); + logger.info("Downloading Eclipse JDT language server from {} to {}", downloadUrl, zipPath); try (InputStream in = downloadUrl.openStream()) { Files.copy(in, zipPath); @@ -122,13 +165,15 @@ private static Path getLanguageServerDirectory(int javaVersion, Logger logger) t private static Path unzipLanguageServer(Path zipPath) throws IOException { try (TarInputStream tar = new TarInputStream(new GZIPInputStream(Files.newInputStream(zipPath)))) { Path languageServerDirectory = zipPath.getParent().resolve("jdt-language-server"); - Files.createDirectory(languageServerDirectory); TarEntry entry; while ((entry = tar.getNextEntry()) != null) { if (entry.isDirectory()) { Files.createDirectories(languageServerDirectory.resolve(entry.getName())); } else { - Files.copy(tar, languageServerDirectory.resolve(entry.getName())); + Path entryPath = languageServerDirectory.resolve(entry.getName()); + // In case of corrupted folder, delete before create. + Files.deleteIfExists(entryPath); + Files.copy(tar, entryPath); } } From ed3cccbeba5aefb620b689375e92c77792cf84df Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Wed, 11 Dec 2024 15:50:14 +0800 Subject: [PATCH 50/71] http-client-java, bump typespec libs (#5317) bump for the new typespec versions 1. bug fix for pagination (when no `nextLink`) 2. improvement for unbranded error without body 3. remove `core-json` from unbranded, as it recently merged to `core` --- .../emitter/src/code-model-builder.ts | 39 +- .../generator/core/mapper/PomMapper.java | 2 - .../model/clientmodel/ExternalPackage.java | 8 +- .../core/template/ProxyTemplate.java | 12 +- .../http-client-generator-test/package.json | 24 +- .../fluent/models/OperationInner.java | 4 +- .../implementation/ResponseClientImpl.java | 92 +- .../visibility/VisibilityAsyncClient.java | 8 +- .../tsptest/visibility/VisibilityClient.java | 8 +- .../VisibilityWriteAsyncClient.java | 1 + .../visibility/VisibilityWriteClient.java | 1 + .../implementation/VisibilityClientImpl.java | 8 +- .../implementation/VisibilityWritesImpl.java | 2 + .../tsptest/visibility/models/ReadDog.java | 2 +- .../tsptest/visibility/models/WriteDog.java | 28 +- .../http-client-generator-test/tsp/error.tsp | 5 +- .../http-client-generator-test/tsp/naming.tsp | 1 - .../tsp/response.tsp | 8 +- .../tsp/visibility.tsp | 17 +- packages/http-client-java/package-lock.json | 835 +++++++++++------- packages/http-client-java/package.json | 56 +- 21 files changed, 625 insertions(+), 536 deletions(-) diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index eb89d1722f..279be70a54 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -54,7 +54,6 @@ import { SdkDurationType, SdkEnumType, SdkEnumValueType, - SdkHeaderParameter, SdkHttpErrorResponse, SdkHttpOperation, SdkHttpResponse, @@ -64,7 +63,6 @@ import { SdkModelPropertyType, SdkModelType, SdkPathParameter, - SdkQueryParameter, SdkServiceMethod, SdkType, SdkUnionType, @@ -164,6 +162,8 @@ import { } from "./utils.js"; const { isEqual } = pkg; +type SdkHttpOperationParameterType = SdkHttpOperation["parameters"][number]; + export class CodeModelBuilder { private program: Program; private typeNameOptions: TypeNameOptions; @@ -969,20 +969,19 @@ export class CodeModelBuilder { if (bodyType && bodyType.kind === "model") { const itemName = sdkMethod.response.resultPath; const nextLinkName = sdkMethod.nextLinkPath; - if (itemName && nextLinkName) { - op.extensions = op.extensions ?? {}; - op.extensions["x-ms-pageable"] = { - itemName: itemName, - nextLinkName: nextLinkName, - }; - - op.responses?.forEach((r) => { - if (r instanceof SchemaResponse) { - this.trackSchemaUsage(r.schema, { usage: [SchemaContext.Paged] }); - } - }); - break; - } + + op.extensions = op.extensions ?? {}; + op.extensions["x-ms-pageable"] = { + itemName: itemName, + nextLinkName: nextLinkName, + }; + + op.responses?.forEach((r) => { + if (r instanceof SchemaResponse) { + this.trackSchemaUsage(r.schema, { usage: [SchemaContext.Paged] }); + } + }); + break; } } } @@ -1095,7 +1094,7 @@ export class CodeModelBuilder { private processParameter( op: CodeModelOperation, - param: SdkQueryParameter | SdkPathParameter | SdkHeaderParameter, + param: SdkHttpOperationParameterType, clientContext: ClientContext, ) { if (clientContext.apiVersions && isApiVersion(this.sdkContext, param)) { @@ -1589,11 +1588,7 @@ export class CodeModelBuilder { } private addParameterOrBodyPropertyToCodeModelRequest( - opParameter: - | SdkPathParameter - | SdkHeaderParameter - | SdkQueryParameter - | SdkBodyModelPropertyType, + opParameter: SdkHttpOperationParameterType | SdkBodyModelPropertyType, op: CodeModelOperation, request: Request, schema: ObjectSchema, diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/PomMapper.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/PomMapper.java index 9d9ae797aa..b3e2064bf1 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/PomMapper.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/PomMapper.java @@ -78,8 +78,6 @@ private Pom createGenericPom(Project project) { List dependencyIdentifiers = new ArrayList<>(); // for generic pom, stream style is always true addDependencyIdentifier(dependencyIdentifiers, addedDependencyPrefixes, Project.Dependency.CLIENTCORE, false); - addDependencyIdentifier(dependencyIdentifiers, addedDependencyPrefixes, Project.Dependency.CLIENTCORE_JSON, - false); // merge dependencies in POM and dependencies added above dependencyIdentifiers.addAll(project.getPomDependencyIdentifiers() diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java index 5739750fab..278c615f90 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java @@ -16,10 +16,10 @@ public class ExternalPackage { public static final ExternalPackage CORE = new Builder().packageName(CLIENTCORE_PACKAGE_NAME).groupId("io.clientcore").artifactId("core").build(); - public static final ExternalPackage JSON = new Builder().packageName(CLIENTCORE_JSON_PACKAGE_NAME) - .groupId("io.clientcore") - .artifactId("core-json") - .build(); +// public static final ExternalPackage JSON = new Builder().packageName(CLIENTCORE_JSON_PACKAGE_NAME) +// .groupId("io.clientcore") +// .artifactId("core-json") +// .build(); private final String packageName; private final String groupId; diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java index d50625f68c..112d3563ef 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/ProxyTemplate.java @@ -211,9 +211,15 @@ protected void writeUnexpectedExceptions(ProxyMethod restAPIMethod, JavaInterfac for (Map.Entry> exception : restAPIMethod.getUnexpectedResponseExceptionTypes() .entrySet()) { ClientModel errorModel = ClientModelUtil.getErrorModelFromException(exception.getKey()); - interfaceBlock.annotation("UnexpectedResponseExceptionDetail(statusCode = {" - + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) - + " }, exceptionBodyClass = " + errorModel.getName() + ".class)"); + if (errorModel == null) { + interfaceBlock.annotation("UnexpectedResponseExceptionDetail(statusCode = {" + + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) + + " })"); + } else { + interfaceBlock.annotation("UnexpectedResponseExceptionDetail(statusCode = {" + + exception.getValue().stream().map(String::valueOf).collect(Collectors.joining(",")) + + " }, exceptionBodyClass = " + errorModel.getName() + ".class)"); + } } } } diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json index 3e5c8eb1a9..132966467b 100644 --- a/packages/http-client-java/generator/http-client-generator-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-test/package.json @@ -12,21 +12,21 @@ "testserver-stop": "cadl-ranch server stop" }, "dependencies": { - "@azure-tools/cadl-ranch-specs": "0.39.4", - "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.3.tgz", + "@azure-tools/cadl-ranch-specs": "0.39.5", + "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.4.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0", - "@typespec/openapi": "~0.62.0", - "@typespec/xml": "~0.62.0", - "@azure-tools/typespec-azure-core": "~0.48.0", - "@azure-tools/typespec-client-generator-core": "~0.48.4", - "@azure-tools/typespec-azure-resource-manager": "~0.48.0", - "@azure-tools/typespec-autorest": "~0.48.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0", + "@typespec/openapi": "~0.63.0", + "@typespec/xml": "~0.63.0", + "@azure-tools/typespec-azure-core": "~0.49.0", + "@azure-tools/typespec-client-generator-core": "~0.49.0", + "@azure-tools/typespec-azure-resource-manager": "~0.49.0", + "@azure-tools/typespec-autorest": "~0.49.0" }, "private": true } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/models/OperationInner.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/models/OperationInner.java index 36c9b6cf15..03dfc7be6f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/models/OperationInner.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/fluent/models/OperationInner.java @@ -32,7 +32,7 @@ public final class OperationInner { /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "display") private OperationDisplay display; /* @@ -45,7 +45,7 @@ public final class OperationInner { /* * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType") + @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; /** diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/response/implementation/ResponseClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/response/implementation/ResponseClientImpl.java index 8991384a11..bc830682ec 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/response/implementation/ResponseClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/response/implementation/ResponseClientImpl.java @@ -407,26 +407,6 @@ Mono> listStringsNext(@PathParam(value = "nextLink", encode Response listStringsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listIntegersNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listIntegersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); } /** @@ -1290,7 +1270,7 @@ private Mono> listIntegersSinglePageAsync(RequestOptio return FluxUtil .withContext(context -> service.listIntegers(this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + getValues(res.getValue(), "value"), null, null)); } /** @@ -1312,11 +1292,7 @@ private Mono> listIntegersSinglePageAsync(RequestOptio */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listIntegersAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>(() -> listIntegersSinglePageAsync(requestOptions), - nextLink -> listIntegersNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + return new PagedFlux<>(() -> listIntegersSinglePageAsync(requestOptions)); } /** @@ -1341,7 +1317,7 @@ private PagedResponse listIntegersSinglePage(RequestOptions requestO final String accept = "application/json"; Response res = service.listIntegersSync(this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + getValues(res.getValue(), "value"), null, null); } /** @@ -1363,11 +1339,7 @@ private PagedResponse listIntegersSinglePage(RequestOptions requestO */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listIntegers(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>(() -> listIntegersSinglePage(requestOptions), - nextLink -> listIntegersNextSinglePage(nextLink, requestOptionsForNextPage)); + return new PagedIterable<>(() -> listIntegersSinglePage(requestOptions)); } /** @@ -1540,62 +1512,6 @@ private PagedResponse listStringsNextSinglePage(String nextLink, Req getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); } - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * int
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listIntegersNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listIntegersNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * int
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listIntegersNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listIntegersNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - private List getValues(BinaryData binaryData, String path) { try { Map obj = binaryData.toObject(Map.class); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityAsyncClient.java index bec93c5c3e..807f5320a4 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityAsyncClient.java @@ -75,6 +75,7 @@ public Mono> getWithResponse(RequestOptions requestOptions) *
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -113,7 +114,7 @@ public Mono> createWithResponse(BinaryData dog, RequestOpti
      * 
      * {@code
      * {
-     *     id: int (Required)
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -125,7 +126,6 @@ public Mono> createWithResponse(BinaryData dog, RequestOpti
      * {@code
      * {
      *     id: int (Required)
-     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -237,11 +237,11 @@ public Mono create(WriteDog dog) {
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Mono query(ReadDog dog) {
+    public Mono query(WriteDog dog) {
         // Generated convenience method for queryWithResponse
         RequestOptions requestOptions = new RequestOptions();
         return queryWithResponse(BinaryData.fromObject(dog), requestOptions).flatMap(FluxUtil::toMono)
-            .map(protocolMethodData -> protocolMethodData.toObject(Dog.class));
+            .map(protocolMethodData -> protocolMethodData.toObject(ReadDog.class));
     }
 
     /**
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityClient.java
index a19eb4e6fa..a79ed9bd96 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityClient.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityClient.java
@@ -73,6 +73,7 @@ public Response getWithResponse(RequestOptions requestOptions) {
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -111,7 +112,7 @@ public Response createWithResponse(BinaryData dog, RequestOptions re
      * 
      * {@code
      * {
-     *     id: int (Required)
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -123,7 +124,6 @@ public Response createWithResponse(BinaryData dog, RequestOptions re
      * {@code
      * {
      *     id: int (Required)
-     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -233,10 +233,10 @@ public Dog create(WriteDog dog) {
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    public Dog query(ReadDog dog) {
+    public ReadDog query(WriteDog dog) {
         // Generated convenience method for queryWithResponse
         RequestOptions requestOptions = new RequestOptions();
-        return queryWithResponse(BinaryData.fromObject(dog), requestOptions).getValue().toObject(Dog.class);
+        return queryWithResponse(BinaryData.fromObject(dog), requestOptions).getValue().toObject(ReadDog.class);
     }
 
     /**
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteAsyncClient.java
index 4465ca9b2d..7ec5d34a39 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteAsyncClient.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteAsyncClient.java
@@ -46,6 +46,7 @@ public final class VisibilityWriteAsyncClient {
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteClient.java
index 9ba91f83c7..395be8d078 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteClient.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/VisibilityWriteClient.java
@@ -44,6 +44,7 @@ public final class VisibilityWriteClient {
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityClientImpl.java
index 22e7208a0c..02c3456cc5 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityClientImpl.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityClientImpl.java
@@ -296,6 +296,7 @@ public Response getWithResponse(RequestOptions requestOptions) {
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -336,6 +337,7 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -375,7 +377,7 @@ public Response createWithResponse(BinaryData dog, RequestOptions re
      * 
      * {@code
      * {
-     *     id: int (Required)
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -387,7 +389,6 @@ public Response createWithResponse(BinaryData dog, RequestOptions re
      * {@code
      * {
      *     id: int (Required)
-     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -416,7 +417,7 @@ public Mono> queryWithResponseAsync(BinaryData dog, Request
      * 
      * {@code
      * {
-     *     id: int (Required)
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -428,7 +429,6 @@ public Mono> queryWithResponseAsync(BinaryData dog, Request
      * {@code
      * {
      *     id: int (Required)
-     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityWritesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityWritesImpl.java
index 792db0ec57..48a75538c3 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityWritesImpl.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/implementation/VisibilityWritesImpl.java
@@ -86,6 +86,7 @@ Response createSync(@HostParam("endpoint") String endpoint,
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
@@ -126,6 +127,7 @@ public Mono> createWithResponseAsync(BinaryData dog, Reques
      * 
      * {@code
      * {
+     *     secretName: String (Required)
      *     name: String (Required)
      * }
      * }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/ReadDog.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/ReadDog.java
index d94dcaaabe..8247b5bb9a 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/ReadDog.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/ReadDog.java
@@ -36,7 +36,7 @@ public final class ReadDog implements JsonSerializable {
      * @param name the name value to set.
      */
     @Generated
-    public ReadDog(int id, String name) {
+    private ReadDog(int id, String name) {
         this.id = id;
         this.name = name;
     }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/WriteDog.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/WriteDog.java
index fd27ebe8cb..f25f1921d7 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/WriteDog.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/visibility/models/WriteDog.java
@@ -17,6 +17,12 @@
  */
 @Immutable
 public final class WriteDog implements JsonSerializable {
+    /*
+     * The secretName property.
+     */
+    @Generated
+    private final String secretName;
+
     /*
      * The name property.
      */
@@ -26,13 +32,25 @@ public final class WriteDog implements JsonSerializable {
     /**
      * Creates an instance of WriteDog class.
      * 
+     * @param secretName the secretName value to set.
      * @param name the name value to set.
      */
     @Generated
-    public WriteDog(String name) {
+    public WriteDog(String secretName, String name) {
+        this.secretName = secretName;
         this.name = name;
     }
 
+    /**
+     * Get the secretName property: The secretName property.
+     * 
+     * @return the secretName value.
+     */
+    @Generated
+    public String getSecretName() {
+        return this.secretName;
+    }
+
     /**
      * Get the name property: The name property.
      * 
@@ -50,6 +68,7 @@ public String getName() {
     @Override
     public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
         jsonWriter.writeStartObject();
+        jsonWriter.writeStringField("secretName", this.secretName);
         jsonWriter.writeStringField("name", this.name);
         return jsonWriter.writeEndObject();
     }
@@ -66,18 +85,21 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
     @Generated
     public static WriteDog fromJson(JsonReader jsonReader) throws IOException {
         return jsonReader.readObject(reader -> {
+            String secretName = null;
             String name = null;
             while (reader.nextToken() != JsonToken.END_OBJECT) {
                 String fieldName = reader.getFieldName();
                 reader.nextToken();
 
-                if ("name".equals(fieldName)) {
+                if ("secretName".equals(fieldName)) {
+                    secretName = reader.getString();
+                } else if ("name".equals(fieldName)) {
                     name = reader.getString();
                 } else {
                     reader.skipChildren();
                 }
             }
-            return new WriteDog(name);
+            return new WriteDog(secretName, name);
         });
     }
 }
diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/error.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/error.tsp
index 4f572c163c..c80cdcb23b 100644
--- a/packages/http-client-java/generator/http-client-generator-test/tsp/error.tsp
+++ b/packages/http-client-java/generator/http-client-generator-test/tsp/error.tsp
@@ -16,7 +16,10 @@ model Diagnostic {
   error: Error;
 }
 
+@error
+model NotFoundErrorResponse is NotFoundResponse;
+
 @route("/error")
 interface ErrorOp {
-  read(): ResourceCreatedOrOkResponse | ErrorResponse;
+  read(): ResourceCreatedOrOkResponse | NotFoundErrorResponse | ErrorResponse;
 }
diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/naming.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/naming.tsp
index cb06a9fff0..ecc7ee33bc 100644
--- a/packages/http-client-java/generator/http-client-generator-test/tsp/naming.tsp
+++ b/packages/http-client-java/generator/http-client-generator-test/tsp/naming.tsp
@@ -72,7 +72,6 @@ model BytesData extends Data {
   @doc("Data as {@code byte[]}")
   @clientName("dataAsBytes")
   @encodedName("application/json", "data_bytes")
-  @projectedName("client", "noeffect")
   data: bytes;
 }
 
diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/response.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/response.tsp
index e2ab06c907..4a1e50427f 100644
--- a/packages/http-client-java/generator/http-client-generator-test/tsp/response.tsp
+++ b/packages/http-client-java/generator/http-client-generator-test/tsp/response.tsp
@@ -86,7 +86,7 @@ model StringsList {
   @items
   value: string[];
 
-  @global.Azure.Core.nextLink
+  @nextLink
   nextLink?: string;
 }
 
@@ -94,18 +94,12 @@ model StringsList {
 model Int32sList {
   @items
   value: int32[];
-
-  @global.Azure.Core.nextLink
-  nextLink?: string;
 }
 
 @pagedResult
 model DateTimesList {
   @items
   value: utcDateTime[];
-
-  @global.Azure.Core.nextLink
-  nextLink?: string;
 }
 
 op CustomLongRunningOperation<
diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/visibility.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/visibility.tsp
index a01072b39d..61d967b491 100644
--- a/packages/http-client-java/generator/http-client-generator-test/tsp/visibility.tsp
+++ b/packages/http-client-java/generator/http-client-generator-test/tsp/visibility.tsp
@@ -10,28 +10,27 @@ using Azure.ClientGenerator.Core;
 namespace TspTest.Visibility;
 
 model Dog {
-  @visibility("read") id: int32;
-  @visibility("update") secretName: string;
+  @visibility(Lifecycle.Read) id: int32;
+  @visibility(Lifecycle.Create, Lifecycle.Update) secretName: string;
 
-  // no flags are like specifying all flags at once, so in this case
-  // equivalent to @visibility("read", "write")
+  // no flags are same as specifying all Lifecycle
   name: string;
 }
 
 model RoundTripModel {
   name: string;
-  @visibility("create", "update") secretName: string;
+  @visibility(Lifecycle.Create, Lifecycle.Update) secretName: string;
 }
 
 // The spread operator will copy all the properties of Dog into ReadDog,
 // and withVisibility will remove any that don't match the current
 // visibility setting
-@withVisibility("read")
+@withVisibility(Lifecycle.Read)
 model ReadDog {
   ...Dog;
 }
 
-@withVisibility("write")
+@withVisibility(Lifecycle.Create, Lifecycle.Update)
 model WriteDog {
   ...Dog;
 }
@@ -58,8 +57,8 @@ interface VisibilityWrite {
 interface VisibilityOp extends VisibilityRead, VisibilityWrite {
   @post
   @route("/query")
-  query(@body dog: ReadDog): {
-    @body body: Dog;
+  query(@body dog: WriteDog): {
+    @body body: ReadDog;
   };
 
   @put
diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json
index 418aa3f8af..89fb0ef4ae 100644
--- a/packages/http-client-java/package-lock.json
+++ b/packages/http-client-java/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "@typespec/http-client-java",
-  "version": "0.1.3",
+  "version": "0.1.4",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "@typespec/http-client-java",
-      "version": "0.1.3",
+      "version": "0.1.4",
       "license": "MIT",
       "dependencies": {
         "@autorest/codemodel": "~4.20.0",
@@ -16,41 +16,41 @@
       },
       "devDependencies": {
         "@azure-tools/cadl-ranch": "0.16.1",
-        "@azure-tools/typespec-autorest": "0.48.0",
-        "@azure-tools/typespec-azure-core": "0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "0.48.0",
-        "@azure-tools/typespec-azure-rulesets": "0.48.0",
-        "@azure-tools/typespec-client-generator-core": "0.48.4",
-        "@microsoft/api-extractor": "^7.47.11",
-        "@microsoft/api-extractor-model": "^7.29.8",
+        "@azure-tools/typespec-autorest": "0.49.0",
+        "@azure-tools/typespec-azure-core": "0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "0.49.0",
+        "@azure-tools/typespec-azure-rulesets": "0.49.0",
+        "@azure-tools/typespec-client-generator-core": "0.49.0",
+        "@microsoft/api-extractor": "^7.48.0",
+        "@microsoft/api-extractor-model": "^7.30.0",
         "@types/js-yaml": "~4.0.9",
         "@types/lodash": "~4.17.13",
-        "@types/node": "~22.9.0",
-        "@typespec/compiler": "0.62.0",
-        "@typespec/http": "0.62.0",
-        "@typespec/openapi": "0.62.0",
-        "@typespec/rest": "0.62.0",
-        "@typespec/versioning": "0.62.0",
-        "@vitest/coverage-v8": "^2.1.5",
-        "@vitest/ui": "^2.1.5",
-        "c8": "~10.1.2",
+        "@types/node": "~22.10.1",
+        "@typespec/compiler": "0.63.0",
+        "@typespec/http": "0.63.0",
+        "@typespec/openapi": "0.63.0",
+        "@typespec/rest": "0.63.0",
+        "@typespec/versioning": "0.63.0",
+        "@vitest/coverage-v8": "^2.1.8",
+        "@vitest/ui": "^2.1.8",
+        "c8": "~10.1.3",
         "rimraf": "~6.0.1",
-        "typescript": "~5.6.3",
-        "vitest": "^2.1.5"
+        "typescript": "~5.7.2",
+        "vitest": "^2.1.8"
       },
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
-        "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
-        "@azure-tools/typespec-client-generator-core": ">=0.48.4 <1.0.0",
-        "@typespec/compiler": ">=0.62.0 <1.0.0",
-        "@typespec/http": ">=0.62.0 <1.0.0",
-        "@typespec/openapi": ">=0.62.0 <1.0.0",
-        "@typespec/rest": ">=0.62.0 <1.0.0",
-        "@typespec/versioning": ">=0.62.0 <1.0.0",
-        "@typespec/xml": ">=0.62.0 <1.0.0"
+        "@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
+        "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
+        "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0",
+        "@typespec/compiler": ">=0.63.0 <1.0.0",
+        "@typespec/http": ">=0.63.0 <1.0.0",
+        "@typespec/openapi": ">=0.63.0 <1.0.0",
+        "@typespec/rest": ">=0.63.0 <1.0.0",
+        "@typespec/versioning": ">=0.63.0 <1.0.0",
+        "@typespec/xml": ">=0.63.0 <1.0.0"
       }
     },
     "node_modules/@ampproject/remapping": {
@@ -167,11 +167,12 @@
         "node": ">=16.0.0"
       }
     },
-    "node_modules/@azure-tools/cadl-ranch-expect": {
+    "node_modules/@azure-tools/cadl-ranch/node_modules/@azure-tools/cadl-ranch-expect": {
       "version": "0.15.6",
       "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.6.tgz",
       "integrity": "sha512-t601oyRwiSy/Nbbro5A7OHZSKsVGxGRJMPnd4X80dYetTBinUHXS2+cVx+fVQlUmb/4Ru/qNOvG0jtTJY9/XHw==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=16.0.0"
       },
@@ -182,6 +183,83 @@
         "@typespec/versioning": "~0.62.0"
       }
     },
+    "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/compiler": {
+      "version": "0.62.0",
+      "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz",
+      "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@babel/code-frame": "~7.25.7",
+        "ajv": "~8.17.1",
+        "change-case": "~5.4.4",
+        "globby": "~14.0.2",
+        "mustache": "~4.2.0",
+        "picocolors": "~1.1.0",
+        "prettier": "~3.3.3",
+        "prompts": "~2.4.2",
+        "semver": "^7.6.3",
+        "temporal-polyfill": "^0.2.5",
+        "vscode-languageserver": "~9.0.1",
+        "vscode-languageserver-textdocument": "~1.0.12",
+        "yaml": "~2.5.1",
+        "yargs": "~17.7.2"
+      },
+      "bin": {
+        "tsp": "cmd/tsp.js",
+        "tsp-server": "cmd/tsp-server.js"
+      },
+      "engines": {
+        "node": ">=18.0.0"
+      }
+    },
+    "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/http": {
+      "version": "0.62.0",
+      "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz",
+      "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=18.0.0"
+      },
+      "peerDependencies": {
+        "@typespec/compiler": "~0.62.0",
+        "@typespec/streams": "~0.62.0"
+      },
+      "peerDependenciesMeta": {
+        "@typespec/streams": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/rest": {
+      "version": "0.62.0",
+      "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz",
+      "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=18.0.0"
+      },
+      "peerDependencies": {
+        "@typespec/compiler": "~0.62.0",
+        "@typespec/http": "~0.62.0"
+      }
+    },
+    "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/versioning": {
+      "version": "0.62.0",
+      "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz",
+      "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==",
+      "dev": true,
+      "license": "MIT",
+      "peer": true,
+      "engines": {
+        "node": ">=18.0.0"
+      },
+      "peerDependencies": {
+        "@typespec/compiler": "~0.62.0"
+      }
+    },
     "node_modules/@azure-tools/cadl-ranch/node_modules/ajv": {
       "version": "8.17.1",
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
@@ -220,43 +298,46 @@
       }
     },
     "node_modules/@azure-tools/typespec-autorest": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.48.0.tgz",
-      "integrity": "sha512-AyoNMq3EORugHynFF8bN0TJh+zYxui/ApU5DoVEL7Xr1yMD6k9p5b90VD4HiCsP0dz8470ApFnjt5Vl6xCSzig==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.49.0.tgz",
+      "integrity": "sha512-stwfhmEc3yPeXbM8yfLKVCtaX5mR0H+sL74Xy/eMdEWoJgiE3aJxkgRWESu/7/vo99vugzo/HRwIEO5ELnyfRg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-        "@azure-tools/typespec-client-generator-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+        "@azure-tools/typespec-client-generator-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-core": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.48.0.tgz",
-      "integrity": "sha512-80qyqgTgBbrnCGXtz6eWAMBdEAjYVVL780L0Ye+rBEd6VoA0m3JrgzUqf5bC0Iwju6lEtBAb8o6sefKD/NGA7g==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.49.0.tgz",
+      "integrity": "sha512-hNKy+aePmPkB1brHQkO1tsJXqXPzt/9ehy10dv0rKdp9xq5dE3yBctHF5Aj3Nr8kr8GRG5z4KYpYPbV5guoT5w==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/rest": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/rest": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-resource-manager": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.48.0.tgz",
-      "integrity": "sha512-4JxPbKxd3EJ98sLbtfBlqyANWVrU6tT2nk3iLspg7MITPLhiMTeRT9BprsJXH18ks8qw8scR7/am5r57YERTmQ==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.49.0.tgz",
+      "integrity": "sha512-1xWuG8OBJDykYM6BFD2owV9WH+oC32zt7XteXA0T4nH2T+D+sEFKppkCOMtIjX7ENBAlecmbdwgSNTZYQf4vaw==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "change-case": "~5.4.4",
         "pluralize": "^8.0.0"
@@ -265,48 +346,51 @@
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-rulesets": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.48.0.tgz",
-      "integrity": "sha512-IkPxC8v9wVSl/eKU7N4NhqD3RPh+bIYpxDW5LBAhkuQVcE3RumAkWqh2pmkckihQRhgwiCXhcJVZAzBpVa5SUA==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.49.0.tgz",
+      "integrity": "sha512-qKynK3lp+eqlt6QPGFSptrt9uqJUfeuv6yVXYDuaX1Jqu7tbTAgGf0HtN8mqPzfu3eAb84bdq6VgNspxyXLDOg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-        "@azure-tools/typespec-client-generator-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+        "@azure-tools/typespec-client-generator-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-client-generator-core": {
-      "version": "0.48.4",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz",
-      "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.49.0.tgz",
+      "integrity": "sha512-inFLRIeTU0mQg4PT19O3YwT/4YODLuTgIsXuhKDdG/sEsx8PG8AEFTabtnZJ0w3Lc4xuxKFJrzZ2ZH2iiAAbig==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "change-case": "~5.4.4",
-        "pluralize": "^8.0.0"
+        "pluralize": "^8.0.0",
+        "yaml": "~2.5.1"
       },
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure/abort-controller": {
@@ -1192,18 +1276,19 @@
       }
     },
     "node_modules/@microsoft/api-extractor": {
-      "version": "7.47.11",
-      "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.47.11.tgz",
-      "integrity": "sha512-lrudfbPub5wzBhymfFtgZKuBvXxoSIAdrvS2UbHjoMT2TjIEddq6Z13pcve7A03BAouw0x8sW8G4txdgfiSwpQ==",
+      "version": "7.48.0",
+      "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.48.0.tgz",
+      "integrity": "sha512-FMFgPjoilMUWeZXqYRlJ3gCVRhB7WU/HN88n8OLqEsmsG4zBdX/KQdtJfhq95LQTQ++zfu0Em1LLb73NqRCLYQ==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "@microsoft/api-extractor-model": "7.29.8",
-        "@microsoft/tsdoc": "~0.15.0",
-        "@microsoft/tsdoc-config": "~0.17.0",
-        "@rushstack/node-core-library": "5.9.0",
+        "@microsoft/api-extractor-model": "7.30.0",
+        "@microsoft/tsdoc": "~0.15.1",
+        "@microsoft/tsdoc-config": "~0.17.1",
+        "@rushstack/node-core-library": "5.10.0",
         "@rushstack/rig-package": "0.5.3",
-        "@rushstack/terminal": "0.14.2",
-        "@rushstack/ts-command-line": "4.23.0",
+        "@rushstack/terminal": "0.14.3",
+        "@rushstack/ts-command-line": "4.23.1",
         "lodash": "~4.17.15",
         "minimatch": "~3.0.3",
         "resolve": "~1.22.1",
@@ -1216,14 +1301,15 @@
       }
     },
     "node_modules/@microsoft/api-extractor-model": {
-      "version": "7.29.8",
-      "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.29.8.tgz",
-      "integrity": "sha512-t3Z/xcO6TRbMcnKGVMs4uMzv/gd5j0NhMiJIGjD4cJMeFJ1Hf8wnLSx37vxlRlL0GWlGJhnFgxvnaL6JlS+73g==",
+      "version": "7.30.0",
+      "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.30.0.tgz",
+      "integrity": "sha512-26/LJZBrsWDKAkOWRiQbdVgcfd1F3nyJnAiJzsAgpouPk7LtOIj7PK9aJtBaw/pUXrkotEg27RrT+Jm/q0bbug==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "@microsoft/tsdoc": "~0.15.0",
-        "@microsoft/tsdoc-config": "~0.17.0",
-        "@rushstack/node-core-library": "5.9.0"
+        "@microsoft/tsdoc": "~0.15.1",
+        "@microsoft/tsdoc-config": "~0.17.1",
+        "@rushstack/node-core-library": "5.10.0"
       }
     },
     "node_modules/@microsoft/api-extractor/node_modules/brace-expansion": {
@@ -1289,18 +1375,20 @@
       }
     },
     "node_modules/@microsoft/tsdoc": {
-      "version": "0.15.0",
-      "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.0.tgz",
-      "integrity": "sha512-HZpPoABogPvjeJOdzCOSJsXeL/SMCBgBZMVC3X3d7YYp2gf31MfxhUoYUNwf1ERPJOnQc0wkFn9trqI6ZEdZuA==",
-      "dev": true
+      "version": "0.15.1",
+      "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.15.1.tgz",
+      "integrity": "sha512-4aErSrCR/On/e5G2hDP0wjooqDdauzEbIq8hIkIe5pXV0rtWJZvdCEKL0ykZxex+IxIwBp0eGeV48hQN07dXtw==",
+      "dev": true,
+      "license": "MIT"
     },
     "node_modules/@microsoft/tsdoc-config": {
-      "version": "0.17.0",
-      "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.0.tgz",
-      "integrity": "sha512-v/EYRXnCAIHxOHW+Plb6OWuUoMotxTN0GLatnpOb1xq0KuTNw/WI3pamJx/UbsoJP5k9MCw1QxvvhPcF9pH3Zg==",
+      "version": "0.17.1",
+      "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.17.1.tgz",
+      "integrity": "sha512-UtjIFe0C6oYgTnad4q1QP4qXwLhe6tIpNTRStJ2RZEPIkqQPREAwE5spzVxsdn9UaEMUqhh0AqSx3X4nWAKXWw==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "@microsoft/tsdoc": "0.15.0",
+        "@microsoft/tsdoc": "0.15.1",
         "ajv": "~8.12.0",
         "jju": "~1.4.0",
         "resolve": "~1.22.2"
@@ -1356,9 +1444,9 @@
       "license": "MIT"
     },
     "node_modules/@rollup/rollup-android-arm-eabi": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.26.0.tgz",
-      "integrity": "sha512-gJNwtPDGEaOEgejbaseY6xMFu+CPltsc8/T+diUTTbOQLqD+bnrJq9ulH6WD69TqwqWmrfRAtUv30cCFZlbGTQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.1.tgz",
+      "integrity": "sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==",
       "cpu": [
         "arm"
       ],
@@ -1370,9 +1458,9 @@
       ]
     },
     "node_modules/@rollup/rollup-android-arm64": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.26.0.tgz",
-      "integrity": "sha512-YJa5Gy8mEZgz5JquFruhJODMq3lTHWLm1fOy+HIANquLzfIOzE9RA5ie3JjCdVb9r46qfAQY/l947V0zfGJ0OQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.1.tgz",
+      "integrity": "sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==",
       "cpu": [
         "arm64"
       ],
@@ -1384,9 +1472,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-arm64": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.26.0.tgz",
-      "integrity": "sha512-ErTASs8YKbqTBoPLp/kA1B1Um5YSom8QAc4rKhg7b9tyyVqDBlQxy7Bf2wW7yIlPGPg2UODDQcbkTlruPzDosw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.1.tgz",
+      "integrity": "sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==",
       "cpu": [
         "arm64"
       ],
@@ -1398,9 +1486,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-x64": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.26.0.tgz",
-      "integrity": "sha512-wbgkYDHcdWW+NqP2mnf2NOuEbOLzDblalrOWcPyY6+BRbVhliavon15UploG7PpBRQ2bZJnbmh8o3yLoBvDIHA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.1.tgz",
+      "integrity": "sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==",
       "cpu": [
         "x64"
       ],
@@ -1412,9 +1500,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-arm64": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.26.0.tgz",
-      "integrity": "sha512-Y9vpjfp9CDkAG4q/uwuhZk96LP11fBz/bYdyg9oaHYhtGZp7NrbkQrj/66DYMMP2Yo/QPAsVHkV891KyO52fhg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.1.tgz",
+      "integrity": "sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==",
       "cpu": [
         "arm64"
       ],
@@ -1426,9 +1514,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-x64": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.26.0.tgz",
-      "integrity": "sha512-A/jvfCZ55EYPsqeaAt/yDAG4q5tt1ZboWMHEvKAH9Zl92DWvMIbnZe/f/eOXze65aJaaKbL+YeM0Hz4kLQvdwg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.1.tgz",
+      "integrity": "sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==",
       "cpu": [
         "x64"
       ],
@@ -1440,9 +1528,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.26.0.tgz",
-      "integrity": "sha512-paHF1bMXKDuizaMODm2bBTjRiHxESWiIyIdMugKeLnjuS1TCS54MF5+Y5Dx8Ui/1RBPVRE09i5OUlaLnv8OGnA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.1.tgz",
+      "integrity": "sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==",
       "cpu": [
         "arm"
       ],
@@ -1454,9 +1542,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-musleabihf": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.26.0.tgz",
-      "integrity": "sha512-cwxiHZU1GAs+TMxvgPfUDtVZjdBdTsQwVnNlzRXC5QzIJ6nhfB4I1ahKoe9yPmoaA/Vhf7m9dB1chGPpDRdGXg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.1.tgz",
+      "integrity": "sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==",
       "cpu": [
         "arm"
       ],
@@ -1468,9 +1556,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-gnu": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.26.0.tgz",
-      "integrity": "sha512-4daeEUQutGRCW/9zEo8JtdAgtJ1q2g5oHaoQaZbMSKaIWKDQwQ3Yx0/3jJNmpzrsScIPtx/V+1AfibLisb3AMQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.1.tgz",
+      "integrity": "sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==",
       "cpu": [
         "arm64"
       ],
@@ -1482,9 +1570,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-musl": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.26.0.tgz",
-      "integrity": "sha512-eGkX7zzkNxvvS05ROzJ/cO/AKqNvR/7t1jA3VZDi2vRniLKwAWxUr85fH3NsvtxU5vnUUKFHKh8flIBdlo2b3Q==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.1.tgz",
+      "integrity": "sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==",
       "cpu": [
         "arm64"
       ],
@@ -1495,10 +1583,24 @@
         "linux"
       ]
     },
+    "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.28.1.tgz",
+      "integrity": "sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==",
+      "cpu": [
+        "loong64"
+      ],
+      "dev": true,
+      "license": "MIT",
+      "optional": true,
+      "os": [
+        "linux"
+      ]
+    },
     "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.26.0.tgz",
-      "integrity": "sha512-Odp/lgHbW/mAqw/pU21goo5ruWsytP7/HCC/liOt0zcGG0llYWKrd10k9Fj0pdj3prQ63N5yQLCLiE7HTX+MYw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.1.tgz",
+      "integrity": "sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==",
       "cpu": [
         "ppc64"
       ],
@@ -1510,9 +1612,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-riscv64-gnu": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.26.0.tgz",
-      "integrity": "sha512-MBR2ZhCTzUgVD0OJdTzNeF4+zsVogIR1U/FsyuFerwcqjZGvg2nYe24SAHp8O5sN8ZkRVbHwlYeHqcSQ8tcYew==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.1.tgz",
+      "integrity": "sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==",
       "cpu": [
         "riscv64"
       ],
@@ -1524,9 +1626,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-s390x-gnu": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.26.0.tgz",
-      "integrity": "sha512-YYcg8MkbN17fMbRMZuxwmxWqsmQufh3ZJFxFGoHjrE7bv0X+T6l3glcdzd7IKLiwhT+PZOJCblpnNlz1/C3kGQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.1.tgz",
+      "integrity": "sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==",
       "cpu": [
         "s390x"
       ],
@@ -1538,9 +1640,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-gnu": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.26.0.tgz",
-      "integrity": "sha512-ZuwpfjCwjPkAOxpjAEjabg6LRSfL7cAJb6gSQGZYjGhadlzKKywDkCUnJ+KEfrNY1jH5EEoSIKLCb572jSiglA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.1.tgz",
+      "integrity": "sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==",
       "cpu": [
         "x64"
       ],
@@ -1552,9 +1654,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-musl": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.26.0.tgz",
-      "integrity": "sha512-+HJD2lFS86qkeF8kNu0kALtifMpPCZU80HvwztIKnYwym3KnA1os6nsX4BGSTLtS2QVAGG1P3guRgsYyMA0Yhg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.1.tgz",
+      "integrity": "sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==",
       "cpu": [
         "x64"
       ],
@@ -1566,9 +1668,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-arm64-msvc": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.26.0.tgz",
-      "integrity": "sha512-WUQzVFWPSw2uJzX4j6YEbMAiLbs0BUysgysh8s817doAYhR5ybqTI1wtKARQKo6cGop3pHnrUJPFCsXdoFaimQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.1.tgz",
+      "integrity": "sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==",
       "cpu": [
         "arm64"
       ],
@@ -1580,9 +1682,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-ia32-msvc": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.26.0.tgz",
-      "integrity": "sha512-D4CxkazFKBfN1akAIY6ieyOqzoOoBV1OICxgUblWxff/pSjCA2khXlASUx7mK6W1oP4McqhgcCsu6QaLj3WMWg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.1.tgz",
+      "integrity": "sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==",
       "cpu": [
         "ia32"
       ],
@@ -1594,9 +1696,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-x64-msvc": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.26.0.tgz",
-      "integrity": "sha512-2x8MO1rm4PGEP0xWbubJW5RtbNLk3puzAMaLQd3B3JHVw4KcHlmXcO+Wewx9zCoo7EUFiMlu/aZbCJ7VjMzAag==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz",
+      "integrity": "sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==",
       "cpu": [
         "x64"
       ],
@@ -1608,10 +1710,11 @@
       ]
     },
     "node_modules/@rushstack/node-core-library": {
-      "version": "5.9.0",
-      "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.9.0.tgz",
-      "integrity": "sha512-MMsshEWkTbXqxqFxD4gcIUWQOCeBChlGczdZbHfqmNZQFLHB3yWxDFSMHFUdu2/OB9NUk7Awn5qRL+rws4HQNg==",
+      "version": "5.10.0",
+      "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-5.10.0.tgz",
+      "integrity": "sha512-2pPLCuS/3x7DCd7liZkqOewGM0OzLyCacdvOe8j6Yrx9LkETGnxul1t7603bIaB8nUAooORcct9fFDOQMbWAgw==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "ajv": "~8.13.0",
         "ajv-draft-04": "~1.0.0",
@@ -1636,6 +1739,7 @@
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.13.0.tgz",
       "integrity": "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "fast-deep-equal": "^3.1.3",
         "json-schema-traverse": "^1.0.0",
@@ -1652,6 +1756,7 @@
       "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
       "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
       "dev": true,
+      "license": "ISC",
       "dependencies": {
         "yallist": "^4.0.0"
       },
@@ -1664,6 +1769,7 @@
       "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
       "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
       "dev": true,
+      "license": "ISC",
       "dependencies": {
         "lru-cache": "^6.0.0"
       },
@@ -1685,12 +1791,13 @@
       }
     },
     "node_modules/@rushstack/terminal": {
-      "version": "0.14.2",
-      "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.2.tgz",
-      "integrity": "sha512-2fC1wqu1VCExKC0/L+0noVcFQEXEnoBOtCIex1TOjBzEDWcw8KzJjjj7aTP6mLxepG0XIyn9OufeFb6SFsa+sg==",
+      "version": "0.14.3",
+      "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.14.3.tgz",
+      "integrity": "sha512-csXbZsAdab/v8DbU1sz7WC2aNaKArcdS/FPmXMOXEj/JBBZMvDK0+1b4Qao0kkG0ciB1Qe86/Mb68GjH6/TnMw==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "@rushstack/node-core-library": "5.9.0",
+        "@rushstack/node-core-library": "5.10.0",
         "supports-color": "~8.1.1"
       },
       "peerDependencies": {
@@ -1707,6 +1814,7 @@
       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
       "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=8"
       }
@@ -1716,6 +1824,7 @@
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
       "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "has-flag": "^4.0.0"
       },
@@ -1727,12 +1836,13 @@
       }
     },
     "node_modules/@rushstack/ts-command-line": {
-      "version": "4.23.0",
-      "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.0.tgz",
-      "integrity": "sha512-jYREBtsxduPV6ptNq8jOKp9+yx0ld1Tb/Tkdnlj8gTjazl1sF3DwX2VbluyYrNd0meWIL0bNeer7WDf5tKFjaQ==",
+      "version": "4.23.1",
+      "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.23.1.tgz",
+      "integrity": "sha512-40jTmYoiu/xlIpkkRsVfENtBq4CW3R4azbL0Vmda+fMwHWqss6wwf/Cy/UJmMqIzpfYc2OTnjYP1ZLD3CmyeCA==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
-        "@rushstack/terminal": "0.14.2",
+        "@rushstack/terminal": "0.14.3",
         "@types/argparse": "1.0.38",
         "argparse": "~1.0.9",
         "string-argv": "~0.3.1"
@@ -1743,6 +1853,7 @@
       "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
       "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "sprintf-js": "~1.0.2"
       }
@@ -1762,7 +1873,8 @@
       "version": "1.0.38",
       "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz",
       "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==",
-      "dev": true
+      "dev": true,
+      "license": "MIT"
     },
     "node_modules/@types/estree": {
       "version": "1.0.6",
@@ -1791,13 +1903,13 @@
       "license": "MIT"
     },
     "node_modules/@types/node": {
-      "version": "22.9.0",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz",
-      "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==",
+      "version": "22.10.1",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz",
+      "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "undici-types": "~6.19.8"
+        "undici-types": "~6.20.0"
       }
     },
     "node_modules/@types/triple-beam": {
@@ -1807,16 +1919,17 @@
       "dev": true
     },
     "node_modules/@typespec/compiler": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz",
-      "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz",
+      "integrity": "sha512-cC3YniwbFghn1fASX3r1IgNjMrwaY4gmzznkHT4f/NxE+HK4XoXWn4EG7287QgVMCaHUykzJCIfW9k7kIleW5A==",
+      "license": "MIT",
       "dependencies": {
         "@babel/code-frame": "~7.25.7",
         "ajv": "~8.17.1",
         "change-case": "~5.4.4",
         "globby": "~14.0.2",
         "mustache": "~4.2.0",
-        "picocolors": "~1.1.0",
+        "picocolors": "~1.1.1",
         "prettier": "~3.3.3",
         "prompts": "~2.4.2",
         "semver": "^7.6.3",
@@ -1849,58 +1962,18 @@
         "url": "https://github.com/sponsors/epoberezkin"
       }
     },
-    "node_modules/@typespec/compiler/node_modules/globby": {
-      "version": "14.0.2",
-      "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz",
-      "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==",
-      "dependencies": {
-        "@sindresorhus/merge-streams": "^2.1.0",
-        "fast-glob": "^3.3.2",
-        "ignore": "^5.2.4",
-        "path-type": "^5.0.0",
-        "slash": "^5.1.0",
-        "unicorn-magic": "^0.1.0"
-      },
-      "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@typespec/compiler/node_modules/path-type": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
-      "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
-      "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
-    "node_modules/@typespec/compiler/node_modules/slash": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
-      "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
-      "engines": {
-        "node": ">=14.16"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
     "node_modules/@typespec/http": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz",
-      "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.63.0.tgz",
+      "integrity": "sha512-SYVbBmLPAPdWZfdMs0QlbpTnFREDnkINu2FR+0kRX12qzbRgpRbLsdhg59qx4TfKoh4IAPgSV+Fq84w7BWGsyQ==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/streams": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/streams": "~0.63.0"
       },
       "peerDependenciesMeta": {
         "@typespec/streams": {
@@ -1913,59 +1986,63 @@
       "link": true
     },
     "node_modules/@typespec/openapi": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.62.0.tgz",
-      "integrity": "sha512-Xtm0Nd2BuSmEfSWGtc10ok22jyomYm9L2jY+kVTy+v5J89DrVh0o6+YpipUl1QhcItM1YMBphWHIHPfwkDRbnw==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.63.0.tgz",
+      "integrity": "sha512-/KzR60mj3P/LnNWd/QfH0KTN/If4+mjrsWNSB7/uab6c8Qu/lNsGlZDkmWq4EFiwBR7VmpdFz9FP7d/m3O+tGw==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0"
       }
     },
     "node_modules/@typespec/rest": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz",
-      "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.63.0.tgz",
+      "integrity": "sha512-HftzMjSDHAYX+ILE9C6pFS4oAq7oBHMCtpA8QgSFPDF4V5a8l1k2K8c4x1B+7yl+GkREmIdtpc6S0xZm2G7hXg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0"
       }
     },
     "node_modules/@typespec/versioning": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz",
-      "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.63.0.tgz",
+      "integrity": "sha512-BPvmPL+g20yEmSA8XRfbIHdToNOjssq4QfwOU6D7kKLLXnZHFb1hmuwW0tf0Wa/lYgoaUC60ONAeoXgNT1ZOIQ==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0"
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@typespec/xml": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.62.0.tgz",
-      "integrity": "sha512-DexGTQHB75fncDcYfs5CIbNwO6NOhjwCaaNoHYAsVVzs4T8qwzw6WQdEEMzZRbgsxwnllFkxKwGhLtRMQdv/cQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.63.0.tgz",
+      "integrity": "sha512-2aQxWWqc5f4OTmC2nNafHi+ppr8GqwwMXx/2DnNjeshZF/JD0FNCYH8gV4gFZe7mfRfB9bAxNkcKj2AF01ntqA==",
+      "license": "MIT",
       "peer": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0"
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@vitest/coverage-v8": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.5.tgz",
-      "integrity": "sha512-/RoopB7XGW7UEkUndRXF87A9CwkoZAJW01pj8/3pgmDVsjMH2IKy6H1A38po9tmUlwhSyYs0az82rbKd9Yaynw==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-2.1.8.tgz",
+      "integrity": "sha512-2Y7BPlKH18mAZYAW1tYByudlCYrQyl5RGvnnDYJKW5tCiO5qg3KSAy3XAxcxKz900a0ZXxWtKrMuZLe3lKBpJw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -1986,8 +2063,8 @@
         "url": "https://opencollective.com/vitest"
       },
       "peerDependencies": {
-        "@vitest/browser": "2.1.5",
-        "vitest": "2.1.5"
+        "@vitest/browser": "2.1.8",
+        "vitest": "2.1.8"
       },
       "peerDependenciesMeta": {
         "@vitest/browser": {
@@ -1996,14 +2073,14 @@
       }
     },
     "node_modules/@vitest/expect": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.5.tgz",
-      "integrity": "sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz",
+      "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/spy": "2.1.5",
-        "@vitest/utils": "2.1.5",
+        "@vitest/spy": "2.1.8",
+        "@vitest/utils": "2.1.8",
         "chai": "^5.1.2",
         "tinyrainbow": "^1.2.0"
       },
@@ -2012,13 +2089,13 @@
       }
     },
     "node_modules/@vitest/mocker": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.5.tgz",
-      "integrity": "sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz",
+      "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/spy": "2.1.5",
+        "@vitest/spy": "2.1.8",
         "estree-walker": "^3.0.3",
         "magic-string": "^0.30.12"
       },
@@ -2039,9 +2116,9 @@
       }
     },
     "node_modules/@vitest/pretty-format": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.5.tgz",
-      "integrity": "sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz",
+      "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -2052,13 +2129,13 @@
       }
     },
     "node_modules/@vitest/runner": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.5.tgz",
-      "integrity": "sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz",
+      "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/utils": "2.1.5",
+        "@vitest/utils": "2.1.8",
         "pathe": "^1.1.2"
       },
       "funding": {
@@ -2066,13 +2143,13 @@
       }
     },
     "node_modules/@vitest/snapshot": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.5.tgz",
-      "integrity": "sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz",
+      "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/pretty-format": "2.1.5",
+        "@vitest/pretty-format": "2.1.8",
         "magic-string": "^0.30.12",
         "pathe": "^1.1.2"
       },
@@ -2081,9 +2158,9 @@
       }
     },
     "node_modules/@vitest/spy": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.5.tgz",
-      "integrity": "sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz",
+      "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -2094,13 +2171,13 @@
       }
     },
     "node_modules/@vitest/ui": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.5.tgz",
-      "integrity": "sha512-ERgKkDMTfngrZip6VG5h8L9B5D0AH/4+bga4yR1UzGH7c2cxv3LWogw2Dvuwr9cP3/iKDHYys7kIFLDKpxORTg==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/ui/-/ui-2.1.8.tgz",
+      "integrity": "sha512-5zPJ1fs0ixSVSs5+5V2XJjXLmNzjugHRyV11RqxYVR+oMcogZ9qTuSfKW+OcTV0JeFNznI83BNylzH6SSNJ1+w==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/utils": "2.1.5",
+        "@vitest/utils": "2.1.8",
         "fflate": "^0.8.2",
         "flatted": "^3.3.1",
         "pathe": "^1.1.2",
@@ -2112,17 +2189,17 @@
         "url": "https://opencollective.com/vitest"
       },
       "peerDependencies": {
-        "vitest": "2.1.5"
+        "vitest": "2.1.8"
       }
     },
     "node_modules/@vitest/utils": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.5.tgz",
-      "integrity": "sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz",
+      "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/pretty-format": "2.1.5",
+        "@vitest/pretty-format": "2.1.8",
         "loupe": "^3.1.2",
         "tinyrainbow": "^1.2.0"
       },
@@ -2160,6 +2237,7 @@
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz",
       "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "fast-deep-equal": "^3.1.1",
         "json-schema-traverse": "^1.0.0",
@@ -2176,6 +2254,7 @@
       "resolved": "https://registry.npmjs.org/ajv-draft-04/-/ajv-draft-04-1.0.0.tgz",
       "integrity": "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==",
       "dev": true,
+      "license": "MIT",
       "peerDependencies": {
         "ajv": "^8.5.0"
       },
@@ -2190,6 +2269,7 @@
       "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
       "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "ajv": "^8.0.0"
       },
@@ -2433,12 +2513,13 @@
       }
     },
     "node_modules/c8": {
-      "version": "10.1.2",
-      "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz",
-      "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==",
+      "version": "10.1.3",
+      "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz",
+      "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==",
       "dev": true,
+      "license": "ISC",
       "dependencies": {
-        "@bcoe/v8-coverage": "^0.2.3",
+        "@bcoe/v8-coverage": "^1.0.1",
         "@istanbuljs/schema": "^0.1.3",
         "find-up": "^5.0.0",
         "foreground-child": "^3.1.1",
@@ -2465,6 +2546,16 @@
         }
       }
     },
+    "node_modules/c8/node_modules/@bcoe/v8-coverage": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.1.tgz",
+      "integrity": "sha512-W+a0/JpU28AqH4IKtwUPcEUnUyXMDLALcn5/JLczGGT9fHE2sIby/xP/oQnx3nxkForzgzPy201RAKcB4xPAFQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      }
+    },
     "node_modules/cac": {
       "version": "6.7.14",
       "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz",
@@ -3018,10 +3109,11 @@
       }
     },
     "node_modules/express": {
-      "version": "4.21.1",
-      "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
-      "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
+      "version": "4.21.2",
+      "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
+      "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "accepts": "~1.3.8",
         "array-flatten": "1.1.1",
@@ -3042,7 +3134,7 @@
         "methods": "~1.1.2",
         "on-finished": "2.4.1",
         "parseurl": "~1.3.3",
-        "path-to-regexp": "0.1.10",
+        "path-to-regexp": "0.1.12",
         "proxy-addr": "~2.0.7",
         "qs": "6.13.0",
         "range-parser": "~1.2.1",
@@ -3057,6 +3149,10 @@
       },
       "engines": {
         "node": ">= 0.10.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
       }
     },
     "node_modules/express-promise-router": {
@@ -3260,9 +3356,9 @@
       }
     },
     "node_modules/flatted": {
-      "version": "3.3.1",
-      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
-      "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz",
+      "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==",
       "dev": true,
       "license": "ISC"
     },
@@ -3366,6 +3462,7 @@
       "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
       "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
       "dev": true,
+      "license": "MIT",
       "dependencies": {
         "graceful-fs": "^4.1.2",
         "jsonfile": "^4.0.0",
@@ -3458,6 +3555,26 @@
         "url": "https://github.com/sponsors/isaacs"
       }
     },
+    "node_modules/globby": {
+      "version": "14.0.2",
+      "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz",
+      "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==",
+      "license": "MIT",
+      "dependencies": {
+        "@sindresorhus/merge-streams": "^2.1.0",
+        "fast-glob": "^3.3.2",
+        "ignore": "^5.2.4",
+        "path-type": "^5.0.0",
+        "slash": "^5.1.0",
+        "unicorn-magic": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/gopd": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
@@ -3628,6 +3745,7 @@
       "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz",
       "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=8"
       }
@@ -4082,7 +4200,8 @@
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz",
       "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==",
-      "dev": true
+      "dev": true,
+      "license": "MIT"
     },
     "node_modules/js-tokens": {
       "version": "4.0.0",
@@ -4110,6 +4229,7 @@
       "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
       "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
       "dev": true,
+      "license": "MIT",
       "optionalDependencies": {
         "graceful-fs": "^4.1.6"
       }
@@ -4294,9 +4414,9 @@
       }
     },
     "node_modules/magic-string": {
-      "version": "0.30.12",
-      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz",
-      "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==",
+      "version": "0.30.15",
+      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.15.tgz",
+      "integrity": "sha512-zXeaYRgZ6ldS1RJJUrMrYgNJ4fdwnyI6tVqoiIhyCyv5IVTK9BU8Ic2l253GGETQHxI4HNUwhJ3fjDhKqEoaAw==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -4541,9 +4661,9 @@
       }
     },
     "node_modules/nanoid": {
-      "version": "3.3.7",
-      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
-      "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+      "version": "3.3.8",
+      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+      "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
       "dev": true,
       "funding": [
         {
@@ -4802,10 +4922,23 @@
       }
     },
     "node_modules/path-to-regexp": {
-      "version": "0.1.10",
-      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
-      "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==",
-      "dev": true
+      "version": "0.1.12",
+      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
+      "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/path-type": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
+      "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
     },
     "node_modules/pathe": {
       "version": "1.1.2",
@@ -4956,6 +5089,7 @@
       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
       "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=6"
       }
@@ -5133,9 +5267,9 @@
       }
     },
     "node_modules/rollup": {
-      "version": "4.26.0",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.26.0.tgz",
-      "integrity": "sha512-ilcl12hnWonG8f+NxU6BlgysVA0gvY2l8N0R84S1HcINbW20bvwuCngJkkInV6LXhwRpucsW5k1ovDwEdBVrNg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz",
+      "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -5149,24 +5283,25 @@
         "npm": ">=8.0.0"
       },
       "optionalDependencies": {
-        "@rollup/rollup-android-arm-eabi": "4.26.0",
-        "@rollup/rollup-android-arm64": "4.26.0",
-        "@rollup/rollup-darwin-arm64": "4.26.0",
-        "@rollup/rollup-darwin-x64": "4.26.0",
-        "@rollup/rollup-freebsd-arm64": "4.26.0",
-        "@rollup/rollup-freebsd-x64": "4.26.0",
-        "@rollup/rollup-linux-arm-gnueabihf": "4.26.0",
-        "@rollup/rollup-linux-arm-musleabihf": "4.26.0",
-        "@rollup/rollup-linux-arm64-gnu": "4.26.0",
-        "@rollup/rollup-linux-arm64-musl": "4.26.0",
-        "@rollup/rollup-linux-powerpc64le-gnu": "4.26.0",
-        "@rollup/rollup-linux-riscv64-gnu": "4.26.0",
-        "@rollup/rollup-linux-s390x-gnu": "4.26.0",
-        "@rollup/rollup-linux-x64-gnu": "4.26.0",
-        "@rollup/rollup-linux-x64-musl": "4.26.0",
-        "@rollup/rollup-win32-arm64-msvc": "4.26.0",
-        "@rollup/rollup-win32-ia32-msvc": "4.26.0",
-        "@rollup/rollup-win32-x64-msvc": "4.26.0",
+        "@rollup/rollup-android-arm-eabi": "4.28.1",
+        "@rollup/rollup-android-arm64": "4.28.1",
+        "@rollup/rollup-darwin-arm64": "4.28.1",
+        "@rollup/rollup-darwin-x64": "4.28.1",
+        "@rollup/rollup-freebsd-arm64": "4.28.1",
+        "@rollup/rollup-freebsd-x64": "4.28.1",
+        "@rollup/rollup-linux-arm-gnueabihf": "4.28.1",
+        "@rollup/rollup-linux-arm-musleabihf": "4.28.1",
+        "@rollup/rollup-linux-arm64-gnu": "4.28.1",
+        "@rollup/rollup-linux-arm64-musl": "4.28.1",
+        "@rollup/rollup-linux-loongarch64-gnu": "4.28.1",
+        "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1",
+        "@rollup/rollup-linux-riscv64-gnu": "4.28.1",
+        "@rollup/rollup-linux-s390x-gnu": "4.28.1",
+        "@rollup/rollup-linux-x64-gnu": "4.28.1",
+        "@rollup/rollup-linux-x64-musl": "4.28.1",
+        "@rollup/rollup-win32-arm64-msvc": "4.28.1",
+        "@rollup/rollup-win32-ia32-msvc": "4.28.1",
+        "@rollup/rollup-win32-x64-msvc": "4.28.1",
         "fsevents": "~2.3.2"
       }
     },
@@ -5432,6 +5567,18 @@
       "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
       "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="
     },
+    "node_modules/slash": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
+      "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
+      "license": "MIT",
+      "engines": {
+        "node": ">=14.16"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/source-map": {
       "version": "0.6.1",
       "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
@@ -5465,7 +5612,8 @@
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
       "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
-      "dev": true
+      "dev": true,
+      "license": "BSD-3-Clause"
     },
     "node_modules/stack-trace": {
       "version": "0.0.10",
@@ -5550,6 +5698,7 @@
       "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
       "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">=0.6.19"
       }
@@ -5809,9 +5958,9 @@
       }
     },
     "node_modules/tinypool": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz",
-      "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==",
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz",
+      "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==",
       "dev": true,
       "license": "MIT",
       "engines": {
@@ -5903,10 +6052,11 @@
       "dev": true
     },
     "node_modules/typescript": {
-      "version": "5.6.3",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
-      "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
+      "version": "5.7.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
+      "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
       "dev": true,
+      "license": "Apache-2.0",
       "bin": {
         "tsc": "bin/tsc",
         "tsserver": "bin/tsserver"
@@ -5916,10 +6066,11 @@
       }
     },
     "node_modules/undici-types": {
-      "version": "6.19.8",
-      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
-      "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
-      "dev": true
+      "version": "6.20.0",
+      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
+      "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
+      "dev": true,
+      "license": "MIT"
     },
     "node_modules/unicorn-magic": {
       "version": "0.1.0",
@@ -5937,6 +6088,7 @@
       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
       "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
       "dev": true,
+      "license": "MIT",
       "engines": {
         "node": ">= 4.0.0"
       }
@@ -5955,6 +6107,7 @@
       "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
       "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
       "dev": true,
+      "license": "BSD-2-Clause",
       "dependencies": {
         "punycode": "^2.1.0"
       }
@@ -6067,9 +6220,9 @@
       }
     },
     "node_modules/vite-node": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.5.tgz",
-      "integrity": "sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz",
+      "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
@@ -6090,19 +6243,19 @@
       }
     },
     "node_modules/vitest": {
-      "version": "2.1.5",
-      "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.5.tgz",
-      "integrity": "sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz",
+      "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "@vitest/expect": "2.1.5",
-        "@vitest/mocker": "2.1.5",
-        "@vitest/pretty-format": "^2.1.5",
-        "@vitest/runner": "2.1.5",
-        "@vitest/snapshot": "2.1.5",
-        "@vitest/spy": "2.1.5",
-        "@vitest/utils": "2.1.5",
+        "@vitest/expect": "2.1.8",
+        "@vitest/mocker": "2.1.8",
+        "@vitest/pretty-format": "^2.1.8",
+        "@vitest/runner": "2.1.8",
+        "@vitest/snapshot": "2.1.8",
+        "@vitest/spy": "2.1.8",
+        "@vitest/utils": "2.1.8",
         "chai": "^5.1.2",
         "debug": "^4.3.7",
         "expect-type": "^1.1.0",
@@ -6114,7 +6267,7 @@
         "tinypool": "^1.0.1",
         "tinyrainbow": "^1.2.0",
         "vite": "^5.0.0",
-        "vite-node": "2.1.5",
+        "vite-node": "2.1.8",
         "why-is-node-running": "^2.3.0"
       },
       "bin": {
@@ -6129,8 +6282,8 @@
       "peerDependencies": {
         "@edge-runtime/vm": "*",
         "@types/node": "^18.0.0 || >=20.0.0",
-        "@vitest/browser": "2.1.5",
-        "@vitest/ui": "2.1.5",
+        "@vitest/browser": "2.1.8",
+        "@vitest/ui": "2.1.8",
         "happy-dom": "*",
         "jsdom": "*"
       },
diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json
index db6dd58669..dafce26a16 100644
--- a/packages/http-client-java/package.json
+++ b/packages/http-client-java/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@typespec/http-client-java",
-  "version": "0.1.3",
+  "version": "0.1.4",
   "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
   "keywords": [
     "TypeSpec"
@@ -42,15 +42,15 @@
     "generator/http-client-generator/target/emitter.jar"
   ],
   "peerDependencies": {
-    "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
-    "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
-    "@azure-tools/typespec-client-generator-core": ">=0.48.4 <1.0.0",
-    "@typespec/compiler": ">=0.62.0 <1.0.0",
-    "@typespec/http": ">=0.62.0 <1.0.0",
-    "@typespec/openapi": ">=0.62.0 <1.0.0",
-    "@typespec/rest": ">=0.62.0 <1.0.0",
-    "@typespec/versioning": ">=0.62.0 <1.0.0",
-    "@typespec/xml": ">=0.62.0 <1.0.0"
+    "@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
+    "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
+    "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0",
+    "@typespec/compiler": ">=0.63.0 <1.0.0",
+    "@typespec/http": ">=0.63.0 <1.0.0",
+    "@typespec/openapi": ">=0.63.0 <1.0.0",
+    "@typespec/rest": ">=0.63.0 <1.0.0",
+    "@typespec/versioning": ">=0.63.0 <1.0.0",
+    "@typespec/xml": ">=0.63.0 <1.0.0"
   },
   "dependencies": {
     "@autorest/codemodel": "~4.20.0",
@@ -59,27 +59,27 @@
     "lodash": "~4.17.21"
   },
   "devDependencies": {
-    "@azure-tools/typespec-autorest": "0.48.0",
-    "@azure-tools/typespec-azure-core": "0.48.0",
-    "@azure-tools/typespec-azure-resource-manager": "0.48.0",
-    "@azure-tools/typespec-azure-rulesets": "0.48.0",
-    "@azure-tools/typespec-client-generator-core": "0.48.4",
-    "@microsoft/api-extractor": "^7.47.11",
-    "@microsoft/api-extractor-model": "^7.29.8",
+    "@azure-tools/typespec-autorest": "0.49.0",
+    "@azure-tools/typespec-azure-core": "0.49.0",
+    "@azure-tools/typespec-azure-resource-manager": "0.49.0",
+    "@azure-tools/typespec-azure-rulesets": "0.49.0",
+    "@azure-tools/typespec-client-generator-core": "0.49.0",
+    "@microsoft/api-extractor": "^7.48.0",
+    "@microsoft/api-extractor-model": "^7.30.0",
     "@types/js-yaml": "~4.0.9",
     "@types/lodash": "~4.17.13",
-    "@types/node": "~22.9.0",
-    "@typespec/compiler": "0.62.0",
-    "@typespec/http": "0.62.0",
-    "@typespec/openapi": "0.62.0",
-    "@typespec/rest": "0.62.0",
-    "@typespec/versioning": "0.62.0",
-    "@vitest/coverage-v8": "^2.1.5",
-    "@vitest/ui": "^2.1.5",
-    "c8": "~10.1.2",
+    "@types/node": "~22.10.1",
+    "@typespec/compiler": "0.63.0",
+    "@typespec/http": "0.63.0",
+    "@typespec/openapi": "0.63.0",
+    "@typespec/rest": "0.63.0",
+    "@typespec/versioning": "0.63.0",
+    "@vitest/coverage-v8": "^2.1.8",
+    "@vitest/ui": "^2.1.8",
+    "c8": "~10.1.3",
     "rimraf": "~6.0.1",
-    "typescript": "~5.6.3",
-    "vitest": "^2.1.5",
+    "typescript": "~5.7.2",
+    "vitest": "^2.1.8",
     "@azure-tools/cadl-ranch": "0.16.1"
   }
 }

From 306a70daf968253884ac29b5d779ed3b58481459 Mon Sep 17 00:00:00 2001
From: Praven Kuttappan <55455725+praveenkuttappan@users.noreply.github.com>
Date: Wed, 11 Dec 2024 12:15:45 -0500
Subject: [PATCH 51/71] Update JS API parser to install from local feed (#5285)

Install JS API parser from local feed to avoid checking upstream for
latest version
---
 eng/emitters/scripts/Generate-APIView-CodeFile.ps1 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eng/emitters/scripts/Generate-APIView-CodeFile.ps1 b/eng/emitters/scripts/Generate-APIView-CodeFile.ps1
index bc88e45ca7..15a6f28564 100644
--- a/eng/emitters/scripts/Generate-APIView-CodeFile.ps1
+++ b/eng/emitters/scripts/Generate-APIView-CodeFile.ps1
@@ -1,7 +1,7 @@
 param (
   [Parameter(mandatory = $true)]
   $ArtifactPath,
-  $NpmDevopsFeedRegistry = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js/npm/registry/"
+  $NpmDevopsFeedRegistry = "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-js@Local/npm/registry/"
 )
 
 Set-StrictMode -Version 3

From 5383844e33cb3d96569997fe62045b623478c1e6 Mon Sep 17 00:00:00 2001
From: Jorge Rangel <102122018+jorgerangel-msft@users.noreply.github.com>
Date: Wed, 11 Dec 2024 12:24:00 -0600
Subject: [PATCH 52/71] [http-client-csharp] fix: enable cadl ranch coverage
 for srvdriven test (#5335)

This PR fixes some issues in the cadl ranch scripts that were preventing
the coverage to be calculated for the `resiliency/service-driven`
client.
---
 .../http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 | 4 ----
 .../Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs          | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1 b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1
index ff668da5aa..6e1c723ba0 100644
--- a/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1
+++ b/packages/http-client-csharp/eng/scripts/Get-CadlRanch-Coverage.ps1
@@ -27,10 +27,6 @@ foreach ($directory in $directories) {
     $outputDir = $directory.FullName.Substring(0, $directory.FullName.IndexOf("src") - 1)
     $subPath = $outputDir.Substring($cadlRanchRoot.Length + 1)
 
-    if ($subPath.Contains($(Join-Path 'srv-driven' 'v1'))) {
-        continue
-    }
-
     Write-Host "Regenerating $subPath" -ForegroundColor Cyan
 
     $specFile = Join-Path $specsDirectory $subPath "client.tsp"
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs
index dd321081b3..92359de9ca 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Resiliency/SrvDriven/V1/SrvDrivenV1Tests.cs
@@ -10,7 +10,7 @@ namespace TestProjects.CadlRanch.Tests.Http.Resiliency.SrvDriven.V1
     /// 
     /// Contains tests for the service-driven resiliency V1 client.
     /// 
-    public partial class SrvDrivenV2Tests : CadlRanchTestBase
+    public partial class SrvDrivenV1Tests : CadlRanchTestBase
     {
         private const string ServiceDeploymentV1 = "v1";
         private const string ServiceDeploymentV2 = "v2";

From 530c657fb92d2a297188efc937affa41cbe5db56 Mon Sep 17 00:00:00 2001
From: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
Date: Wed, 11 Dec 2024 14:28:05 -0800
Subject: [PATCH 53/71] Add cancellation token parameter to sync convenience
 methods (#5337)

Previously, only async convenience methods had cancellation tokens, but
the guideline is that both sync and async methods should have
cancellation tokens.
---
 .../Providers/ScmMethodProviderCollection.cs  | 15 ++--
 .../ClientProviderCustomizationTests.cs       |  4 +-
 .../ClientProviders/ClientProviderTests.cs    |  2 +-
 .../CanReplaceStructMethod.cs                 |  2 +-
 .../CanReplaceStructMethod.cs                 |  2 +-
 .../ValidateQueryParamWriterDiff(False).cs    |  6 +-
 .../ScmMethodProviderCollectionTests.cs       | 18 ++++-
 .../Http/Parameters/Spread/SpreadTests.cs     |  7 +-
 .../api-key/src/Generated/ApiKeyClient.cs     |  4 +-
 .../http/custom/src/Generated/CustomClient.cs |  4 +-
 .../oauth2/src/Generated/OAuth2Client.cs      |  4 +-
 .../union/src/Generated/UnionClient.cs        |  4 +-
 .../naming/src/Generated/ClientModel.cs       |  4 +-
 .../naming/src/Generated/NamingClient.cs      | 14 ++--
 .../client/naming/src/Generated/UnionEnum.cs  |  4 +-
 .../src/Generated/FirstClient.cs              |  2 +-
 .../src/Generated/Group3.cs                   |  4 +-
 .../src/Generated/Group4.cs                   |  2 +-
 .../src/Generated/Group5.cs                   |  2 +-
 .../src/Generated/SubNamespaceSecondClient.cs |  2 +-
 .../structure/default/src/Generated/Bar.cs    |  4 +-
 .../structure/default/src/Generated/BazFoo.cs |  2 +-
 .../structure/default/src/Generated/Foo.cs    |  4 +-
 .../structure/default/src/Generated/Qux.cs    |  2 +-
 .../structure/default/src/Generated/QuxBar.cs |  2 +-
 .../default/src/Generated/ServiceClient.cs    |  4 +-
 .../src/Generated/ClientAClient.cs            |  6 +-
 .../src/Generated/ClientBClient.cs            |  6 +-
 .../renamed-operation/src/Generated/Group.cs  |  6 +-
 .../src/Generated/RenamedOperationClient.cs   |  6 +-
 .../src/Generated/Group1.cs                   |  6 +-
 .../src/Generated/Group2.cs                   |  6 +-
 .../http/encode/bytes/src/Generated/Header.cs |  8 +-
 .../encode/bytes/src/Generated/Property.cs    |  8 +-
 .../http/encode/bytes/src/Generated/Query.cs  |  8 +-
 .../encode/bytes/src/Generated/RequestBody.cs | 10 +--
 .../bytes/src/Generated/ResponseBody.cs       | 10 +--
 .../encode/datetime/src/Generated/Header.cs   | 10 +--
 .../encode/datetime/src/Generated/Property.cs | 10 +--
 .../encode/datetime/src/Generated/Query.cs    | 10 +--
 .../datetime/src/Generated/ResponseHeader.cs  |  8 +-
 .../encode/duration/src/Generated/Header.cs   | 12 +--
 .../encode/duration/src/Generated/Property.cs | 12 +--
 .../encode/duration/src/Generated/Query.cs    | 12 +--
 .../encode/numeric/src/Generated/Property.cs  |  6 +-
 .../basic/src/Generated/ExplicitBody.cs       |  2 +-
 .../basic/src/Generated/ImplicitBody.cs       |  2 +-
 .../src/Generated/BodyOptionalityClient.cs    |  4 +-
 .../src/Generated/OptionalExplicit.cs         |  4 +-
 .../collection-format/src/Generated/Header.cs |  2 +-
 .../collection-format/src/Generated/Query.cs  | 10 +--
 .../parameters/spread/src/Generated/Alias.cs  | 10 +--
 .../parameters/spread/src/Generated/Model.cs  | 10 +--
 .../src/Generated/DifferentBody.cs            |  4 +-
 .../src/Generated/SameBody.cs                 |  4 +-
 .../src/Generated/JsonMergePatchClient.cs     |  2 +-
 .../media-type/src/Generated/StringBody.cs    |  8 +-
 .../ResiliencyServiceDrivenClient.cs          |  6 +-
 .../ResiliencyServiceDrivenClient.cs          |  8 +-
 .../http/routes/src/Generated/InInterface.cs  |  2 +-
 .../routes/src/Generated/PathParameters.cs    |  6 +-
 .../PathParametersLabelExpansionExplode.cs    |  6 +-
 .../PathParametersLabelExpansionStandard.cs   |  6 +-
 .../PathParametersMatrixExpansionExplode.cs   |  6 +-
 .../PathParametersMatrixExpansionStandard.cs  |  6 +-
 .../PathParametersPathExpansionExplode.cs     |  6 +-
 .../PathParametersPathExpansionStandard.cs    |  6 +-
 .../PathParametersReservedExpansion.cs        |  4 +-
 .../PathParametersSimpleExpansionExplode.cs   |  6 +-
 .../PathParametersSimpleExpansionStandard.cs  |  6 +-
 .../routes/src/Generated/QueryParameters.cs   |  6 +-
 ...QueryParametersQueryContinuationExplode.cs |  6 +-
 ...ueryParametersQueryContinuationStandard.cs |  6 +-
 .../QueryParametersQueryExpansionExplode.cs   |  6 +-
 .../QueryParametersQueryExpansionStandard.cs  |  6 +-
 .../http/routes/src/Generated/RoutesClient.cs |  2 +-
 .../json/src/Generated/Property.cs            |  4 +-
 .../src/Generated/NotDefinedClient.cs         |  2 +-
 .../multiple/src/Generated/MultipleClient.cs  |  4 +-
 .../path/single/src/Generated/SingleClient.cs |  2 +-
 .../src/Generated/NotVersionedClient.cs       |  6 +-
 .../src/Generated/VersionedClient.cs          |  8 +-
 .../src/Generated/RepeatabilityClient.cs      |  2 +-
 .../src/Generated/ModelProperties.cs          |  2 +-
 .../special-words/src/Generated/ModelsOps.cs  | 66 +++++++--------
 .../special-words/src/Generated/Operations.cs | 66 +++++++--------
 .../special-words/src/Generated/Parameters.cs | 68 ++++++++--------
 .../type/array/src/Generated/BooleanValue.cs  |  4 +-
 .../type/array/src/Generated/DatetimeValue.cs |  4 +-
 .../type/array/src/Generated/DurationValue.cs |  4 +-
 .../type/array/src/Generated/Float32Value.cs  |  4 +-
 .../type/array/src/Generated/Int32Value.cs    |  4 +-
 .../type/array/src/Generated/Int64Value.cs    |  4 +-
 .../type/array/src/Generated/ModelValue.cs    |  4 +-
 .../src/Generated/NullableBooleanValue.cs     |  4 +-
 .../array/src/Generated/NullableFloatValue.cs |  4 +-
 .../array/src/Generated/NullableInt32Value.cs |  4 +-
 .../array/src/Generated/NullableModelValue.cs |  4 +-
 .../src/Generated/NullableStringValue.cs      |  4 +-
 .../type/array/src/Generated/StringValue.cs   |  4 +-
 .../type/array/src/Generated/UnknownValue.cs  |  4 +-
 .../dictionary/src/Generated/BooleanValue.cs  |  4 +-
 .../dictionary/src/Generated/DatetimeValue.cs |  4 +-
 .../dictionary/src/Generated/DurationValue.cs |  4 +-
 .../dictionary/src/Generated/Float32Value.cs  |  4 +-
 .../dictionary/src/Generated/Int32Value.cs    |  4 +-
 .../dictionary/src/Generated/Int64Value.cs    |  4 +-
 .../dictionary/src/Generated/ModelValue.cs    |  4 +-
 .../src/Generated/NullableFloatValue.cs       |  4 +-
 .../src/Generated/RecursiveModelValue.cs      |  4 +-
 .../dictionary/src/Generated/StringValue.cs   |  4 +-
 .../dictionary/src/Generated/UnknownValue.cs  |  4 +-
 .../enum/extensible/src/Generated/String.cs   |  8 +-
 .../type/enum/fixed/src/Generated/String.cs   |  6 +-
 .../model/empty/src/Generated/EmptyClient.cs  |  6 +-
 .../src/Generated/EnumDiscriminatorClient.cs  | 16 ++--
 .../Generated/NestedDiscriminatorClient.cs    | 12 +--
 .../src/Generated/NotDiscriminatedClient.cs   |  6 +-
 .../src/Generated/RecursiveClient.cs          |  4 +-
 .../Generated/SingleDiscriminatorClient.cs    | 14 ++--
 .../model/usage/src/Generated/UsageClient.cs  |  6 +-
 .../src/Generated/VisibilityClient.cs         | 12 +--
 .../Generated/ExtendsDifferentSpreadFloat.cs  |  4 +-
 .../Generated/ExtendsDifferentSpreadModel.cs  |  4 +-
 .../ExtendsDifferentSpreadModelArray.cs       |  4 +-
 .../Generated/ExtendsDifferentSpreadString.cs |  4 +-
 .../src/Generated/ExtendsFloat.cs             |  4 +-
 .../src/Generated/ExtendsModel.cs             |  4 +-
 .../src/Generated/ExtendsModelArray.cs        |  4 +-
 .../src/Generated/ExtendsString.cs            |  4 +-
 .../src/Generated/ExtendsUnknown.cs           |  4 +-
 .../src/Generated/ExtendsUnknownDerived.cs    |  4 +-
 .../Generated/ExtendsUnknownDiscriminated.cs  |  4 +-
 .../src/Generated/IsFloat.cs                  |  4 +-
 .../src/Generated/IsModel.cs                  |  4 +-
 .../src/Generated/IsModelArray.cs             |  4 +-
 .../src/Generated/IsString.cs                 |  4 +-
 .../src/Generated/IsUnknown.cs                |  4 +-
 .../src/Generated/IsUnknownDerived.cs         |  4 +-
 .../src/Generated/IsUnknownDiscriminated.cs   |  4 +-
 .../src/Generated/MultipleSpread.cs           |  4 +-
 .../src/Generated/SpreadDifferentFloat.cs     |  4 +-
 .../src/Generated/SpreadDifferentModel.cs     |  4 +-
 .../Generated/SpreadDifferentModelArray.cs    |  4 +-
 .../src/Generated/SpreadDifferentString.cs    |  4 +-
 .../src/Generated/SpreadFloat.cs              |  4 +-
 .../src/Generated/SpreadModel.cs              |  4 +-
 .../src/Generated/SpreadModelArray.cs         |  4 +-
 .../SpreadRecordDiscriminatedUnion.cs         |  4 +-
 .../SpreadRecordNonDiscriminatedUnion.cs      |  4 +-
 .../SpreadRecordNonDiscriminatedUnion2.cs     |  4 +-
 .../SpreadRecordNonDiscriminatedUnion3.cs     |  4 +-
 .../src/Generated/SpreadRecordUnion.cs        |  4 +-
 .../src/Generated/SpreadString.cs             |  4 +-
 .../property/nullable/src/Generated/Bytes.cs  |  4 +-
 .../nullable/src/Generated/CollectionsByte.cs |  4 +-
 .../src/Generated/CollectionsModel.cs         |  4 +-
 .../src/Generated/CollectionsString.cs        |  4 +-
 .../nullable/src/Generated/Datetime.cs        |  4 +-
 .../nullable/src/Generated/Duration.cs        |  4 +-
 .../property/nullable/src/Generated/String.cs |  4 +-
 .../src/Generated/BooleanLiteral.cs           |  8 +-
 .../optionality/src/Generated/Bytes.cs        |  8 +-
 .../src/Generated/CollectionsByte.cs          |  8 +-
 .../src/Generated/CollectionsModel.cs         |  8 +-
 .../optionality/src/Generated/Datetime.cs     |  8 +-
 .../optionality/src/Generated/Duration.cs     |  8 +-
 .../optionality/src/Generated/FloatLiteral.cs |  8 +-
 .../optionality/src/Generated/IntLiteral.cs   |  8 +-
 .../optionality/src/Generated/PlainDate.cs    |  8 +-
 .../optionality/src/Generated/PlainTime.cs    |  8 +-
 .../src/Generated/RequiredAndOptional.cs      |  8 +-
 .../optionality/src/Generated/String.cs       |  8 +-
 .../src/Generated/StringLiteral.cs            |  8 +-
 .../src/Generated/UnionFloatLiteral.cs        |  8 +-
 .../src/Generated/UnionIntLiteral.cs          |  8 +-
 .../src/Generated/UnionStringLiteral.cs       |  8 +-
 .../value-types/src/Generated/Boolean.cs      |  4 +-
 .../src/Generated/BooleanLiteral.cs           |  4 +-
 .../value-types/src/Generated/Bytes.cs        |  4 +-
 .../src/Generated/CollectionsInt.cs           |  4 +-
 .../src/Generated/CollectionsModel.cs         |  4 +-
 .../src/Generated/CollectionsString.cs        |  4 +-
 .../value-types/src/Generated/Datetime.cs     |  4 +-
 .../value-types/src/Generated/Decimal.cs      |  4 +-
 .../value-types/src/Generated/Decimal128.cs   |  4 +-
 .../src/Generated/DictionaryString.cs         |  4 +-
 .../value-types/src/Generated/Duration.cs     |  4 +-
 .../value-types/src/Generated/Enum.cs         |  4 +-
 .../src/Generated/ExtensibleEnum.cs           |  4 +-
 .../value-types/src/Generated/Float.cs        |  4 +-
 .../value-types/src/Generated/FloatLiteral.cs |  4 +-
 .../property/value-types/src/Generated/Int.cs |  4 +-
 .../value-types/src/Generated/IntLiteral.cs   |  4 +-
 .../value-types/src/Generated/Model.cs        |  4 +-
 .../value-types/src/Generated/Never.cs        |  4 +-
 .../value-types/src/Generated/String.cs       |  4 +-
 .../src/Generated/StringLiteral.cs            |  4 +-
 .../src/Generated/UnionEnumValue.cs           |  4 +-
 .../src/Generated/UnionFloatLiteral.cs        |  4 +-
 .../src/Generated/UnionIntLiteral.cs          |  4 +-
 .../src/Generated/UnionStringLiteral.cs       |  4 +-
 .../value-types/src/Generated/UnknownArray.cs |  4 +-
 .../value-types/src/Generated/UnknownDict.cs  |  4 +-
 .../value-types/src/Generated/UnknownInt.cs   |  4 +-
 .../src/Generated/UnknownString.cs            |  4 +-
 .../http/type/scalar/src/Generated/Boolean.cs |  4 +-
 .../scalar/src/Generated/Decimal128Type.cs    |  6 +-
 .../scalar/src/Generated/Decimal128Verify.cs  |  4 +-
 .../type/scalar/src/Generated/DecimalType.cs  |  6 +-
 .../scalar/src/Generated/DecimalVerify.cs     |  4 +-
 .../http/type/scalar/src/Generated/String.cs  |  4 +-
 .../http/type/scalar/src/Generated/Unknown.cs |  4 +-
 .../type/union/src/Generated/EnumsOnly.cs     |  4 +-
 .../type/union/src/Generated/FloatsOnly.cs    |  4 +-
 .../http/type/union/src/Generated/IntsOnly.cs |  4 +-
 .../type/union/src/Generated/MixedLiterals.cs |  4 +-
 .../type/union/src/Generated/MixedTypes.cs    |  4 +-
 .../type/union/src/Generated/ModelsOnly.cs    |  4 +-
 .../union/src/Generated/StringAndArray.cs     |  4 +-
 .../union/src/Generated/StringExtensible.cs   |  4 +-
 .../src/Generated/StringExtensibleNamed.cs    |  4 +-
 .../type/union/src/Generated/StringsOnly.cs   |  4 +-
 .../added/v1/src/Generated/AddedClient.cs     |  2 +-
 .../added/v2/src/Generated/AddedClient.cs     |  4 +-
 .../added/v2/src/Generated/InterfaceV2.cs     |  2 +-
 .../v1/src/Generated/MadeOptionalClient.cs    |  2 +-
 .../v2/src/Generated/MadeOptionalClient.cs    |  2 +-
 .../removed/v1/src/Generated/InterfaceV1.cs   |  2 +-
 .../removed/v1/src/Generated/RemovedClient.cs |  6 +-
 .../removed/v2/src/Generated/RemovedClient.cs |  4 +-
 .../v2Preview/src/Generated/InterfaceV1.cs    |  2 +-
 .../v2Preview/src/Generated/RemovedClient.cs  |  6 +-
 .../v1/src/Generated/OldInterface.cs          |  2 +-
 .../v1/src/Generated/RenamedFromClient.cs     |  2 +-
 .../v2/src/Generated/NewInterface.cs          |  2 +-
 .../v2/src/Generated/RenamedFromClient.cs     |  2 +-
 .../Generated/ReturnTypeChangedFromClient.cs  |  2 +-
 .../Generated/ReturnTypeChangedFromClient.cs  |  2 +-
 .../v1/src/Generated/TypeChangedFromClient.cs |  2 +-
 .../v2/src/Generated/TypeChangedFromClient.cs |  2 +-
 .../src/Generated/UnbrandedTypeSpecClient.cs  | 80 +++++++++++--------
 242 files changed, 750 insertions(+), 722 deletions(-)

diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ScmMethodProviderCollection.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ScmMethodProviderCollection.cs
index 5386c7e070..9d15700917 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ScmMethodProviderCollection.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ScmMethodProviderCollection.cs
@@ -75,7 +75,7 @@ private ScmMethodProvider BuildConvenienceMethod(MethodProvider protocolMethod,
                 methodModifier,
                 GetResponseType(Operation.Responses, true, isAsync, out var responseBodyType),
                 null,
-                isAsync ? [.. ConvenienceMethodParameters, ScmKnownParameters.CancellationToken] : ConvenienceMethodParameters);
+                [.. ConvenienceMethodParameters, ScmKnownParameters.CancellationToken]);
 
             MethodBodyStatement[] methodBody;
 
@@ -84,7 +84,7 @@ private ScmMethodProvider BuildConvenienceMethod(MethodProvider protocolMethod,
                 methodBody =
                 [
                     .. GetStackVariablesForProtocolParamConversion(ConvenienceMethodParameters, out var declarations),
-                    Return(This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(ConvenienceMethodParameters, declarations, isAsync)], isAsync))
+                    Return(This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(ConvenienceMethodParameters, declarations)], isAsync))
                 ];
             }
             else
@@ -92,7 +92,7 @@ .. GetStackVariablesForProtocolParamConversion(ConvenienceMethodParameters, out
                 methodBody =
                 [
                     .. GetStackVariablesForProtocolParamConversion(ConvenienceMethodParameters, out var paramDeclarations),
-                    Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(ConvenienceMethodParameters, paramDeclarations, isAsync)], isAsync).ToApi(), out ClientResponseApi result),
+                    Declare("result", This.Invoke(protocolMethod.Signature, [.. GetProtocolMethodArguments(ConvenienceMethodParameters, paramDeclarations)], isAsync).ToApi(), out ClientResponseApi result),
                     .. GetStackVariablesForReturnValueConversion(result, responseBodyType, isAsync, out var resultDeclarations),
                     Return(result.FromValue(GetResultConversion(result, result.GetRawResponse(), responseBodyType, resultDeclarations), result.GetRawResponse())),
                 ];
@@ -314,8 +314,7 @@ private ValueExpression GetResultConversion(ClientResponseApi result, HttpRespon
 
         private IReadOnlyList GetProtocolMethodArguments(
             IReadOnlyList convenienceMethodParameters,
-            Dictionary declarations,
-            bool isAsync)
+            Dictionary declarations)
         {
             List conversions = new List();
             bool addedSpreadSource = false;
@@ -362,12 +361,10 @@ private IReadOnlyList GetProtocolMethodArguments(
                     conversions.Add(param);
                 }
             }
+
             // RequestOptions argument
+            conversions.Add(IHttpRequestOptionsApiSnippets.FromCancellationToken(ScmKnownParameters.CancellationToken));
 
-            conversions.Add(
-                isAsync
-                    ? IHttpRequestOptionsApiSnippets.FromCancellationToken(ScmKnownParameters.CancellationToken)
-                    : ScmKnownParameters.RequestOptions.PositionalReference(Null));
             return conversions;
         }
 
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs
index b8783a6c1f..c4200d86cd 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderCustomizationTests.cs
@@ -102,7 +102,7 @@ public async Task CanAddMethodSameName()
             var helloAgainMethod = clientProviderMethods.FirstOrDefault(m
                 => m.Signature.Name == "HelloAgain" && m.Signature.Parameters.Count > 0 && m.Signature.Parameters[0].Name == "p1");
             Assert.IsNotNull(helloAgainMethod);
-            Assert.AreEqual(1, helloAgainMethod!.Signature.Parameters.Count);
+            Assert.AreEqual(2, helloAgainMethod!.Signature.Parameters.Count);
 
             // The custom code view should contain the method
             var customCodeView = clientProvider.CustomCodeView;
@@ -187,7 +187,7 @@ public async Task CanReplaceStructMethod(bool isStructCustomized)
             Assert.AreEqual("HelloAgain", customMethods[0].Signature.Name);
 
             var customMethodParams = customMethods[0].Signature.Parameters;
-            Assert.AreEqual(1, customMethodParams.Count);
+            Assert.AreEqual(2, customMethodParams.Count);
             Assert.AreEqual("p1", customMethodParams[0].Name);
             Assert.AreEqual("MyStruct", customMethodParams[0].Type.Name);
             Assert.AreEqual(isStructCustomized ? "Sample.TestClient" : string.Empty, customMethodParams[0].Type.Namespace);
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs
index cd6d805f74..86c646ea64 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs
@@ -422,7 +422,7 @@ public void ValidateClientWithSpread(InputClient inputClient)
 
             var convenienceMethods = methods.Where(m => m.Signature.Parameters.Any(p => p.Type.Equals(typeof(string)))).ToList();
             Assert.AreEqual(2, convenienceMethods.Count);
-            Assert.AreEqual(1, convenienceMethods[0].Signature.Parameters.Count);
+            Assert.AreEqual(2, convenienceMethods[0].Signature.Parameters.Count);
 
             Assert.AreEqual(new CSharpType(typeof(string)), convenienceMethods[0].Signature.Parameters[0].Type);
             Assert.AreEqual("p1", convenienceMethods[0].Signature.Parameters[0].Name);
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(False)/CanReplaceStructMethod.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(False)/CanReplaceStructMethod.cs
index 7920183098..ba2608531f 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(False)/CanReplaceStructMethod.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(False)/CanReplaceStructMethod.cs
@@ -11,7 +11,7 @@ namespace Sample
     /// 
     public partial class TestClient
     {
-        public virtual ClientResult HelloAgain(MyStruct? p1)
+        public virtual ClientResult HelloAgain(MyStruct? p1, CancellationToken cancellationToken = default)
         {
 
         }
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(True)/CanReplaceStructMethod.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(True)/CanReplaceStructMethod.cs
index cc6387df2e..14e7bfbf1e 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(True)/CanReplaceStructMethod.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderCustomizationTests/CanReplaceStructMethod(True)/CanReplaceStructMethod.cs
@@ -11,7 +11,7 @@ namespace Sample
     /// 
     public partial class TestClient
     {
-        public virtual ClientResult HelloAgain(MyStruct? p1)
+        public virtual ClientResult HelloAgain(MyStruct? p1, CancellationToken cancellationToken = default)
         {
 
         }
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateQueryParamWriterDiff(False).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateQueryParamWriterDiff(False).cs
index 70d38a0816..594dd3d162 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateQueryParamWriterDiff(False).cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/ValidateQueryParamWriterDiff(False).cs
@@ -3,6 +3,8 @@
 #nullable disable
 
 using System.ClientModel;
+using System.ClientModel.Primitives;
+using System.Threading;
 using Sample.Models;
 
 namespace Sample
@@ -10,9 +12,9 @@ namespace Sample
     /// 
     public partial class TestClient
     {
-        public virtual global::System.ClientModel.ClientResult Operation(global::Sample.Models.InputEnum queryParam)
+        public virtual global::System.ClientModel.ClientResult Operation(global::Sample.Models.InputEnum queryParam, global::System.Threading.CancellationToken cancellationToken = default)
         {
-            return this.Operation(queryParam.ToString(), options: null);
+            return this.Operation(queryParam.ToString(), cancellationToken.CanBeCanceled ? new global::System.ClientModel.Primitives.RequestOptions { CancellationToken = cancellationToken } : null);
         }
     }
 }
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs
index 1a120915a2..70d83bd896 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs
@@ -57,14 +57,15 @@ public void TestDefaultCSharpMethodCollection(InputOperation inputOperation)
             if (spreadInputParameter != null)
             {
                 var spreadModelProperties = _spreadModel.Properties;
-                Assert.AreEqual(spreadModelProperties.Count + 1, convenienceMethodParams.Count);
+                // model properties + 2 (parameter and cancellation token)
+                Assert.AreEqual(spreadModelProperties.Count + 2, convenienceMethodParams.Count);
                 Assert.AreEqual("p1", convenienceMethodParams[0].Name);
                 Assert.AreEqual(spreadModelProperties[0].Name, convenienceMethodParams[1].Name);
             }
         }
 
         [TestCaseSource(nameof(DefaultCSharpMethodCollectionTestCases))]
-        public void AsyncMethodsHaveOptionalCancellationToken(InputOperation inputOperation)
+        public void ConvenienceMethodsHaveOptionalCancellationToken(InputOperation inputOperation)
         {
             var inputClient = InputFactory.Client("TestClient", operations: [inputOperation]);
 
@@ -87,6 +88,19 @@ public void AsyncMethodsHaveOptionalCancellationToken(InputOperation inputOperat
             Assert.IsTrue(lastParameter.Type.Equals(typeof(CancellationToken)));
             Assert.IsFalse(lastParameter.Type.IsNullable);
             Assert.AreEqual(Snippet.Default, lastParameter.DefaultValue);
+
+            var syncConvenienceMethod = methodCollection.FirstOrDefault(m
+                => !m.Signature.Parameters.Any(p => p.Name == "content")
+                   && m.Signature.Name == inputOperation.Name.ToCleanName());
+            Assert.IsNotNull(syncConvenienceMethod);
+
+            var syncConvenienceMethodParameters = syncConvenienceMethod!.Signature.Parameters;
+            Assert.IsNotNull(syncConvenienceMethodParameters);
+
+            lastParameter = syncConvenienceMethodParameters.Last();
+            Assert.IsTrue(lastParameter.Type.Equals(typeof(CancellationToken)));
+            Assert.IsFalse(lastParameter.Type.IsNullable);
+            Assert.AreEqual(Snippet.Default, lastParameter.DefaultValue);
         }
 
         public static IEnumerable DefaultCSharpMethodCollectionTestCases
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Parameters/Spread/SpreadTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Parameters/Spread/SpreadTests.cs
index 10b0f72bb6..011fb1f231 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Parameters/Spread/SpreadTests.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Parameters/Spread/SpreadTests.cs
@@ -154,10 +154,9 @@ private static void ValidateConvenienceMethodParameters(MethodInfo method, IEnum
         {
             if (IsProtocolMethod(method))
                 return;
-            if (method.Name.EndsWith("Async"))
-            {
-                expected = expected.Append((typeof(CancellationToken), "cancellationToken", false));
-            }
+
+            expected = expected.Append((typeof(CancellationToken), "cancellationToken", false));
+
             var parameters = method.GetParameters().Where(p => !p.ParameterType.Equals(typeof(RequestOptions)));
             var parameterTypes = parameters.Select(p => p.ParameterType);
             var parameterNames = parameters.Select(p => p.Name);
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/src/Generated/ApiKeyClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/src/Generated/ApiKeyClient.cs
index b603bd7c8e..1734147bbe 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/src/Generated/ApiKeyClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/api-key/src/Generated/ApiKeyClient.cs
@@ -24,7 +24,7 @@ public partial class ApiKeyClient
 
         public virtual Task ValidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Valid() => throw null;
+        public virtual ClientResult Valid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class ApiKeyClient
 
         public virtual Task InvalidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Invalid() => throw null;
+        public virtual ClientResult Invalid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/src/Generated/CustomClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/src/Generated/CustomClient.cs
index 68ff6b795d..18db40d8e7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/src/Generated/CustomClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/http/custom/src/Generated/CustomClient.cs
@@ -24,7 +24,7 @@ public partial class CustomClient
 
         public virtual Task ValidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Valid() => throw null;
+        public virtual ClientResult Valid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class CustomClient
 
         public virtual Task InvalidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Invalid() => throw null;
+        public virtual ClientResult Invalid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/src/Generated/OAuth2Client.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/src/Generated/OAuth2Client.cs
index ebeacd6ad6..6e31c0b88e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/src/Generated/OAuth2Client.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/oauth2/src/Generated/OAuth2Client.cs
@@ -22,7 +22,7 @@ public partial class OAuth2Client
 
         public virtual Task ValidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Valid() => throw null;
+        public virtual ClientResult Valid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -30,7 +30,7 @@ public partial class OAuth2Client
 
         public virtual Task InvalidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Invalid() => throw null;
+        public virtual ClientResult Invalid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task InvalidAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/union/src/Generated/UnionClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/union/src/Generated/UnionClient.cs
index ca3b150f0c..d1eba3a52a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/union/src/Generated/UnionClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/authentication/union/src/Generated/UnionClient.cs
@@ -24,7 +24,7 @@ public partial class UnionClient
 
         public virtual Task ValidKeyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ValidKey() => throw null;
+        public virtual ClientResult ValidKey(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidKeyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class UnionClient
 
         public virtual Task ValidTokenAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ValidToken() => throw null;
+        public virtual ClientResult ValidToken(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidTokenAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/ClientModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/ClientModel.cs
index de71ca5c8b..b5d5c4f04d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/ClientModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/ClientModel.cs
@@ -20,7 +20,7 @@ public partial class ClientModel
 
         public virtual Task ClientAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Client(Models.ClientModel body) => throw null;
+        public virtual ClientResult Client(Models.ClientModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ClientAsync(Models.ClientModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ClientModel
 
         public virtual Task LanguageAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Language(CSModel body) => throw null;
+        public virtual ClientResult Language(CSModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task LanguageAsync(CSModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/NamingClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/NamingClient.cs
index 3e00899ec9..aa6429d1eb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/NamingClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/NamingClient.cs
@@ -23,7 +23,7 @@ public partial class NamingClient
 
         public virtual Task ClientNameAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ClientName() => throw null;
+        public virtual ClientResult ClientName(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ClientNameAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class NamingClient
 
         public virtual Task ParameterAsync(string clientName, RequestOptions options) => throw null;
 
-        public virtual ClientResult Parameter(string clientName) => throw null;
+        public virtual ClientResult Parameter(string clientName, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ParameterAsync(string clientName, CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class NamingClient
 
         public virtual Task ClientAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Client(ClientNameModel body) => throw null;
+        public virtual ClientResult Client(ClientNameModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ClientAsync(ClientNameModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -47,7 +47,7 @@ public partial class NamingClient
 
         public virtual Task LanguageAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Language(LanguageClientNameModel body) => throw null;
+        public virtual ClientResult Language(LanguageClientNameModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task LanguageAsync(LanguageClientNameModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -55,7 +55,7 @@ public partial class NamingClient
 
         public virtual Task CompatibleWithEncodedNameAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult CompatibleWithEncodedName(ClientNameAndJsonEncodedNameModel body) => throw null;
+        public virtual ClientResult CompatibleWithEncodedName(ClientNameAndJsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task CompatibleWithEncodedNameAsync(ClientNameAndJsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -63,7 +63,7 @@ public partial class NamingClient
 
         public virtual Task RequestAsync(string clientName, RequestOptions options) => throw null;
 
-        public virtual ClientResult Request(string clientName) => throw null;
+        public virtual ClientResult Request(string clientName, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequestAsync(string clientName, CancellationToken cancellationToken = default) => throw null;
 
@@ -71,7 +71,7 @@ public partial class NamingClient
 
         public virtual Task ResponseAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Response() => throw null;
+        public virtual ClientResult Response(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ResponseAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/UnionEnum.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/UnionEnum.cs
index 06753f95bd..b0e48fa29e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/UnionEnum.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/naming/src/Generated/UnionEnum.cs
@@ -20,7 +20,7 @@ public partial class UnionEnum
 
         public virtual Task UnionEnumNameAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult UnionEnumName(ClientExtensibleEnum body) => throw null;
+        public virtual ClientResult UnionEnumName(ClientExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnionEnumNameAsync(ClientExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionEnum
 
         public virtual Task UnionEnumMemberNameAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult UnionEnumMemberName(ExtensibleEnum body) => throw null;
+        public virtual ClientResult UnionEnumMemberName(ExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnionEnumMemberNameAsync(ExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/FirstClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/FirstClient.cs
index 6969e06121..bb66571824 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/FirstClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/FirstClient.cs
@@ -25,7 +25,7 @@ public partial class FirstClient
 
         public virtual Task OneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult One() => throw null;
+        public virtual ClientResult One(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OneAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group3.cs
index 36260ac202..56cf60ebb2 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group3.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group3.cs
@@ -19,7 +19,7 @@ public partial class Group3
 
         public virtual Task TwoAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Two() => throw null;
+        public virtual ClientResult Two(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TwoAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Group3
 
         public virtual Task ThreeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Three() => throw null;
+        public virtual ClientResult Three(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ThreeAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group4.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group4.cs
index e57c04c261..a1a8d231b0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group4.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group4.cs
@@ -19,7 +19,7 @@ public partial class Group4
 
         public virtual Task FourAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Four() => throw null;
+        public virtual ClientResult Four(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FourAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group5.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group5.cs
index 21587c65c4..e4a9b20594 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group5.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/Group5.cs
@@ -19,7 +19,7 @@ public partial class Group5
 
         public virtual Task SixAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Six() => throw null;
+        public virtual ClientResult Six(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SixAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs
index f3ef48278c..4277bf3274 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/client-operation-group/src/Generated/SubNamespaceSecondClient.cs
@@ -25,7 +25,7 @@ public partial class SubNamespaceSecondClient
 
         public virtual Task FiveAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Five() => throw null;
+        public virtual ClientResult Five(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FiveAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Bar.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Bar.cs
index dc4b8c410a..3d7e5e78a3 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Bar.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Bar.cs
@@ -19,7 +19,7 @@ public partial class Bar
 
         public virtual Task FiveAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Five() => throw null;
+        public virtual ClientResult Five(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FiveAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Bar
 
         public virtual Task SixAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Six() => throw null;
+        public virtual ClientResult Six(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SixAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/BazFoo.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/BazFoo.cs
index 7c3abeee3c..5fb13b8acf 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/BazFoo.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/BazFoo.cs
@@ -19,7 +19,7 @@ public partial class BazFoo
 
         public virtual Task SevenAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Seven() => throw null;
+        public virtual ClientResult Seven(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SevenAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Foo.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Foo.cs
index 4e0fad66c7..c3e9e97da5 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Foo.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Foo.cs
@@ -19,7 +19,7 @@ public partial class Foo
 
         public virtual Task ThreeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Three() => throw null;
+        public virtual ClientResult Three(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ThreeAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Foo
 
         public virtual Task FourAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Four() => throw null;
+        public virtual ClientResult Four(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FourAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Qux.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Qux.cs
index 7c50892b9c..0f3f83ea36 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Qux.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/Qux.cs
@@ -19,7 +19,7 @@ public partial class Qux
 
         public virtual Task EightAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Eight() => throw null;
+        public virtual ClientResult Eight(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task EightAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/QuxBar.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/QuxBar.cs
index f4e4271cb0..90532bd46a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/QuxBar.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/QuxBar.cs
@@ -19,7 +19,7 @@ public partial class QuxBar
 
         public virtual Task NineAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Nine() => throw null;
+        public virtual ClientResult Nine(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task NineAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/ServiceClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/ServiceClient.cs
index a75b8c7085..fd72bc03a9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/ServiceClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/default/src/Generated/ServiceClient.cs
@@ -25,7 +25,7 @@ public partial class ServiceClient
 
         public virtual Task OneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult One() => throw null;
+        public virtual ClientResult One(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OneAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class ServiceClient
 
         public virtual Task TwoAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Two() => throw null;
+        public virtual ClientResult Two(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TwoAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientAClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientAClient.cs
index 727d769d32..d96274613e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientAClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientAClient.cs
@@ -25,7 +25,7 @@ public partial class ClientAClient
 
         public virtual Task RenamedOneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedOne() => throw null;
+        public virtual ClientResult RenamedOne(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedOneAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class ClientAClient
 
         public virtual Task RenamedThreeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedThree() => throw null;
+        public virtual ClientResult RenamedThree(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedThreeAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -41,7 +41,7 @@ public partial class ClientAClient
 
         public virtual Task RenamedFiveAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedFive() => throw null;
+        public virtual ClientResult RenamedFive(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedFiveAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientBClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientBClient.cs
index 726536adb1..b55365360c 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientBClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/multi-client/src/Generated/ClientBClient.cs
@@ -25,7 +25,7 @@ public partial class ClientBClient
 
         public virtual Task RenamedTwoAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedTwo() => throw null;
+        public virtual ClientResult RenamedTwo(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedTwoAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class ClientBClient
 
         public virtual Task RenamedFourAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedFour() => throw null;
+        public virtual ClientResult RenamedFour(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedFourAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -41,7 +41,7 @@ public partial class ClientBClient
 
         public virtual Task RenamedSixAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedSix() => throw null;
+        public virtual ClientResult RenamedSix(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedSixAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/Group.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/Group.cs
index c7ef3037d1..8c95144242 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/Group.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/Group.cs
@@ -19,7 +19,7 @@ public partial class Group
 
         public virtual Task RenamedTwoAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedTwo() => throw null;
+        public virtual ClientResult RenamedTwo(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedTwoAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Group
 
         public virtual Task RenamedFourAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedFour() => throw null;
+        public virtual ClientResult RenamedFour(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedFourAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Group
 
         public virtual Task RenamedSixAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedSix() => throw null;
+        public virtual ClientResult RenamedSix(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedSixAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs
index 5b9805a22c..4d0ef0b436 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/renamed-operation/src/Generated/RenamedOperationClient.cs
@@ -25,7 +25,7 @@ public partial class RenamedOperationClient
 
         public virtual Task RenamedOneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedOne() => throw null;
+        public virtual ClientResult RenamedOne(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedOneAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class RenamedOperationClient
 
         public virtual Task RenamedThreeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedThree() => throw null;
+        public virtual ClientResult RenamedThree(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedThreeAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -41,7 +41,7 @@ public partial class RenamedOperationClient
 
         public virtual Task RenamedFiveAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult RenamedFive() => throw null;
+        public virtual ClientResult RenamedFive(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RenamedFiveAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group1.cs
index 23c3a6e4fc..bdb742006f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group1.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group1.cs
@@ -19,7 +19,7 @@ public partial class Group1
 
         public virtual Task OneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult One() => throw null;
+        public virtual ClientResult One(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OneAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Group1
 
         public virtual Task ThreeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Three() => throw null;
+        public virtual ClientResult Three(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ThreeAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Group1
 
         public virtual Task FourAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Four() => throw null;
+        public virtual ClientResult Four(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FourAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group2.cs
index 83f7506cc7..dc8ad43369 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group2.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/client/structure/two-operation-group/src/Generated/Group2.cs
@@ -19,7 +19,7 @@ public partial class Group2
 
         public virtual Task TwoAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Two() => throw null;
+        public virtual ClientResult Two(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TwoAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Group2
 
         public virtual Task FiveAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Five() => throw null;
+        public virtual ClientResult Five(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FiveAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Group2
 
         public virtual Task SixAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Six() => throw null;
+        public virtual ClientResult Six(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SixAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Header.cs
index c0df20832f..c9b5ac5efb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Header.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Header.cs
@@ -21,7 +21,7 @@ public partial class Header
 
         public virtual Task DefaultAsync(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(BinaryData value) => throw null;
+        public virtual ClientResult Default(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Header
 
         public virtual Task Base64Async(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64(BinaryData value) => throw null;
+        public virtual ClientResult Base64(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64Async(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Header
 
         public virtual Task Base64urlAsync(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64url(BinaryData value) => throw null;
+        public virtual ClientResult Base64url(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64urlAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Header
 
         public virtual Task Base64urlArrayAsync(IEnumerable value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64urlArray(IEnumerable value) => throw null;
+        public virtual ClientResult Base64urlArray(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64urlArrayAsync(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Property.cs
index 8c68eb5bed..00a562ac6d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Property.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Property.cs
@@ -20,7 +20,7 @@ public partial class Property
 
         public virtual Task DefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Default(DefaultBytesProperty body) => throw null;
+        public virtual ClientResult Default(DefaultBytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> DefaultAsync(DefaultBytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Property
 
         public virtual Task Base64Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Base64(Base64BytesProperty body) => throw null;
+        public virtual ClientResult Base64(Base64BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Base64Async(Base64BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Property
 
         public virtual Task Base64urlAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Base64url(Base64urlBytesProperty body) => throw null;
+        public virtual ClientResult Base64url(Base64urlBytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Base64urlAsync(Base64urlBytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Property
 
         public virtual Task Base64urlArrayAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Base64urlArray(Base64urlArrayBytesProperty body) => throw null;
+        public virtual ClientResult Base64urlArray(Base64urlArrayBytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Base64urlArrayAsync(Base64urlArrayBytesProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Query.cs
index 635e9ce2bc..c0f522c51b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Query.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/Query.cs
@@ -21,7 +21,7 @@ public partial class Query
 
         public virtual Task DefaultAsync(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(BinaryData value) => throw null;
+        public virtual ClientResult Default(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Query
 
         public virtual Task Base64Async(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64(BinaryData value) => throw null;
+        public virtual ClientResult Base64(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64Async(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Query
 
         public virtual Task Base64urlAsync(BinaryData value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64url(BinaryData value) => throw null;
+        public virtual ClientResult Base64url(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64urlAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Query
 
         public virtual Task Base64urlArrayAsync(IEnumerable value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64urlArray(IEnumerable value) => throw null;
+        public virtual ClientResult Base64urlArray(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64urlArrayAsync(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/RequestBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/RequestBody.cs
index 02d3517de9..b7898078b0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/RequestBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/RequestBody.cs
@@ -20,7 +20,7 @@ public partial class RequestBody
 
         public virtual Task DefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Default(BinaryData value) => throw null;
+        public virtual ClientResult Default(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class RequestBody
 
         public virtual Task OctetStreamAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult OctetStream(BinaryData value) => throw null;
+        public virtual ClientResult OctetStream(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OctetStreamAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class RequestBody
 
         public virtual Task CustomContentTypeAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult CustomContentType(BinaryData value) => throw null;
+        public virtual ClientResult CustomContentType(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task CustomContentTypeAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class RequestBody
 
         public virtual Task Base64Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Base64(BinaryData value) => throw null;
+        public virtual ClientResult Base64(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64Async(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class RequestBody
 
         public virtual Task Base64urlAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Base64url(BinaryData value) => throw null;
+        public virtual ClientResult Base64url(BinaryData value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Base64urlAsync(BinaryData value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/ResponseBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/ResponseBody.cs
index 5a88205756..dd849dfa3f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/ResponseBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/bytes/src/Generated/ResponseBody.cs
@@ -20,7 +20,7 @@ public partial class ResponseBody
 
         public virtual Task DefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Default() => throw null;
+        public virtual ClientResult Default(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> DefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ResponseBody
 
         public virtual Task OctetStreamAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult OctetStream() => throw null;
+        public virtual ClientResult OctetStream(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> OctetStreamAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class ResponseBody
 
         public virtual Task CustomContentTypeAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult CustomContentType() => throw null;
+        public virtual ClientResult CustomContentType(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> CustomContentTypeAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class ResponseBody
 
         public virtual Task Base64Async(RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64() => throw null;
+        public virtual ClientResult Base64(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Base64Async(CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class ResponseBody
 
         public virtual Task Base64urlAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Base64url() => throw null;
+        public virtual ClientResult Base64url(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Base64urlAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Header.cs
index 41b594923c..a5d0061827 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Header.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Header.cs
@@ -21,7 +21,7 @@ public partial class Header
 
         public virtual Task DefaultAsync(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(DateTimeOffset value) => throw null;
+        public virtual ClientResult Default(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Header
 
         public virtual Task Rfc3339Async(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc3339(DateTimeOffset value) => throw null;
+        public virtual ClientResult Rfc3339(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc3339Async(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Header
 
         public virtual Task Rfc7231Async(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc7231(DateTimeOffset value) => throw null;
+        public virtual ClientResult Rfc7231(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc7231Async(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Header
 
         public virtual Task UnixTimestampAsync(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult UnixTimestamp(DateTimeOffset value) => throw null;
+        public virtual ClientResult UnixTimestamp(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnixTimestampAsync(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -53,7 +53,7 @@ public partial class Header
 
         public virtual Task UnixTimestampArrayAsync(IEnumerable value, RequestOptions options) => throw null;
 
-        public virtual ClientResult UnixTimestampArray(IEnumerable value) => throw null;
+        public virtual ClientResult UnixTimestampArray(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnixTimestampArrayAsync(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Property.cs
index fe3e3a9514..370a6c9825 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Property.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Property.cs
@@ -20,7 +20,7 @@ public partial class Property
 
         public virtual Task DefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Default(DefaultDatetimeProperty body) => throw null;
+        public virtual ClientResult Default(DefaultDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> DefaultAsync(DefaultDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Property
 
         public virtual Task Rfc3339Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Rfc3339(Rfc3339DatetimeProperty body) => throw null;
+        public virtual ClientResult Rfc3339(Rfc3339DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Rfc3339Async(Rfc3339DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Property
 
         public virtual Task Rfc7231Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Rfc7231(Rfc7231DatetimeProperty body) => throw null;
+        public virtual ClientResult Rfc7231(Rfc7231DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Rfc7231Async(Rfc7231DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Property
 
         public virtual Task UnixTimestampAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult UnixTimestamp(UnixTimestampDatetimeProperty body) => throw null;
+        public virtual ClientResult UnixTimestamp(UnixTimestampDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> UnixTimestampAsync(UnixTimestampDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class Property
 
         public virtual Task UnixTimestampArrayAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult UnixTimestampArray(UnixTimestampArrayDatetimeProperty body) => throw null;
+        public virtual ClientResult UnixTimestampArray(UnixTimestampArrayDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> UnixTimestampArrayAsync(UnixTimestampArrayDatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Query.cs
index c797656b6f..9bdd9ef202 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Query.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/Query.cs
@@ -21,7 +21,7 @@ public partial class Query
 
         public virtual Task DefaultAsync(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(DateTimeOffset value) => throw null;
+        public virtual ClientResult Default(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Query
 
         public virtual Task Rfc3339Async(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc3339(DateTimeOffset value) => throw null;
+        public virtual ClientResult Rfc3339(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc3339Async(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Query
 
         public virtual Task Rfc7231Async(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc7231(DateTimeOffset value) => throw null;
+        public virtual ClientResult Rfc7231(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc7231Async(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Query
 
         public virtual Task UnixTimestampAsync(DateTimeOffset value, RequestOptions options) => throw null;
 
-        public virtual ClientResult UnixTimestamp(DateTimeOffset value) => throw null;
+        public virtual ClientResult UnixTimestamp(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnixTimestampAsync(DateTimeOffset value, CancellationToken cancellationToken = default) => throw null;
 
@@ -53,7 +53,7 @@ public partial class Query
 
         public virtual Task UnixTimestampArrayAsync(IEnumerable value, RequestOptions options) => throw null;
 
-        public virtual ClientResult UnixTimestampArray(IEnumerable value) => throw null;
+        public virtual ClientResult UnixTimestampArray(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnixTimestampArrayAsync(IEnumerable value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/ResponseHeader.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/ResponseHeader.cs
index e4fc12bf31..9ec01d1c0b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/ResponseHeader.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/datetime/src/Generated/ResponseHeader.cs
@@ -19,7 +19,7 @@ public partial class ResponseHeader
 
         public virtual Task DefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Default() => throw null;
+        public virtual ClientResult Default(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class ResponseHeader
 
         public virtual Task Rfc3339Async(RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc3339() => throw null;
+        public virtual ClientResult Rfc3339(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc3339Async(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class ResponseHeader
 
         public virtual Task Rfc7231Async(RequestOptions options) => throw null;
 
-        public virtual ClientResult Rfc7231() => throw null;
+        public virtual ClientResult Rfc7231(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Rfc7231Async(CancellationToken cancellationToken = default) => throw null;
 
@@ -43,7 +43,7 @@ public partial class ResponseHeader
 
         public virtual Task UnixTimestampAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult UnixTimestamp() => throw null;
+        public virtual ClientResult UnixTimestamp(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task UnixTimestampAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Header.cs
index 956977fab8..4dcb081e36 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Header.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Header.cs
@@ -21,7 +21,7 @@ public partial class Header
 
         public virtual Task DefaultAsync(TimeSpan duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(TimeSpan duration) => throw null;
+        public virtual ClientResult Default(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Header
 
         public virtual Task Iso8601Async(TimeSpan duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult Iso8601(TimeSpan duration) => throw null;
+        public virtual ClientResult Iso8601(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Iso8601Async(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Header
 
         public virtual Task Iso8601ArrayAsync(IEnumerable duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult Iso8601Array(IEnumerable duration) => throw null;
+        public virtual ClientResult Iso8601Array(IEnumerable duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Iso8601ArrayAsync(IEnumerable duration, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Header
 
         public virtual Task Int32SecondsAsync(TimeSpan duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult Int32Seconds(TimeSpan duration) => throw null;
+        public virtual ClientResult Int32Seconds(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Int32SecondsAsync(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
@@ -53,7 +53,7 @@ public partial class Header
 
         public virtual Task FloatSecondsAsync(TimeSpan duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult FloatSeconds(TimeSpan duration) => throw null;
+        public virtual ClientResult FloatSeconds(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FloatSecondsAsync(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
@@ -61,7 +61,7 @@ public partial class Header
 
         public virtual Task Float64SecondsAsync(TimeSpan duration, RequestOptions options) => throw null;
 
-        public virtual ClientResult Float64Seconds(TimeSpan duration) => throw null;
+        public virtual ClientResult Float64Seconds(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Float64SecondsAsync(TimeSpan duration, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Property.cs
index 5712b27089..0895d90cb2 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Property.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Property.cs
@@ -20,7 +20,7 @@ public partial class Property
 
         public virtual Task DefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Default(DefaultDurationProperty body) => throw null;
+        public virtual ClientResult Default(DefaultDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> DefaultAsync(DefaultDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Property
 
         public virtual Task Iso8601Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Iso8601(ISO8601DurationProperty body) => throw null;
+        public virtual ClientResult Iso8601(ISO8601DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Iso8601Async(ISO8601DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Property
 
         public virtual Task Int32SecondsAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Int32Seconds(Int32SecondsDurationProperty body) => throw null;
+        public virtual ClientResult Int32Seconds(Int32SecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Int32SecondsAsync(Int32SecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Property
 
         public virtual Task FloatSecondsAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult FloatSeconds(FloatSecondsDurationProperty body) => throw null;
+        public virtual ClientResult FloatSeconds(FloatSecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> FloatSecondsAsync(FloatSecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class Property
 
         public virtual Task Float64SecondsAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Float64Seconds(Float64SecondsDurationProperty body) => throw null;
+        public virtual ClientResult Float64Seconds(Float64SecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Float64SecondsAsync(Float64SecondsDurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -60,7 +60,7 @@ public partial class Property
 
         public virtual Task FloatSecondsArrayAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult FloatSecondsArray(FloatSecondsDurationArrayProperty body) => throw null;
+        public virtual ClientResult FloatSecondsArray(FloatSecondsDurationArrayProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> FloatSecondsArrayAsync(FloatSecondsDurationArrayProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Query.cs
index 332a099b22..acdba548f7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Query.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/duration/src/Generated/Query.cs
@@ -21,7 +21,7 @@ public partial class Query
 
         public virtual Task DefaultAsync(TimeSpan input, RequestOptions options) => throw null;
 
-        public virtual ClientResult Default(TimeSpan input) => throw null;
+        public virtual ClientResult Default(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefaultAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class Query
 
         public virtual Task Iso8601Async(TimeSpan input, RequestOptions options) => throw null;
 
-        public virtual ClientResult Iso8601(TimeSpan input) => throw null;
+        public virtual ClientResult Iso8601(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Iso8601Async(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
@@ -37,7 +37,7 @@ public partial class Query
 
         public virtual Task Int32SecondsAsync(TimeSpan input, RequestOptions options) => throw null;
 
-        public virtual ClientResult Int32Seconds(TimeSpan input) => throw null;
+        public virtual ClientResult Int32Seconds(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Int32SecondsAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
@@ -45,7 +45,7 @@ public partial class Query
 
         public virtual Task FloatSecondsAsync(TimeSpan input, RequestOptions options) => throw null;
 
-        public virtual ClientResult FloatSeconds(TimeSpan input) => throw null;
+        public virtual ClientResult FloatSeconds(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FloatSecondsAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
@@ -53,7 +53,7 @@ public partial class Query
 
         public virtual Task Float64SecondsAsync(TimeSpan input, RequestOptions options) => throw null;
 
-        public virtual ClientResult Float64Seconds(TimeSpan input) => throw null;
+        public virtual ClientResult Float64Seconds(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Float64SecondsAsync(TimeSpan input, CancellationToken cancellationToken = default) => throw null;
 
@@ -61,7 +61,7 @@ public partial class Query
 
         public virtual Task Int32SecondsArrayAsync(IEnumerable input, RequestOptions options) => throw null;
 
-        public virtual ClientResult Int32SecondsArray(IEnumerable input) => throw null;
+        public virtual ClientResult Int32SecondsArray(IEnumerable input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task Int32SecondsArrayAsync(IEnumerable input, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/numeric/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/numeric/src/Generated/Property.cs
index 4ebe494bae..f3d58fd18b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/numeric/src/Generated/Property.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/encode/numeric/src/Generated/Property.cs
@@ -20,7 +20,7 @@ public partial class Property
 
         public virtual Task SafeintAsStringAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SafeintAsString(SafeintAsStringProperty value) => throw null;
+        public virtual ClientResult SafeintAsString(SafeintAsStringProperty value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> SafeintAsStringAsync(SafeintAsStringProperty value, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Property
 
         public virtual Task Uint32AsStringOptionalAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Uint32AsStringOptional(Uint32AsStringProperty value) => throw null;
+        public virtual ClientResult Uint32AsStringOptional(Uint32AsStringProperty value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Uint32AsStringOptionalAsync(Uint32AsStringProperty value, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Property
 
         public virtual Task Uint8AsStringAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Uint8AsString(Uint8AsStringProperty value) => throw null;
+        public virtual ClientResult Uint8AsString(Uint8AsStringProperty value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> Uint8AsStringAsync(Uint8AsStringProperty value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ExplicitBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ExplicitBody.cs
index cfa792021e..93f38dc924 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ExplicitBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ExplicitBody.cs
@@ -20,7 +20,7 @@ public partial class ExplicitBody
 
         public virtual Task SimpleAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Simple(User body) => throw null;
+        public virtual ClientResult Simple(User body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SimpleAsync(User body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ImplicitBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ImplicitBody.cs
index cb1aa73180..d0067bcaaa 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ImplicitBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/basic/src/Generated/ImplicitBody.cs
@@ -19,7 +19,7 @@ public partial class ImplicitBody
 
         public virtual Task SimpleAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Simple(string name) => throw null;
+        public virtual ClientResult Simple(string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SimpleAsync(string name, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs
index 95446075e4..4ea51c3fe6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/BodyOptionalityClient.cs
@@ -23,7 +23,7 @@ public partial class BodyOptionalityClient
 
         public virtual Task RequiredExplicitAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult RequiredExplicit(BodyModel body) => throw null;
+        public virtual ClientResult RequiredExplicit(BodyModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequiredExplicitAsync(BodyModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class BodyOptionalityClient
 
         public virtual Task RequiredImplicitAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult RequiredImplicit(string name) => throw null;
+        public virtual ClientResult RequiredImplicit(string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequiredImplicitAsync(string name, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs
index 54dda83a93..13e3b1ac81 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/body-optionality/src/Generated/OptionalExplicit.cs
@@ -20,7 +20,7 @@ public partial class OptionalExplicit
 
         public virtual Task SetAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Set(BodyModel body = null) => throw null;
+        public virtual ClientResult Set(BodyModel body = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SetAsync(BodyModel body = null, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class OptionalExplicit
 
         public virtual Task OmitAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Omit(BodyModel body = null) => throw null;
+        public virtual ClientResult Omit(BodyModel body = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OmitAsync(BodyModel body = null, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Header.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Header.cs
index 611df9bb56..bda19c88a8 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Header.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Header.cs
@@ -20,7 +20,7 @@ public partial class Header
 
         public virtual Task CsvAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Csv(IEnumerable colors) => throw null;
+        public virtual ClientResult Csv(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task CsvAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Query.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Query.cs
index e98843490b..7a9c0bf3ed 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Query.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/collection-format/src/Generated/Query.cs
@@ -20,7 +20,7 @@ public partial class Query
 
         public virtual Task MultiAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Multi(IEnumerable colors) => throw null;
+        public virtual ClientResult Multi(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task MultiAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Query
 
         public virtual Task SsvAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Ssv(IEnumerable colors) => throw null;
+        public virtual ClientResult Ssv(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SsvAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Query
 
         public virtual Task TsvAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Tsv(IEnumerable colors) => throw null;
+        public virtual ClientResult Tsv(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TsvAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Query
 
         public virtual Task PipesAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Pipes(IEnumerable colors) => throw null;
+        public virtual ClientResult Pipes(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PipesAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class Query
 
         public virtual Task CsvAsync(IEnumerable colors, RequestOptions options) => throw null;
 
-        public virtual ClientResult Csv(IEnumerable colors) => throw null;
+        public virtual ClientResult Csv(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task CsvAsync(IEnumerable colors, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Alias.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Alias.cs
index 7624c52f10..dddfff2392 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Alias.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Alias.cs
@@ -20,7 +20,7 @@ public partial class Alias
 
         public virtual Task SpreadAsRequestBodyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadAsRequestBody(string name) => throw null;
+        public virtual ClientResult SpreadAsRequestBody(string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadAsRequestBodyAsync(string name, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Alias
 
         public virtual Task SpreadParameterWithInnerModelAsync(string id, string xMsTestHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadParameterWithInnerModel(string id, string xMsTestHeader, string name) => throw null;
+        public virtual ClientResult SpreadParameterWithInnerModel(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadParameterWithInnerModelAsync(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Alias
 
         public virtual Task SpreadAsRequestParameterAsync(string id, string xMsTestHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadAsRequestParameter(string id, string xMsTestHeader, string name) => throw null;
+        public virtual ClientResult SpreadAsRequestParameter(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadAsRequestParameterAsync(string id, string xMsTestHeader, string name, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Alias
 
         public virtual Task SpreadWithMultipleParametersAsync(string id, string xMsTestHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadWithMultipleParameters(string id, string xMsTestHeader, string requiredString, IEnumerable requiredIntList, int? optionalInt = default, IEnumerable optionalStringList = default) => throw null;
+        public virtual ClientResult SpreadWithMultipleParameters(string id, string xMsTestHeader, string requiredString, IEnumerable requiredIntList, int? optionalInt = default, IEnumerable optionalStringList = default, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadWithMultipleParametersAsync(string id, string xMsTestHeader, string requiredString, IEnumerable requiredIntList, int? optionalInt = default, IEnumerable optionalStringList = default, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class Alias
 
         public virtual Task SpreadParameterWithInnerAliasAsync(string id, string xMsTestHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadParameterWithInnerAlias(string id, string xMsTestHeader, string name, int age) => throw null;
+        public virtual ClientResult SpreadParameterWithInnerAlias(string id, string xMsTestHeader, string name, int age, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadParameterWithInnerAliasAsync(string id, string xMsTestHeader, string name, int age, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Model.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Model.cs
index 678cb42f10..e8a6b3fa29 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Model.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/parameters/spread/src/Generated/Model.cs
@@ -20,7 +20,7 @@ public partial class Model
 
         public virtual Task SpreadAsRequestBodyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadAsRequestBody(string name) => throw null;
+        public virtual ClientResult SpreadAsRequestBody(string name, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadAsRequestBodyAsync(string name, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Model
 
         public virtual Task SpreadCompositeRequestOnlyWithBodyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadCompositeRequestOnlyWithBody(BodyParameter body) => throw null;
+        public virtual ClientResult SpreadCompositeRequestOnlyWithBody(BodyParameter body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadCompositeRequestOnlyWithBodyAsync(BodyParameter body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Model
 
         public virtual Task SpreadCompositeRequestWithoutBodyAsync(string name, string testHeader, RequestOptions options) => throw null;
 
-        public virtual ClientResult SpreadCompositeRequestWithoutBody(string name, string testHeader) => throw null;
+        public virtual ClientResult SpreadCompositeRequestWithoutBody(string name, string testHeader, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadCompositeRequestWithoutBodyAsync(string name, string testHeader, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Model
 
         public virtual Task SpreadCompositeRequestAsync(string name, string testHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadCompositeRequest(string name, string testHeader, BodyParameter body) => throw null;
+        public virtual ClientResult SpreadCompositeRequest(string name, string testHeader, BodyParameter body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadCompositeRequestAsync(string name, string testHeader, BodyParameter body, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class Model
 
         public virtual Task SpreadCompositeRequestMixAsync(string name, string testHeader, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SpreadCompositeRequestMix(string name, string testHeader, string prop) => throw null;
+        public virtual ClientResult SpreadCompositeRequestMix(string name, string testHeader, string prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SpreadCompositeRequestMixAsync(string name, string testHeader, string prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/DifferentBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/DifferentBody.cs
index e6efb33ff2..3acc6eca8d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/DifferentBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/DifferentBody.cs
@@ -21,7 +21,7 @@ public partial class DifferentBody
 
         public virtual Task GetAvatarAsPngAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAvatarAsPng() => throw null;
+        public virtual ClientResult GetAvatarAsPng(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAvatarAsPngAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class DifferentBody
 
         public virtual Task GetAvatarAsJsonAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAvatarAsJson() => throw null;
+        public virtual ClientResult GetAvatarAsJson(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAvatarAsJsonAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/SameBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/SameBody.cs
index 557a1d5a8b..35493a8357 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/SameBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/content-negotiation/src/Generated/SameBody.cs
@@ -20,7 +20,7 @@ public partial class SameBody
 
         public virtual Task GetAvatarAsPngAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAvatarAsPng() => throw null;
+        public virtual ClientResult GetAvatarAsPng(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAvatarAsPngAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SameBody
 
         public virtual Task GetAvatarAsJpegAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAvatarAsJpeg() => throw null;
+        public virtual ClientResult GetAvatarAsJpeg(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAvatarAsJpegAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs
index a0ede8687d..7bfcb15b1b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/json-merge-patch/src/Generated/JsonMergePatchClient.cs
@@ -23,7 +23,7 @@ public partial class JsonMergePatchClient
 
         public virtual Task CreateResourceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult CreateResource(Resource body) => throw null;
+        public virtual ClientResult CreateResource(Resource body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> CreateResourceAsync(Resource body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/media-type/src/Generated/StringBody.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/media-type/src/Generated/StringBody.cs
index b3de0edda6..b0e91a7020 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/media-type/src/Generated/StringBody.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/payload/media-type/src/Generated/StringBody.cs
@@ -19,7 +19,7 @@ public partial class StringBody
 
         public virtual Task SendAsTextAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SendAsText(string text) => throw null;
+        public virtual ClientResult SendAsText(string text, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsTextAsync(string text, CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class StringBody
 
         public virtual Task GetAsTextAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAsText() => throw null;
+        public virtual ClientResult GetAsText(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsTextAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class StringBody
 
         public virtual Task SendAsJsonAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SendAsJson(string text) => throw null;
+        public virtual ClientResult SendAsJson(string text, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsJsonAsync(string text, CancellationToken cancellationToken = default) => throw null;
 
@@ -43,7 +43,7 @@ public partial class StringBody
 
         public virtual Task GetAsJsonAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAsJson() => throw null;
+        public virtual ClientResult GetAsJson(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsJsonAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs
index 8c25a81940..130f148e87 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v1/src/Generated/ResiliencyServiceDrivenClient.cs
@@ -24,7 +24,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromNoneAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult FromNone() => throw null;
+        public virtual ClientResult FromNone(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromNoneAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromOneRequiredAsync(string parameter, RequestOptions options) => throw null;
 
-        public virtual ClientResult FromOneRequired(string parameter) => throw null;
+        public virtual ClientResult FromOneRequired(string parameter, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromOneRequiredAsync(string parameter, CancellationToken cancellationToken = default) => throw null;
 
@@ -40,7 +40,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromOneOptionalAsync(string parameter, RequestOptions options) => throw null;
 
-        public virtual ClientResult FromOneOptional(string parameter = null) => throw null;
+        public virtual ClientResult FromOneOptional(string parameter = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromOneOptionalAsync(string parameter = null, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs
index 6cc3562d37..11797d94b6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/resiliency/srv-driven/v2/src/Generated/ResiliencyServiceDrivenClient.cs
@@ -24,7 +24,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task AddOperationAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult AddOperation() => throw null;
+        public virtual ClientResult AddOperation(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AddOperationAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromNoneAsync(string newParameter, RequestOptions options) => throw null;
 
-        public virtual ClientResult FromNone(string newParameter = null) => throw null;
+        public virtual ClientResult FromNone(string newParameter = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromNoneAsync(string newParameter = null, CancellationToken cancellationToken = default) => throw null;
 
@@ -40,7 +40,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromOneRequiredAsync(string parameter, string newParameter, RequestOptions options) => throw null;
 
-        public virtual ClientResult FromOneRequired(string parameter, string newParameter = null) => throw null;
+        public virtual ClientResult FromOneRequired(string parameter, string newParameter = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromOneRequiredAsync(string parameter, string newParameter = null, CancellationToken cancellationToken = default) => throw null;
 
@@ -48,7 +48,7 @@ public partial class ResiliencyServiceDrivenClient
 
         public virtual Task FromOneOptionalAsync(string parameter, string newParameter, RequestOptions options) => throw null;
 
-        public virtual ClientResult FromOneOptional(string parameter = null, string newParameter = null) => throw null;
+        public virtual ClientResult FromOneOptional(string parameter = null, string newParameter = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromOneOptionalAsync(string parameter = null, string newParameter = null, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs
index c01a82e47e..2c68d8281b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/InInterface.cs
@@ -19,7 +19,7 @@ public partial class InInterface
 
         public virtual Task FixedAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Fixed() => throw null;
+        public virtual ClientResult Fixed(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FixedAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs
index 37daa6a19d..945f9d0567 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParameters.cs
@@ -19,7 +19,7 @@ public partial class PathParameters
 
         public virtual Task TemplateOnlyAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult TemplateOnly(string @param) => throw null;
+        public virtual ClientResult TemplateOnly(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TemplateOnlyAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class PathParameters
 
         public virtual Task ExplicitAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Explicit(string @param) => throw null;
+        public virtual ClientResult Explicit(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ExplicitAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class PathParameters
 
         public virtual Task AnnotationOnlyAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult AnnotationOnly(string @param) => throw null;
+        public virtual ClientResult AnnotationOnly(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AnnotationOnlyAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs
index 86a2543033..d844af2bc5 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionExplode.cs
@@ -20,7 +20,7 @@ public partial class PathParametersLabelExpansionExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersLabelExpansionExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersLabelExpansionExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs
index 65ba0dd28e..1044215dcb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersLabelExpansionStandard.cs
@@ -20,7 +20,7 @@ public partial class PathParametersLabelExpansionStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersLabelExpansionStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersLabelExpansionStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs
index 21ccb56760..480cf409e3 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionExplode.cs
@@ -20,7 +20,7 @@ public partial class PathParametersMatrixExpansionExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersMatrixExpansionExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersMatrixExpansionExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs
index ad197bbab1..78dc990435 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersMatrixExpansionStandard.cs
@@ -20,7 +20,7 @@ public partial class PathParametersMatrixExpansionStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersMatrixExpansionStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersMatrixExpansionStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs
index 60598f389f..55e0c1452e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionExplode.cs
@@ -20,7 +20,7 @@ public partial class PathParametersPathExpansionExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersPathExpansionExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersPathExpansionExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs
index 08c056ef08..0102ff7ca1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersPathExpansionStandard.cs
@@ -20,7 +20,7 @@ public partial class PathParametersPathExpansionStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersPathExpansionStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersPathExpansionStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs
index 4fcb10656c..9536143239 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersReservedExpansion.cs
@@ -19,7 +19,7 @@ public partial class PathParametersReservedExpansion
 
         public virtual Task TemplateAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Template(string @param) => throw null;
+        public virtual ClientResult Template(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TemplateAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class PathParametersReservedExpansion
 
         public virtual Task AnnotationAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Annotation(string @param) => throw null;
+        public virtual ClientResult Annotation(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AnnotationAsync(string @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs
index 98199c0694..2a4e7a7fbc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionExplode.cs
@@ -20,7 +20,7 @@ public partial class PathParametersSimpleExpansionExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersSimpleExpansionExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersSimpleExpansionExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs
index 5665841897..a54c64a0e9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/PathParametersSimpleExpansionStandard.cs
@@ -20,7 +20,7 @@ public partial class PathParametersSimpleExpansionStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PathParametersSimpleExpansionStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PathParametersSimpleExpansionStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs
index efbee63fbc..eafad598a3 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParameters.cs
@@ -19,7 +19,7 @@ public partial class QueryParameters
 
         public virtual Task TemplateOnlyAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult TemplateOnly(string @param) => throw null;
+        public virtual ClientResult TemplateOnly(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TemplateOnlyAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class QueryParameters
 
         public virtual Task ExplicitAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Explicit(string @param) => throw null;
+        public virtual ClientResult Explicit(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ExplicitAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class QueryParameters
 
         public virtual Task AnnotationOnlyAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult AnnotationOnly(string @param) => throw null;
+        public virtual ClientResult AnnotationOnly(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AnnotationOnlyAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs
index 88fb66288b..8f017e26d8 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationExplode.cs
@@ -20,7 +20,7 @@ public partial class QueryParametersQueryContinuationExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class QueryParametersQueryContinuationExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class QueryParametersQueryContinuationExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs
index f501241cd7..e9c366e498 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryContinuationStandard.cs
@@ -20,7 +20,7 @@ public partial class QueryParametersQueryContinuationStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class QueryParametersQueryContinuationStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class QueryParametersQueryContinuationStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs
index d25db2d3a5..af8a04a49e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionExplode.cs
@@ -20,7 +20,7 @@ public partial class QueryParametersQueryExpansionExplode
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class QueryParametersQueryExpansionExplode
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class QueryParametersQueryExpansionExplode
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs
index 8745e55f5c..f0a66a020e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/QueryParametersQueryExpansionStandard.cs
@@ -20,7 +20,7 @@ public partial class QueryParametersQueryExpansionStandard
 
         public virtual Task PrimitiveAsync(string @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Primitive(string @param) => throw null;
+        public virtual ClientResult Primitive(string @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PrimitiveAsync(string @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class QueryParametersQueryExpansionStandard
 
         public virtual Task ArrayAsync(IEnumerable @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Array(IEnumerable @param) => throw null;
+        public virtual ClientResult Array(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ArrayAsync(IEnumerable @param, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class QueryParametersQueryExpansionStandard
 
         public virtual Task RecordAsync(IDictionary @param, RequestOptions options) => throw null;
 
-        public virtual ClientResult Record(IDictionary @param) => throw null;
+        public virtual ClientResult Record(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RecordAsync(IDictionary @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs
index a57a85276e..c2bb7449fb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/routes/src/Generated/RoutesClient.cs
@@ -22,7 +22,7 @@ public partial class RoutesClient
 
         public virtual Task FixedAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Fixed() => throw null;
+        public virtual ClientResult Fixed(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FixedAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/serialization/encoded-name/json/src/Generated/Property.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/serialization/encoded-name/json/src/Generated/Property.cs
index 2b70458e80..ab46ec6767 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/serialization/encoded-name/json/src/Generated/Property.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/serialization/encoded-name/json/src/Generated/Property.cs
@@ -20,7 +20,7 @@ public partial class Property
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(JsonEncodedNameModel body) => throw null;
+        public virtual ClientResult Send(JsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(JsonEncodedNameModel body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Property
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs
index 68bed4d189..c9b371e391 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/endpoint/not-defined/src/Generated/NotDefinedClient.cs
@@ -24,7 +24,7 @@ public partial class NotDefinedClient
 
         public virtual Task ValidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Valid() => throw null;
+        public virtual ClientResult Valid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ValidAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/multiple/src/Generated/MultipleClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/multiple/src/Generated/MultipleClient.cs
index 7ea2dc0836..cfb066bf91 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/multiple/src/Generated/MultipleClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/multiple/src/Generated/MultipleClient.cs
@@ -24,7 +24,7 @@ public partial class MultipleClient
 
         public virtual Task NoOperationParamsAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult NoOperationParams() => throw null;
+        public virtual ClientResult NoOperationParams(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task NoOperationParamsAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class MultipleClient
 
         public virtual Task WithOperationPathParamAsync(string keyword, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithOperationPathParam(string keyword) => throw null;
+        public virtual ClientResult WithOperationPathParam(string keyword, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithOperationPathParamAsync(string keyword, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClient.cs
index 63fcd089e6..25d2f13eb1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/path/single/src/Generated/SingleClient.cs
@@ -24,7 +24,7 @@ public partial class SingleClient
 
         public virtual Task MyOpAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult MyOp() => throw null;
+        public virtual ClientResult MyOp(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task MyOpAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs
index 835652b533..6fb0abe3bc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/not-versioned/src/Generated/NotVersionedClient.cs
@@ -24,7 +24,7 @@ public partial class NotVersionedClient
 
         public virtual Task WithoutApiVersionAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult WithoutApiVersion() => throw null;
+        public virtual ClientResult WithoutApiVersion(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithoutApiVersionAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class NotVersionedClient
 
         public virtual Task WithQueryApiVersionAsync(string apiVersion, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithQueryApiVersion(string apiVersion) => throw null;
+        public virtual ClientResult WithQueryApiVersion(string apiVersion, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithQueryApiVersionAsync(string apiVersion, CancellationToken cancellationToken = default) => throw null;
 
@@ -40,7 +40,7 @@ public partial class NotVersionedClient
 
         public virtual Task WithPathApiVersionAsync(string apiVersion, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithPathApiVersion(string apiVersion) => throw null;
+        public virtual ClientResult WithPathApiVersion(string apiVersion, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithPathApiVersionAsync(string apiVersion, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/versioned/src/Generated/VersionedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/versioned/src/Generated/VersionedClient.cs
index 86dfb535a2..01e9d2e322 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/versioned/src/Generated/VersionedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/server/versions/versioned/src/Generated/VersionedClient.cs
@@ -24,7 +24,7 @@ public partial class VersionedClient
 
         public virtual Task WithoutApiVersionAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult WithoutApiVersion() => throw null;
+        public virtual ClientResult WithoutApiVersion(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithoutApiVersionAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -32,7 +32,7 @@ public partial class VersionedClient
 
         public virtual Task WithQueryApiVersionAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult WithQueryApiVersion() => throw null;
+        public virtual ClientResult WithQueryApiVersion(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithQueryApiVersionAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -40,7 +40,7 @@ public partial class VersionedClient
 
         public virtual Task WithPathApiVersionAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult WithPathApiVersion() => throw null;
+        public virtual ClientResult WithPathApiVersion(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithPathApiVersionAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -48,7 +48,7 @@ public partial class VersionedClient
 
         public virtual Task WithQueryOldApiVersionAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult WithQueryOldApiVersion() => throw null;
+        public virtual ClientResult WithQueryOldApiVersion(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithQueryOldApiVersionAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs
index 188269060e..325865ab67 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/repeatability/src/Generated/RepeatabilityClient.cs
@@ -22,7 +22,7 @@ public partial class RepeatabilityClient
 
         public virtual Task ImmediateSuccessAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ImmediateSuccess() => throw null;
+        public virtual ClientResult ImmediateSuccess(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ImmediateSuccessAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelProperties.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelProperties.cs
index fd320a82fe..d8ea4bf5da 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelProperties.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelProperties.cs
@@ -20,7 +20,7 @@ public partial class ModelProperties
 
         public virtual Task SameAsModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult SameAsModel(SameAsModel body) => throw null;
+        public virtual ClientResult SameAsModel(SameAsModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SameAsModelAsync(SameAsModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelsOps.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelsOps.cs
index 0dadac74dc..62aab4211d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelsOps.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/ModelsOps.cs
@@ -20,7 +20,7 @@ public partial class ModelsOps
 
         public virtual Task WithAndAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithAnd(And body) => throw null;
+        public virtual ClientResult WithAnd(And body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAndAsync(And body, CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ModelsOps
 
         public virtual Task WithAsAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithAs(As body) => throw null;
+        public virtual ClientResult WithAs(As body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAsAsync(As body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class ModelsOps
 
         public virtual Task WithAssertAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithAssert(Assert body) => throw null;
+        public virtual ClientResult WithAssert(Assert body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAssertAsync(Assert body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class ModelsOps
 
         public virtual Task WithAsyncAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithAsync(Async body) => throw null;
+        public virtual ClientResult WithAsync(Async body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAsyncAsync(Async body, CancellationToken cancellationToken = default) => throw null;
 
@@ -52,7 +52,7 @@ public partial class ModelsOps
 
         public virtual Task WithAwaitAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithAwait(Await body) => throw null;
+        public virtual ClientResult WithAwait(Await body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAwaitAsync(Await body, CancellationToken cancellationToken = default) => throw null;
 
@@ -60,7 +60,7 @@ public partial class ModelsOps
 
         public virtual Task WithBreakAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithBreak(Break body) => throw null;
+        public virtual ClientResult WithBreak(Break body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithBreakAsync(Break body, CancellationToken cancellationToken = default) => throw null;
 
@@ -68,7 +68,7 @@ public partial class ModelsOps
 
         public virtual Task WithClassAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithClass(Class body) => throw null;
+        public virtual ClientResult WithClass(Class body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithClassAsync(Class body, CancellationToken cancellationToken = default) => throw null;
 
@@ -76,7 +76,7 @@ public partial class ModelsOps
 
         public virtual Task WithConstructorAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithConstructor(Constructor body) => throw null;
+        public virtual ClientResult WithConstructor(Constructor body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithConstructorAsync(Constructor body, CancellationToken cancellationToken = default) => throw null;
 
@@ -84,7 +84,7 @@ public partial class ModelsOps
 
         public virtual Task WithContinueAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithContinue(Continue body) => throw null;
+        public virtual ClientResult WithContinue(Continue body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithContinueAsync(Continue body, CancellationToken cancellationToken = default) => throw null;
 
@@ -92,7 +92,7 @@ public partial class ModelsOps
 
         public virtual Task WithDefAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithDef(Def body) => throw null;
+        public virtual ClientResult WithDef(Def body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithDefAsync(Def body, CancellationToken cancellationToken = default) => throw null;
 
@@ -100,7 +100,7 @@ public partial class ModelsOps
 
         public virtual Task WithDelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithDel(Del body) => throw null;
+        public virtual ClientResult WithDel(Del body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithDelAsync(Del body, CancellationToken cancellationToken = default) => throw null;
 
@@ -108,7 +108,7 @@ public partial class ModelsOps
 
         public virtual Task WithElifAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithElif(Elif body) => throw null;
+        public virtual ClientResult WithElif(Elif body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithElifAsync(Elif body, CancellationToken cancellationToken = default) => throw null;
 
@@ -116,7 +116,7 @@ public partial class ModelsOps
 
         public virtual Task WithElseAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithElse(Else body) => throw null;
+        public virtual ClientResult WithElse(Else body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithElseAsync(Else body, CancellationToken cancellationToken = default) => throw null;
 
@@ -124,7 +124,7 @@ public partial class ModelsOps
 
         public virtual Task WithExceptAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithExcept(Except body) => throw null;
+        public virtual ClientResult WithExcept(Except body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithExceptAsync(Except body, CancellationToken cancellationToken = default) => throw null;
 
@@ -132,7 +132,7 @@ public partial class ModelsOps
 
         public virtual Task WithExecAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithExec(Exec body) => throw null;
+        public virtual ClientResult WithExec(Exec body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithExecAsync(Exec body, CancellationToken cancellationToken = default) => throw null;
 
@@ -140,7 +140,7 @@ public partial class ModelsOps
 
         public virtual Task WithFinallyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithFinally(Finally body) => throw null;
+        public virtual ClientResult WithFinally(Finally body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithFinallyAsync(Finally body, CancellationToken cancellationToken = default) => throw null;
 
@@ -148,7 +148,7 @@ public partial class ModelsOps
 
         public virtual Task WithForAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithFor(For body) => throw null;
+        public virtual ClientResult WithFor(For body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithForAsync(For body, CancellationToken cancellationToken = default) => throw null;
 
@@ -156,7 +156,7 @@ public partial class ModelsOps
 
         public virtual Task WithFromAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithFrom(From body) => throw null;
+        public virtual ClientResult WithFrom(From body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithFromAsync(From body, CancellationToken cancellationToken = default) => throw null;
 
@@ -164,7 +164,7 @@ public partial class ModelsOps
 
         public virtual Task WithGlobalAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithGlobal(Global body) => throw null;
+        public virtual ClientResult WithGlobal(Global body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithGlobalAsync(Global body, CancellationToken cancellationToken = default) => throw null;
 
@@ -172,7 +172,7 @@ public partial class ModelsOps
 
         public virtual Task WithIfAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithIf(If body) => throw null;
+        public virtual ClientResult WithIf(If body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithIfAsync(If body, CancellationToken cancellationToken = default) => throw null;
 
@@ -180,7 +180,7 @@ public partial class ModelsOps
 
         public virtual Task WithImportAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithImport(Import body) => throw null;
+        public virtual ClientResult WithImport(Import body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithImportAsync(Import body, CancellationToken cancellationToken = default) => throw null;
 
@@ -188,7 +188,7 @@ public partial class ModelsOps
 
         public virtual Task WithInAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithIn(In body) => throw null;
+        public virtual ClientResult WithIn(In body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithInAsync(In body, CancellationToken cancellationToken = default) => throw null;
 
@@ -196,7 +196,7 @@ public partial class ModelsOps
 
         public virtual Task WithIsAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithIs(Is body) => throw null;
+        public virtual ClientResult WithIs(Is body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithIsAsync(Is body, CancellationToken cancellationToken = default) => throw null;
 
@@ -204,7 +204,7 @@ public partial class ModelsOps
 
         public virtual Task WithLambdaAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithLambda(Lambda body) => throw null;
+        public virtual ClientResult WithLambda(Lambda body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithLambdaAsync(Lambda body, CancellationToken cancellationToken = default) => throw null;
 
@@ -212,7 +212,7 @@ public partial class ModelsOps
 
         public virtual Task WithNotAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithNot(Not body) => throw null;
+        public virtual ClientResult WithNot(Not body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithNotAsync(Not body, CancellationToken cancellationToken = default) => throw null;
 
@@ -220,7 +220,7 @@ public partial class ModelsOps
 
         public virtual Task WithOrAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithOr(Or body) => throw null;
+        public virtual ClientResult WithOr(Or body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithOrAsync(Or body, CancellationToken cancellationToken = default) => throw null;
 
@@ -228,7 +228,7 @@ public partial class ModelsOps
 
         public virtual Task WithPassAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithPass(Pass body) => throw null;
+        public virtual ClientResult WithPass(Pass body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithPassAsync(Pass body, CancellationToken cancellationToken = default) => throw null;
 
@@ -236,7 +236,7 @@ public partial class ModelsOps
 
         public virtual Task WithRaiseAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithRaise(Raise body) => throw null;
+        public virtual ClientResult WithRaise(Raise body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithRaiseAsync(Raise body, CancellationToken cancellationToken = default) => throw null;
 
@@ -244,7 +244,7 @@ public partial class ModelsOps
 
         public virtual Task WithReturnAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithReturn(Return body) => throw null;
+        public virtual ClientResult WithReturn(Return body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithReturnAsync(Return body, CancellationToken cancellationToken = default) => throw null;
 
@@ -252,7 +252,7 @@ public partial class ModelsOps
 
         public virtual Task WithTryAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithTry(Try body) => throw null;
+        public virtual ClientResult WithTry(Try body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithTryAsync(Try body, CancellationToken cancellationToken = default) => throw null;
 
@@ -260,7 +260,7 @@ public partial class ModelsOps
 
         public virtual Task WithWhileAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithWhile(While body) => throw null;
+        public virtual ClientResult WithWhile(While body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithWhileAsync(While body, CancellationToken cancellationToken = default) => throw null;
 
@@ -268,7 +268,7 @@ public partial class ModelsOps
 
         public virtual Task WithWithAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithWith(With body) => throw null;
+        public virtual ClientResult WithWith(With body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithWithAsync(With body, CancellationToken cancellationToken = default) => throw null;
 
@@ -276,7 +276,7 @@ public partial class ModelsOps
 
         public virtual Task WithYieldAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult WithYield(Yield body) => throw null;
+        public virtual ClientResult WithYield(Yield body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithYieldAsync(Yield body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Operations.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Operations.cs
index db9b2beb3a..bb367d9e0e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Operations.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Operations.cs
@@ -19,7 +19,7 @@ public partial class Operations
 
         public virtual Task AndAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult And() => throw null;
+        public virtual ClientResult And(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AndAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Operations
 
         public virtual Task AsAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult As() => throw null;
+        public virtual ClientResult As(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AsAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Operations
 
         public virtual Task AssertAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Assert() => throw null;
+        public virtual ClientResult Assert(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AssertAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -43,7 +43,7 @@ public partial class Operations
 
         public virtual Task AsyncAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Async() => throw null;
+        public virtual ClientResult Async(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AsyncAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -51,7 +51,7 @@ public partial class Operations
 
         public virtual Task AwaitAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Await() => throw null;
+        public virtual ClientResult Await(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task AwaitAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -59,7 +59,7 @@ public partial class Operations
 
         public virtual Task BreakAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Break() => throw null;
+        public virtual ClientResult Break(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task BreakAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -67,7 +67,7 @@ public partial class Operations
 
         public virtual Task ClassAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Class() => throw null;
+        public virtual ClientResult Class(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ClassAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -75,7 +75,7 @@ public partial class Operations
 
         public virtual Task ConstructorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Constructor() => throw null;
+        public virtual ClientResult Constructor(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ConstructorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -83,7 +83,7 @@ public partial class Operations
 
         public virtual Task ContinueAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Continue() => throw null;
+        public virtual ClientResult Continue(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ContinueAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -91,7 +91,7 @@ public partial class Operations
 
         public virtual Task DefAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Def() => throw null;
+        public virtual ClientResult Def(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DefAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -99,7 +99,7 @@ public partial class Operations
 
         public virtual Task DelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Del() => throw null;
+        public virtual ClientResult Del(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -107,7 +107,7 @@ public partial class Operations
 
         public virtual Task ElifAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Elif() => throw null;
+        public virtual ClientResult Elif(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ElifAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -115,7 +115,7 @@ public partial class Operations
 
         public virtual Task ElseAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Else() => throw null;
+        public virtual ClientResult Else(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ElseAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -123,7 +123,7 @@ public partial class Operations
 
         public virtual Task ExceptAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Except() => throw null;
+        public virtual ClientResult Except(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ExceptAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -131,7 +131,7 @@ public partial class Operations
 
         public virtual Task ExecAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Exec() => throw null;
+        public virtual ClientResult Exec(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ExecAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -139,7 +139,7 @@ public partial class Operations
 
         public virtual Task FinallyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Finally() => throw null;
+        public virtual ClientResult Finally(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FinallyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -147,7 +147,7 @@ public partial class Operations
 
         public virtual Task ForAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult For() => throw null;
+        public virtual ClientResult For(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ForAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -155,7 +155,7 @@ public partial class Operations
 
         public virtual Task FromAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult From() => throw null;
+        public virtual ClientResult From(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task FromAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -163,7 +163,7 @@ public partial class Operations
 
         public virtual Task GlobalAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Global() => throw null;
+        public virtual ClientResult Global(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task GlobalAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -171,7 +171,7 @@ public partial class Operations
 
         public virtual Task IfAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult If() => throw null;
+        public virtual ClientResult If(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task IfAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -179,7 +179,7 @@ public partial class Operations
 
         public virtual Task ImportAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Import() => throw null;
+        public virtual ClientResult Import(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ImportAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -187,7 +187,7 @@ public partial class Operations
 
         public virtual Task InAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult In() => throw null;
+        public virtual ClientResult In(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task InAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -195,7 +195,7 @@ public partial class Operations
 
         public virtual Task IsAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Is() => throw null;
+        public virtual ClientResult Is(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task IsAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -203,7 +203,7 @@ public partial class Operations
 
         public virtual Task LambdaAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Lambda() => throw null;
+        public virtual ClientResult Lambda(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task LambdaAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -211,7 +211,7 @@ public partial class Operations
 
         public virtual Task NotAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Not() => throw null;
+        public virtual ClientResult Not(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task NotAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -219,7 +219,7 @@ public partial class Operations
 
         public virtual Task OrAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Or() => throw null;
+        public virtual ClientResult Or(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task OrAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -227,7 +227,7 @@ public partial class Operations
 
         public virtual Task PassAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Pass() => throw null;
+        public virtual ClientResult Pass(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PassAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -235,7 +235,7 @@ public partial class Operations
 
         public virtual Task RaiseAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Raise() => throw null;
+        public virtual ClientResult Raise(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RaiseAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -243,7 +243,7 @@ public partial class Operations
 
         public virtual Task ReturnAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Return() => throw null;
+        public virtual ClientResult Return(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task ReturnAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -251,7 +251,7 @@ public partial class Operations
 
         public virtual Task TryAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Try() => throw null;
+        public virtual ClientResult Try(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task TryAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -259,7 +259,7 @@ public partial class Operations
 
         public virtual Task WhileAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult While() => throw null;
+        public virtual ClientResult While(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WhileAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -267,7 +267,7 @@ public partial class Operations
 
         public virtual Task WithAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult With() => throw null;
+        public virtual ClientResult With(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -275,7 +275,7 @@ public partial class Operations
 
         public virtual Task YieldAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Yield() => throw null;
+        public virtual ClientResult Yield(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task YieldAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Parameters.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Parameters.cs
index 905a642753..a489749d1a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Parameters.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-words/src/Generated/Parameters.cs
@@ -19,7 +19,7 @@ public partial class Parameters
 
         public virtual Task WithAndAsync(string @and, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithAnd(string @and) => throw null;
+        public virtual ClientResult WithAnd(string @and, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAndAsync(string @and, CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Parameters
 
         public virtual Task WithAsAsync(string @as, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithAs(string @as) => throw null;
+        public virtual ClientResult WithAs(string @as, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAsAsync(string @as, CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Parameters
 
         public virtual Task WithAssertAsync(string assert, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithAssert(string assert) => throw null;
+        public virtual ClientResult WithAssert(string assert, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAssertAsync(string assert, CancellationToken cancellationToken = default) => throw null;
 
@@ -43,7 +43,7 @@ public partial class Parameters
 
         public virtual Task WithAsyncAsync(string @async, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithAsync(string @async) => throw null;
+        public virtual ClientResult WithAsync(string @async, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAsyncAsync(string @async, CancellationToken cancellationToken = default) => throw null;
 
@@ -51,7 +51,7 @@ public partial class Parameters
 
         public virtual Task WithAwaitAsync(string @await, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithAwait(string @await) => throw null;
+        public virtual ClientResult WithAwait(string @await, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithAwaitAsync(string @await, CancellationToken cancellationToken = default) => throw null;
 
@@ -59,7 +59,7 @@ public partial class Parameters
 
         public virtual Task WithBreakAsync(string @break, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithBreak(string @break) => throw null;
+        public virtual ClientResult WithBreak(string @break, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithBreakAsync(string @break, CancellationToken cancellationToken = default) => throw null;
 
@@ -67,7 +67,7 @@ public partial class Parameters
 
         public virtual Task WithClassAsync(string @class, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithClass(string @class) => throw null;
+        public virtual ClientResult WithClass(string @class, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithClassAsync(string @class, CancellationToken cancellationToken = default) => throw null;
 
@@ -75,7 +75,7 @@ public partial class Parameters
 
         public virtual Task WithConstructorAsync(string constructor, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithConstructor(string constructor) => throw null;
+        public virtual ClientResult WithConstructor(string constructor, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithConstructorAsync(string constructor, CancellationToken cancellationToken = default) => throw null;
 
@@ -83,7 +83,7 @@ public partial class Parameters
 
         public virtual Task WithContinueAsync(string @continue, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithContinue(string @continue) => throw null;
+        public virtual ClientResult WithContinue(string @continue, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithContinueAsync(string @continue, CancellationToken cancellationToken = default) => throw null;
 
@@ -91,7 +91,7 @@ public partial class Parameters
 
         public virtual Task WithDefAsync(string def, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithDef(string def) => throw null;
+        public virtual ClientResult WithDef(string def, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithDefAsync(string def, CancellationToken cancellationToken = default) => throw null;
 
@@ -99,7 +99,7 @@ public partial class Parameters
 
         public virtual Task WithDelAsync(string del, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithDel(string del) => throw null;
+        public virtual ClientResult WithDel(string del, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithDelAsync(string del, CancellationToken cancellationToken = default) => throw null;
 
@@ -107,7 +107,7 @@ public partial class Parameters
 
         public virtual Task WithElifAsync(string elif, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithElif(string elif) => throw null;
+        public virtual ClientResult WithElif(string elif, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithElifAsync(string elif, CancellationToken cancellationToken = default) => throw null;
 
@@ -115,7 +115,7 @@ public partial class Parameters
 
         public virtual Task WithElseAsync(string @else, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithElse(string @else) => throw null;
+        public virtual ClientResult WithElse(string @else, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithElseAsync(string @else, CancellationToken cancellationToken = default) => throw null;
 
@@ -123,7 +123,7 @@ public partial class Parameters
 
         public virtual Task WithExceptAsync(string except, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithExcept(string except) => throw null;
+        public virtual ClientResult WithExcept(string except, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithExceptAsync(string except, CancellationToken cancellationToken = default) => throw null;
 
@@ -131,7 +131,7 @@ public partial class Parameters
 
         public virtual Task WithExecAsync(string exec, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithExec(string exec) => throw null;
+        public virtual ClientResult WithExec(string exec, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithExecAsync(string exec, CancellationToken cancellationToken = default) => throw null;
 
@@ -139,7 +139,7 @@ public partial class Parameters
 
         public virtual Task WithFinallyAsync(string @finally, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithFinally(string @finally) => throw null;
+        public virtual ClientResult WithFinally(string @finally, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithFinallyAsync(string @finally, CancellationToken cancellationToken = default) => throw null;
 
@@ -147,7 +147,7 @@ public partial class Parameters
 
         public virtual Task WithForAsync(string @for, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithFor(string @for) => throw null;
+        public virtual ClientResult WithFor(string @for, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithForAsync(string @for, CancellationToken cancellationToken = default) => throw null;
 
@@ -155,7 +155,7 @@ public partial class Parameters
 
         public virtual Task WithFromAsync(string @from, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithFrom(string @from) => throw null;
+        public virtual ClientResult WithFrom(string @from, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithFromAsync(string @from, CancellationToken cancellationToken = default) => throw null;
 
@@ -163,7 +163,7 @@ public partial class Parameters
 
         public virtual Task WithGlobalAsync(string @global, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithGlobal(string @global) => throw null;
+        public virtual ClientResult WithGlobal(string @global, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithGlobalAsync(string @global, CancellationToken cancellationToken = default) => throw null;
 
@@ -171,7 +171,7 @@ public partial class Parameters
 
         public virtual Task WithIfAsync(string @if, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithIf(string @if) => throw null;
+        public virtual ClientResult WithIf(string @if, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithIfAsync(string @if, CancellationToken cancellationToken = default) => throw null;
 
@@ -179,7 +179,7 @@ public partial class Parameters
 
         public virtual Task WithImportAsync(string import, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithImport(string import) => throw null;
+        public virtual ClientResult WithImport(string import, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithImportAsync(string import, CancellationToken cancellationToken = default) => throw null;
 
@@ -187,7 +187,7 @@ public partial class Parameters
 
         public virtual Task WithInAsync(string @in, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithIn(string @in) => throw null;
+        public virtual ClientResult WithIn(string @in, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithInAsync(string @in, CancellationToken cancellationToken = default) => throw null;
 
@@ -195,7 +195,7 @@ public partial class Parameters
 
         public virtual Task WithIsAsync(string @is, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithIs(string @is) => throw null;
+        public virtual ClientResult WithIs(string @is, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithIsAsync(string @is, CancellationToken cancellationToken = default) => throw null;
 
@@ -203,7 +203,7 @@ public partial class Parameters
 
         public virtual Task WithLambdaAsync(string lambda, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithLambda(string lambda) => throw null;
+        public virtual ClientResult WithLambda(string lambda, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithLambdaAsync(string lambda, CancellationToken cancellationToken = default) => throw null;
 
@@ -211,7 +211,7 @@ public partial class Parameters
 
         public virtual Task WithNotAsync(string @not, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithNot(string @not) => throw null;
+        public virtual ClientResult WithNot(string @not, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithNotAsync(string @not, CancellationToken cancellationToken = default) => throw null;
 
@@ -219,7 +219,7 @@ public partial class Parameters
 
         public virtual Task WithOrAsync(string @or, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithOr(string @or) => throw null;
+        public virtual ClientResult WithOr(string @or, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithOrAsync(string @or, CancellationToken cancellationToken = default) => throw null;
 
@@ -227,7 +227,7 @@ public partial class Parameters
 
         public virtual Task WithPassAsync(string pass, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithPass(string pass) => throw null;
+        public virtual ClientResult WithPass(string pass, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithPassAsync(string pass, CancellationToken cancellationToken = default) => throw null;
 
@@ -235,7 +235,7 @@ public partial class Parameters
 
         public virtual Task WithRaiseAsync(string raise, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithRaise(string raise) => throw null;
+        public virtual ClientResult WithRaise(string raise, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithRaiseAsync(string raise, CancellationToken cancellationToken = default) => throw null;
 
@@ -243,7 +243,7 @@ public partial class Parameters
 
         public virtual Task WithReturnAsync(string @return, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithReturn(string @return) => throw null;
+        public virtual ClientResult WithReturn(string @return, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithReturnAsync(string @return, CancellationToken cancellationToken = default) => throw null;
 
@@ -251,7 +251,7 @@ public partial class Parameters
 
         public virtual Task WithTryAsync(string @try, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithTry(string @try) => throw null;
+        public virtual ClientResult WithTry(string @try, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithTryAsync(string @try, CancellationToken cancellationToken = default) => throw null;
 
@@ -259,7 +259,7 @@ public partial class Parameters
 
         public virtual Task WithWhileAsync(string @while, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithWhile(string @while) => throw null;
+        public virtual ClientResult WithWhile(string @while, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithWhileAsync(string @while, CancellationToken cancellationToken = default) => throw null;
 
@@ -267,7 +267,7 @@ public partial class Parameters
 
         public virtual Task WithWithAsync(string @with, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithWith(string @with) => throw null;
+        public virtual ClientResult WithWith(string @with, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithWithAsync(string @with, CancellationToken cancellationToken = default) => throw null;
 
@@ -275,7 +275,7 @@ public partial class Parameters
 
         public virtual Task WithYieldAsync(string @yield, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithYield(string @yield) => throw null;
+        public virtual ClientResult WithYield(string @yield, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task WithYieldAsync(string @yield, CancellationToken cancellationToken = default) => throw null;
 
@@ -283,7 +283,7 @@ public partial class Parameters
 
         public virtual Task WithCancellationTokenAsync(string cancellationToken, RequestOptions options) => throw null;
 
-        public virtual ClientResult WithCancellationToken(string cancellationToken) => throw null;
+        public virtual ClientResult WithCancellationToken(string cancellationToken, CancellationToken cancellationToken0 = default) => throw null;
 
         public virtual Task WithCancellationTokenAsync(string cancellationToken, CancellationToken cancellationToken0 = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/BooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/BooleanValue.cs
index 1b800048e7..9fc20e0c2b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/BooleanValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/BooleanValue.cs
@@ -20,7 +20,7 @@ public partial class BooleanValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class BooleanValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DatetimeValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DatetimeValue.cs
index f3e27e2237..deccfdbaf6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DatetimeValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DatetimeValue.cs
@@ -21,7 +21,7 @@ public partial class DatetimeValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class DatetimeValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DurationValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DurationValue.cs
index 5a4b6f8630..cd0211f890 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DurationValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/DurationValue.cs
@@ -21,7 +21,7 @@ public partial class DurationValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class DurationValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Float32Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Float32Value.cs
index 86858d6e80..c441fd659b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Float32Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Float32Value.cs
@@ -20,7 +20,7 @@ public partial class Float32Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Float32Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int32Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int32Value.cs
index 92affa96e1..ce83b6431e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int32Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int32Value.cs
@@ -20,7 +20,7 @@ public partial class Int32Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Int32Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int64Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int64Value.cs
index 9857253665..8eb1865b54 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int64Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/Int64Value.cs
@@ -20,7 +20,7 @@ public partial class Int64Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Int64Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/ModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/ModelValue.cs
index f4928dff07..7aae49a145 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/ModelValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/ModelValue.cs
@@ -21,7 +21,7 @@ public partial class ModelValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class ModelValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableBooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableBooleanValue.cs
index 8922fba736..023d81c417 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableBooleanValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableBooleanValue.cs
@@ -20,7 +20,7 @@ public partial class NullableBooleanValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class NullableBooleanValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableFloatValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableFloatValue.cs
index c0e16fc1e1..cdff8174fb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableFloatValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableFloatValue.cs
@@ -20,7 +20,7 @@ public partial class NullableFloatValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class NullableFloatValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableInt32Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableInt32Value.cs
index 2343855fd5..f7623a675e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableInt32Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableInt32Value.cs
@@ -20,7 +20,7 @@ public partial class NullableInt32Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class NullableInt32Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableModelValue.cs
index 412174b2be..0caabc37ce 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableModelValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableModelValue.cs
@@ -21,7 +21,7 @@ public partial class NullableModelValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class NullableModelValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableStringValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableStringValue.cs
index 7c844b6dba..6ae4dc2e66 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableStringValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/NullableStringValue.cs
@@ -20,7 +20,7 @@ public partial class NullableStringValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class NullableStringValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/StringValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/StringValue.cs
index 2cc70b0f13..36230a3fa0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/StringValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/StringValue.cs
@@ -20,7 +20,7 @@ public partial class StringValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/UnknownValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/UnknownValue.cs
index 1a84f30ed0..350ae306a1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/UnknownValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/array/src/Generated/UnknownValue.cs
@@ -21,7 +21,7 @@ public partial class UnknownValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class UnknownValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IEnumerable body) => throw null;
+        public virtual ClientResult Put(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IEnumerable body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/BooleanValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/BooleanValue.cs
index d38c757eb4..58869c99dc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/BooleanValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/BooleanValue.cs
@@ -20,7 +20,7 @@ public partial class BooleanValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class BooleanValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DatetimeValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DatetimeValue.cs
index fc564fde4f..97cffdfde9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DatetimeValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DatetimeValue.cs
@@ -21,7 +21,7 @@ public partial class DatetimeValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class DatetimeValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DurationValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DurationValue.cs
index db50e64f33..40ebceeefc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DurationValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/DurationValue.cs
@@ -21,7 +21,7 @@ public partial class DurationValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class DurationValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Float32Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Float32Value.cs
index fe304395ca..a08fd4acdd 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Float32Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Float32Value.cs
@@ -20,7 +20,7 @@ public partial class Float32Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Float32Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int32Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int32Value.cs
index d015e3264f..4408ee93d5 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int32Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int32Value.cs
@@ -20,7 +20,7 @@ public partial class Int32Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Int32Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int64Value.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int64Value.cs
index a8afa024cf..c5bff56c84 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int64Value.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/Int64Value.cs
@@ -20,7 +20,7 @@ public partial class Int64Value
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Int64Value
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/ModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/ModelValue.cs
index 89600b07f1..bae8ed5f43 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/ModelValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/ModelValue.cs
@@ -21,7 +21,7 @@ public partial class ModelValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class ModelValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/NullableFloatValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/NullableFloatValue.cs
index 20770c47b5..f4113eea94 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/NullableFloatValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/NullableFloatValue.cs
@@ -20,7 +20,7 @@ public partial class NullableFloatValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class NullableFloatValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/RecursiveModelValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/RecursiveModelValue.cs
index 32bbfbd6e0..2526a333be 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/RecursiveModelValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/RecursiveModelValue.cs
@@ -21,7 +21,7 @@ public partial class RecursiveModelValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class RecursiveModelValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/StringValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/StringValue.cs
index b18c84442a..fd7b77adf8 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/StringValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/StringValue.cs
@@ -20,7 +20,7 @@ public partial class StringValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/UnknownValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/UnknownValue.cs
index dd4bb9bd24..471d71a871 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/UnknownValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/dictionary/src/Generated/UnknownValue.cs
@@ -21,7 +21,7 @@ public partial class UnknownValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> Get() => throw null;
+        public virtual ClientResult> Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class UnknownValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IDictionary body) => throw null;
+        public virtual ClientResult Put(IDictionary body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IDictionary body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/extensible/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/extensible/src/Generated/String.cs
index 2af8dcb5f7..ef9d25a807 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/extensible/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/extensible/src/Generated/String.cs
@@ -20,7 +20,7 @@ public partial class String
 
         public virtual Task GetKnownValueAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetKnownValue() => throw null;
+        public virtual ClientResult GetKnownValue(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetKnownValueAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class String
 
         public virtual Task GetUnknownValueAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetUnknownValue() => throw null;
+        public virtual ClientResult GetUnknownValue(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetUnknownValueAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class String
 
         public virtual Task PutKnownValueAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutKnownValue(DaysOfWeekExtensibleEnum body) => throw null;
+        public virtual ClientResult PutKnownValue(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutKnownValueAsync(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class String
 
         public virtual Task PutUnknownValueAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutUnknownValue(DaysOfWeekExtensibleEnum body) => throw null;
+        public virtual ClientResult PutUnknownValue(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutUnknownValueAsync(DaysOfWeekExtensibleEnum body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/fixed/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/fixed/src/Generated/String.cs
index 4865af4e44..03ba5cafdf 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/fixed/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/enum/fixed/src/Generated/String.cs
@@ -20,7 +20,7 @@ public partial class String
 
         public virtual Task GetKnownValueAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetKnownValue() => throw null;
+        public virtual ClientResult GetKnownValue(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetKnownValueAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class String
 
         public virtual Task PutKnownValueAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutKnownValue(DaysOfWeekEnum body) => throw null;
+        public virtual ClientResult PutKnownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutKnownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class String
 
         public virtual Task PutUnknownValueAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutUnknownValue(DaysOfWeekEnum body) => throw null;
+        public virtual ClientResult PutUnknownValue(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutUnknownValueAsync(DaysOfWeekEnum body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/empty/src/Generated/EmptyClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/empty/src/Generated/EmptyClient.cs
index 6387e2bba4..a6075f0ee9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/empty/src/Generated/EmptyClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/empty/src/Generated/EmptyClient.cs
@@ -23,7 +23,7 @@ public partial class EmptyClient
 
         public virtual Task PutEmptyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutEmpty(EmptyInput input) => throw null;
+        public virtual ClientResult PutEmpty(EmptyInput input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutEmptyAsync(EmptyInput input, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class EmptyClient
 
         public virtual Task GetEmptyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetEmpty() => throw null;
+        public virtual ClientResult GetEmpty(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetEmptyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class EmptyClient
 
         public virtual Task PostRoundTripEmptyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PostRoundTripEmpty(EmptyInputOutput body) => throw null;
+        public virtual ClientResult PostRoundTripEmpty(EmptyInputOutput body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> PostRoundTripEmptyAsync(EmptyInputOutput body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs
index 8e41fc5469..0fb262b7f9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/enum-discriminator/src/Generated/EnumDiscriminatorClient.cs
@@ -23,7 +23,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetExtensibleModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetExtensibleModel() => throw null;
+        public virtual ClientResult GetExtensibleModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetExtensibleModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task PutExtensibleModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutExtensibleModel(Dog input) => throw null;
+        public virtual ClientResult PutExtensibleModel(Dog input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutExtensibleModelAsync(Dog input, CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetExtensibleModelMissingDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetExtensibleModelMissingDiscriminator() => throw null;
+        public virtual ClientResult GetExtensibleModelMissingDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetExtensibleModelMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -47,7 +47,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetExtensibleModelWrongDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetExtensibleModelWrongDiscriminator() => throw null;
+        public virtual ClientResult GetExtensibleModelWrongDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetExtensibleModelWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -55,7 +55,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetFixedModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetFixedModel() => throw null;
+        public virtual ClientResult GetFixedModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetFixedModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -63,7 +63,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task PutFixedModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutFixedModel(Snake input) => throw null;
+        public virtual ClientResult PutFixedModel(Snake input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutFixedModelAsync(Snake input, CancellationToken cancellationToken = default) => throw null;
 
@@ -71,7 +71,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetFixedModelMissingDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetFixedModelMissingDiscriminator() => throw null;
+        public virtual ClientResult GetFixedModelMissingDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetFixedModelMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -79,7 +79,7 @@ public partial class EnumDiscriminatorClient
 
         public virtual Task GetFixedModelWrongDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetFixedModelWrongDiscriminator() => throw null;
+        public virtual ClientResult GetFixedModelWrongDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetFixedModelWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs
index 2026c15162..5bc2d771b9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/nested-discriminator/src/Generated/NestedDiscriminatorClient.cs
@@ -23,7 +23,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task GetModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetModel() => throw null;
+        public virtual ClientResult GetModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task PutModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutModel(Fish input) => throw null;
+        public virtual ClientResult PutModel(Fish input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutModelAsync(Fish input, CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task GetRecursiveModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetRecursiveModel() => throw null;
+        public virtual ClientResult GetRecursiveModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetRecursiveModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -47,7 +47,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task PutRecursiveModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutRecursiveModel(Fish input) => throw null;
+        public virtual ClientResult PutRecursiveModel(Fish input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutRecursiveModelAsync(Fish input, CancellationToken cancellationToken = default) => throw null;
 
@@ -55,7 +55,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task GetMissingDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetMissingDiscriminator() => throw null;
+        public virtual ClientResult GetMissingDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -63,7 +63,7 @@ public partial class NestedDiscriminatorClient
 
         public virtual Task GetWrongDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetWrongDiscriminator() => throw null;
+        public virtual ClientResult GetWrongDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs
index 3caa1d4ac4..fd6cef19cb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/not-discriminated/src/Generated/NotDiscriminatedClient.cs
@@ -23,7 +23,7 @@ public partial class NotDiscriminatedClient
 
         public virtual Task PostValidAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PostValid(Siamese input) => throw null;
+        public virtual ClientResult PostValid(Siamese input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PostValidAsync(Siamese input, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class NotDiscriminatedClient
 
         public virtual Task GetValidAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetValid() => throw null;
+        public virtual ClientResult GetValid(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetValidAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class NotDiscriminatedClient
 
         public virtual Task PutValidAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutValid(Siamese input) => throw null;
+        public virtual ClientResult PutValid(Siamese input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> PutValidAsync(Siamese input, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs
index 5c8dec7c24..e5e8fd0ed4 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/recursive/src/Generated/RecursiveClient.cs
@@ -23,7 +23,7 @@ public partial class RecursiveClient
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(Extension input) => throw null;
+        public virtual ClientResult Put(Extension input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(Extension input, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class RecursiveClient
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs
index 793a1c0c87..15e73e5f86 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/inheritance/single-discriminator/src/Generated/SingleDiscriminatorClient.cs
@@ -23,7 +23,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task GetModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetModel() => throw null;
+        public virtual ClientResult GetModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task PutModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutModel(Bird input) => throw null;
+        public virtual ClientResult PutModel(Bird input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutModelAsync(Bird input, CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task GetRecursiveModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetRecursiveModel() => throw null;
+        public virtual ClientResult GetRecursiveModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetRecursiveModelAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -47,7 +47,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task PutRecursiveModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutRecursiveModel(Bird input) => throw null;
+        public virtual ClientResult PutRecursiveModel(Bird input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutRecursiveModelAsync(Bird input, CancellationToken cancellationToken = default) => throw null;
 
@@ -55,7 +55,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task GetMissingDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetMissingDiscriminator() => throw null;
+        public virtual ClientResult GetMissingDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetMissingDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -63,7 +63,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task GetWrongDiscriminatorAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetWrongDiscriminator() => throw null;
+        public virtual ClientResult GetWrongDiscriminator(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetWrongDiscriminatorAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -71,7 +71,7 @@ public partial class SingleDiscriminatorClient
 
         public virtual Task GetLegacyModelAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetLegacyModel() => throw null;
+        public virtual ClientResult GetLegacyModel(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetLegacyModelAsync(CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/usage/src/Generated/UsageClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/usage/src/Generated/UsageClient.cs
index 5e8ed26c7c..1e9687b46a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/usage/src/Generated/UsageClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/usage/src/Generated/UsageClient.cs
@@ -23,7 +23,7 @@ public partial class UsageClient
 
         public virtual Task InputAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Input(InputRecord input) => throw null;
+        public virtual ClientResult Input(InputRecord input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task InputAsync(InputRecord input, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class UsageClient
 
         public virtual Task OutputAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Output() => throw null;
+        public virtual ClientResult Output(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> OutputAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class UsageClient
 
         public virtual Task InputAndOutputAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult InputAndOutput(InputOutputRecord body) => throw null;
+        public virtual ClientResult InputAndOutput(InputOutputRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> InputAndOutputAsync(InputOutputRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/visibility/src/Generated/VisibilityClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/visibility/src/Generated/VisibilityClient.cs
index 7edccdf5de..f5c6e7f27b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/visibility/src/Generated/VisibilityClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/model/visibility/src/Generated/VisibilityClient.cs
@@ -23,7 +23,7 @@ public partial class VisibilityClient
 
         public virtual Task GetModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult GetModel(VisibilityModel input) => throw null;
+        public virtual ClientResult GetModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
@@ -31,7 +31,7 @@ public partial class VisibilityClient
 
         public virtual Task HeadModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult HeadModel(VisibilityModel input) => throw null;
+        public virtual ClientResult HeadModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task HeadModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
@@ -39,7 +39,7 @@ public partial class VisibilityClient
 
         public virtual Task PutModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutModel(VisibilityModel input) => throw null;
+        public virtual ClientResult PutModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
@@ -51,7 +51,7 @@ public partial class VisibilityClient
 
         public virtual Task PostModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PostModel(VisibilityModel input) => throw null;
+        public virtual ClientResult PostModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PostModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
@@ -59,7 +59,7 @@ public partial class VisibilityClient
 
         public virtual Task DeleteModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult DeleteModel(VisibilityModel input) => throw null;
+        public virtual ClientResult DeleteModel(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task DeleteModelAsync(VisibilityModel input, CancellationToken cancellationToken = default) => throw null;
 
@@ -67,7 +67,7 @@ public partial class VisibilityClient
 
         public virtual Task PutReadOnlyModelAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutReadOnlyModel(ReadOnlyModel input) => throw null;
+        public virtual ClientResult PutReadOnlyModel(ReadOnlyModel input, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> PutReadOnlyModelAsync(ReadOnlyModel input, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs
index ab73615a83..6ddeb10c36 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadFloat.cs
@@ -20,7 +20,7 @@ public partial class ExtendsDifferentSpreadFloat
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsDifferentSpreadFloat
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadFloatDerived body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadFloatDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadFloatDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs
index e743871eef..149d68643f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModel.cs
@@ -20,7 +20,7 @@ public partial class ExtendsDifferentSpreadModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsDifferentSpreadModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadModelDerived body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadModelDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadModelDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs
index 89b8c9d619..842983aeee 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadModelArray.cs
@@ -20,7 +20,7 @@ public partial class ExtendsDifferentSpreadModelArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsDifferentSpreadModelArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadModelArrayDerived body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadModelArrayDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadModelArrayDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs
index ebc4fed979..4500baa0fa 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsDifferentSpreadString.cs
@@ -20,7 +20,7 @@ public partial class ExtendsDifferentSpreadString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsDifferentSpreadString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadStringDerived body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadStringDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadStringDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs
index b3d380e6fa..f5c991644b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsFloat.cs
@@ -20,7 +20,7 @@ public partial class ExtendsFloat
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsFloat
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsFloatAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(ExtendsFloatAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsFloatAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModel.cs
index 35c4e3430f..8be28cbddb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModel.cs
@@ -20,7 +20,7 @@ public partial class ExtendsModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsModelAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(ExtendsModelAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsModelAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs
index e37e3791a3..fc91f14066 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsModelArray.cs
@@ -20,7 +20,7 @@ public partial class ExtendsModelArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsModelArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsModelArrayAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(ExtendsModelArrayAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsModelArrayAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsString.cs
index f93198254c..fd57374bb0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsString.cs
@@ -20,7 +20,7 @@ public partial class ExtendsString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsStringAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(ExtendsStringAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsStringAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs
index 7eeaf6f302..a56f77368e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknown.cs
@@ -20,7 +20,7 @@ public partial class ExtendsUnknown
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsUnknown
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsUnknownAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(ExtendsUnknownAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsUnknownAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs
index 95c624a3c1..dff5553044 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDerived.cs
@@ -20,7 +20,7 @@ public partial class ExtendsUnknownDerived
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsUnknownDerived
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsUnknownAdditionalPropertiesDerived body) => throw null;
+        public virtual ClientResult Put(ExtendsUnknownAdditionalPropertiesDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsUnknownAdditionalPropertiesDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs
index ab7479e1f5..892863d04c 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/ExtendsUnknownDiscriminated.cs
@@ -20,7 +20,7 @@ public partial class ExtendsUnknownDiscriminated
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtendsUnknownDiscriminated
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtendsUnknownAdditionalPropertiesDiscriminated body) => throw null;
+        public virtual ClientResult Put(ExtendsUnknownAdditionalPropertiesDiscriminated body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtendsUnknownAdditionalPropertiesDiscriminated body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsFloat.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsFloat.cs
index c12957705f..e5091bc5f0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsFloat.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsFloat.cs
@@ -20,7 +20,7 @@ public partial class IsFloat
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsFloat
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsFloatAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(IsFloatAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsFloatAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModel.cs
index 4cc7906c62..58afa817c6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModel.cs
@@ -20,7 +20,7 @@ public partial class IsModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsModelAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(IsModelAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsModelAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModelArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModelArray.cs
index 2ca47c59a6..ae5b723c37 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModelArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsModelArray.cs
@@ -20,7 +20,7 @@ public partial class IsModelArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsModelArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsModelArrayAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(IsModelArrayAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsModelArrayAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsString.cs
index 649896eb0f..74dbd82b94 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsString.cs
@@ -20,7 +20,7 @@ public partial class IsString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsStringAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(IsStringAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsStringAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknown.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknown.cs
index 3f04c0a31f..fa026e5942 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknown.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknown.cs
@@ -20,7 +20,7 @@ public partial class IsUnknown
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsUnknown
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsUnknownAdditionalProperties body) => throw null;
+        public virtual ClientResult Put(IsUnknownAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsUnknownAdditionalProperties body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs
index 449f6ca870..05a05af7c3 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDerived.cs
@@ -20,7 +20,7 @@ public partial class IsUnknownDerived
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsUnknownDerived
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsUnknownAdditionalPropertiesDerived body) => throw null;
+        public virtual ClientResult Put(IsUnknownAdditionalPropertiesDerived body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsUnknownAdditionalPropertiesDerived body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs
index 0e2b17309d..47352eb913 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/IsUnknownDiscriminated.cs
@@ -20,7 +20,7 @@ public partial class IsUnknownDiscriminated
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IsUnknownDiscriminated
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IsUnknownAdditionalPropertiesDiscriminated body) => throw null;
+        public virtual ClientResult Put(IsUnknownAdditionalPropertiesDiscriminated body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IsUnknownAdditionalPropertiesDiscriminated body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/MultipleSpread.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/MultipleSpread.cs
index 64dfb9b160..10ae6e3d1b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/MultipleSpread.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/MultipleSpread.cs
@@ -20,7 +20,7 @@ public partial class MultipleSpread
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class MultipleSpread
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(MultipleSpreadRecord body) => throw null;
+        public virtual ClientResult Put(MultipleSpreadRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(MultipleSpreadRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs
index cf670557aa..b45a0adf2e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentFloat.cs
@@ -20,7 +20,7 @@ public partial class SpreadDifferentFloat
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadDifferentFloat
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadFloatRecord body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadFloatRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadFloatRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs
index 71ae92d81e..7a4828d7a2 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModel.cs
@@ -20,7 +20,7 @@ public partial class SpreadDifferentModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadDifferentModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadModelRecord body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadModelRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadModelRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs
index 4b58472a7f..0929a2387e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentModelArray.cs
@@ -20,7 +20,7 @@ public partial class SpreadDifferentModelArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadDifferentModelArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadModelArrayRecord body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadModelArrayRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadModelArrayRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs
index affcc37fbb..f59f19462f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadDifferentString.cs
@@ -20,7 +20,7 @@ public partial class SpreadDifferentString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadDifferentString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DifferentSpreadStringRecord body) => throw null;
+        public virtual ClientResult Put(DifferentSpreadStringRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DifferentSpreadStringRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadFloat.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadFloat.cs
index 2d6de14e8a..2082be364c 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadFloat.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadFloat.cs
@@ -20,7 +20,7 @@ public partial class SpreadFloat
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadFloat
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadFloatRecord body) => throw null;
+        public virtual ClientResult Put(SpreadFloatRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadFloatRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModel.cs
index 3789416167..b3ec8e7861 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModel.cs
@@ -20,7 +20,7 @@ public partial class SpreadModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadModelRecord body) => throw null;
+        public virtual ClientResult Put(SpreadModelRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadModelRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs
index 73c75d5df0..d8277d84e7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadModelArray.cs
@@ -20,7 +20,7 @@ public partial class SpreadModelArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadModelArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadModelArrayRecord body) => throw null;
+        public virtual ClientResult Put(SpreadModelArrayRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadModelArrayRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordDiscriminatedUnion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordDiscriminatedUnion.cs
index 4fc0025d65..8439f72320 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordDiscriminatedUnion.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordDiscriminatedUnion.cs
@@ -20,7 +20,7 @@ public partial class SpreadRecordDiscriminatedUnion
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadRecordDiscriminatedUnion
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadRecordForDiscriminatedUnion body) => throw null;
+        public virtual ClientResult Put(SpreadRecordForDiscriminatedUnion body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadRecordForDiscriminatedUnion body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs
index 9831af4bed..9c2ab2bc54 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion.cs
@@ -20,7 +20,7 @@ public partial class SpreadRecordNonDiscriminatedUnion
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadRecordNonDiscriminatedUnion
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion body) => throw null;
+        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadRecordForNonDiscriminatedUnion body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs
index 131a566bb7..78fa7418d6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion2.cs
@@ -20,7 +20,7 @@ public partial class SpreadRecordNonDiscriminatedUnion2
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadRecordNonDiscriminatedUnion2
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion2 body) => throw null;
+        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadRecordForNonDiscriminatedUnion2 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs
index 883e8fcb8c..553ca1e753 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordNonDiscriminatedUnion3.cs
@@ -20,7 +20,7 @@ public partial class SpreadRecordNonDiscriminatedUnion3
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadRecordNonDiscriminatedUnion3
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion3 body) => throw null;
+        public virtual ClientResult Put(SpreadRecordForNonDiscriminatedUnion3 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadRecordForNonDiscriminatedUnion3 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs
index 4090deb4b6..433981d443 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadRecordUnion.cs
@@ -20,7 +20,7 @@ public partial class SpreadRecordUnion
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadRecordUnion
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadRecordForUnion body) => throw null;
+        public virtual ClientResult Put(SpreadRecordForUnion body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadRecordForUnion body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadString.cs
index 3d883bd638..1fff54b1f7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/additional-properties/src/Generated/SpreadString.cs
@@ -20,7 +20,7 @@ public partial class SpreadString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class SpreadString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(SpreadStringRecord body) => throw null;
+        public virtual ClientResult Put(SpreadStringRecord body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(SpreadStringRecord body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Bytes.cs
index 9e89539f95..e9b1af619d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Bytes.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Bytes.cs
@@ -20,7 +20,7 @@ public partial class Bytes
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Bytes
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsByte.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsByte.cs
index 65b27d8885..9726e1ae06 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsByte.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsByte.cs
@@ -20,7 +20,7 @@ public partial class CollectionsByte
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsByte
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsModel.cs
index cf1ac9e05a..6768e5300d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsModel.cs
@@ -20,7 +20,7 @@ public partial class CollectionsModel
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsModel
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsString.cs
index d0f494b64d..c3ee7a8235 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/CollectionsString.cs
@@ -20,7 +20,7 @@ public partial class CollectionsString
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsString
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Datetime.cs
index dc06e6a85b..97261713bd 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Datetime.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Datetime.cs
@@ -20,7 +20,7 @@ public partial class Datetime
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Datetime
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Duration.cs
index 89bd5d75a8..e19fa9a58a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Duration.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/Duration.cs
@@ -20,7 +20,7 @@ public partial class Duration
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Duration
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/String.cs
index 319c4307e4..830b393953 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/nullable/src/Generated/String.cs
@@ -20,7 +20,7 @@ public partial class String
 
         public virtual Task GetNonNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNonNull() => throw null;
+        public virtual ClientResult GetNonNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNonNullAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class String
 
         public virtual Task GetNullAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetNull() => throw null;
+        public virtual ClientResult GetNull(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetNullAsync(CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/BooleanLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/BooleanLiteral.cs
index b68ae5e72d..0a32a1a4a0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/BooleanLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/BooleanLiteral.cs
@@ -20,7 +20,7 @@ public partial class BooleanLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class BooleanLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class BooleanLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(BooleanLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class BooleanLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(BooleanLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Bytes.cs
index bd03c9ea22..ac2be4cccb 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Bytes.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Bytes.cs
@@ -20,7 +20,7 @@ public partial class Bytes
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Bytes
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Bytes
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(BytesProperty body) => throw null;
+        public virtual ClientResult PutAll(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Bytes
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(BytesProperty body) => throw null;
+        public virtual ClientResult PutDefault(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsByte.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsByte.cs
index 777167c644..d116273e9a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsByte.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsByte.cs
@@ -20,7 +20,7 @@ public partial class CollectionsByte
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsByte
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class CollectionsByte
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(CollectionsByteProperty body) => throw null;
+        public virtual ClientResult PutAll(CollectionsByteProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(CollectionsByteProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class CollectionsByte
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(CollectionsByteProperty body) => throw null;
+        public virtual ClientResult PutDefault(CollectionsByteProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(CollectionsByteProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsModel.cs
index c05e09c94f..0f209d4633 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/CollectionsModel.cs
@@ -20,7 +20,7 @@ public partial class CollectionsModel
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsModel
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class CollectionsModel
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(CollectionsModelProperty body) => throw null;
+        public virtual ClientResult PutAll(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class CollectionsModel
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(CollectionsModelProperty body) => throw null;
+        public virtual ClientResult PutDefault(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Datetime.cs
index 94036740cd..81574ddc84 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Datetime.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Datetime.cs
@@ -20,7 +20,7 @@ public partial class Datetime
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Datetime
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Datetime
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(DatetimeProperty body) => throw null;
+        public virtual ClientResult PutAll(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Datetime
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(DatetimeProperty body) => throw null;
+        public virtual ClientResult PutDefault(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Duration.cs
index 9acbe2bc29..18fb39f08e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Duration.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/Duration.cs
@@ -20,7 +20,7 @@ public partial class Duration
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Duration
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class Duration
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(DurationProperty body) => throw null;
+        public virtual ClientResult PutAll(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class Duration
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(DurationProperty body) => throw null;
+        public virtual ClientResult PutDefault(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/FloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/FloatLiteral.cs
index 0481709052..7bd2a98c71 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/FloatLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/FloatLiteral.cs
@@ -20,7 +20,7 @@ public partial class FloatLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class FloatLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class FloatLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(FloatLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class FloatLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(FloatLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/IntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/IntLiteral.cs
index 5c9c8b5bfb..af77e1f862 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/IntLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/IntLiteral.cs
@@ -20,7 +20,7 @@ public partial class IntLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IntLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class IntLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(IntLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class IntLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(IntLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainDate.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainDate.cs
index c96d5a34f4..0d841833f7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainDate.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainDate.cs
@@ -20,7 +20,7 @@ public partial class PlainDate
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PlainDate
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PlainDate
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(PlainDateProperty body) => throw null;
+        public virtual ClientResult PutAll(PlainDateProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(PlainDateProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class PlainDate
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(PlainDateProperty body) => throw null;
+        public virtual ClientResult PutDefault(PlainDateProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(PlainDateProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainTime.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainTime.cs
index 74758e22ee..e94179657f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainTime.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/PlainTime.cs
@@ -20,7 +20,7 @@ public partial class PlainTime
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class PlainTime
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class PlainTime
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(PlainTimeProperty body) => throw null;
+        public virtual ClientResult PutAll(PlainTimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(PlainTimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class PlainTime
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(PlainTimeProperty body) => throw null;
+        public virtual ClientResult PutDefault(PlainTimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(PlainTimeProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/RequiredAndOptional.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/RequiredAndOptional.cs
index 70901ae4f6..d074d37cbe 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/RequiredAndOptional.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/RequiredAndOptional.cs
@@ -20,7 +20,7 @@ public partial class RequiredAndOptional
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class RequiredAndOptional
 
         public virtual Task GetRequiredOnlyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetRequiredOnly() => throw null;
+        public virtual ClientResult GetRequiredOnly(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetRequiredOnlyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class RequiredAndOptional
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(RequiredAndOptionalProperty body) => throw null;
+        public virtual ClientResult PutAll(RequiredAndOptionalProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(RequiredAndOptionalProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class RequiredAndOptional
 
         public virtual Task PutRequiredOnlyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutRequiredOnly(RequiredAndOptionalProperty body) => throw null;
+        public virtual ClientResult PutRequiredOnly(RequiredAndOptionalProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutRequiredOnlyAsync(RequiredAndOptionalProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/String.cs
index 7938b75b1e..6a1259a912 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/String.cs
@@ -20,7 +20,7 @@ public partial class String
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class String
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class String
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(StringProperty body) => throw null;
+        public virtual ClientResult PutAll(StringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(StringProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class String
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(StringProperty body) => throw null;
+        public virtual ClientResult PutDefault(StringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(StringProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/StringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/StringLiteral.cs
index bb01f25c0d..ed6c1f30dc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/StringLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/StringLiteral.cs
@@ -20,7 +20,7 @@ public partial class StringLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class StringLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(StringLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class StringLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(StringLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs
index 9c01857f2d..c64ca77294 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionFloatLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(UnionFloatLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(UnionFloatLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionIntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionIntLiteral.cs
index 6dc1738964..e14701470b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionIntLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionIntLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionIntLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionIntLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class UnionIntLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(UnionIntLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class UnionIntLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(UnionIntLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionStringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionStringLiteral.cs
index ab29e73381..f504297e66 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionStringLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/optionality/src/Generated/UnionStringLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionStringLiteral
 
         public virtual Task GetAllAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetAll() => throw null;
+        public virtual ClientResult GetAll(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAllAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionStringLiteral
 
         public virtual Task GetDefaultAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult GetDefault() => throw null;
+        public virtual ClientResult GetDefault(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetDefaultAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -36,7 +36,7 @@ public partial class UnionStringLiteral
 
         public virtual Task PutAllAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutAll(UnionStringLiteralProperty body) => throw null;
+        public virtual ClientResult PutAll(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAllAsync(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
@@ -44,7 +44,7 @@ public partial class UnionStringLiteral
 
         public virtual Task PutDefaultAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult PutDefault(UnionStringLiteralProperty body) => throw null;
+        public virtual ClientResult PutDefault(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutDefaultAsync(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Boolean.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Boolean.cs
index bc46ea53e5..9d54b64170 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Boolean.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Boolean.cs
@@ -20,7 +20,7 @@ public partial class Boolean
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Boolean
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(BooleanProperty body) => throw null;
+        public virtual ClientResult Put(BooleanProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(BooleanProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/BooleanLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/BooleanLiteral.cs
index d7b3f7d8ce..f9d533fadf 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/BooleanLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/BooleanLiteral.cs
@@ -20,7 +20,7 @@ public partial class BooleanLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class BooleanLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(BooleanLiteralProperty body) => throw null;
+        public virtual ClientResult Put(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(BooleanLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Bytes.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Bytes.cs
index 1bd24b7030..43372c0edc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Bytes.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Bytes.cs
@@ -20,7 +20,7 @@ public partial class Bytes
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Bytes
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(BytesProperty body) => throw null;
+        public virtual ClientResult Put(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(BytesProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsInt.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsInt.cs
index 6a5c609b4d..5a16eb7ef1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsInt.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsInt.cs
@@ -20,7 +20,7 @@ public partial class CollectionsInt
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsInt
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(CollectionsIntProperty body) => throw null;
+        public virtual ClientResult Put(CollectionsIntProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(CollectionsIntProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsModel.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsModel.cs
index 9ee4fed560..6331be576b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsModel.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsModel.cs
@@ -20,7 +20,7 @@ public partial class CollectionsModel
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsModel
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(CollectionsModelProperty body) => throw null;
+        public virtual ClientResult Put(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(CollectionsModelProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsString.cs
index cf02464e56..bf25a2d266 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/CollectionsString.cs
@@ -20,7 +20,7 @@ public partial class CollectionsString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class CollectionsString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(CollectionsStringProperty body) => throw null;
+        public virtual ClientResult Put(CollectionsStringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(CollectionsStringProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Datetime.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Datetime.cs
index 0dc0280aa5..b5356f674b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Datetime.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Datetime.cs
@@ -20,7 +20,7 @@ public partial class Datetime
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Datetime
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DatetimeProperty body) => throw null;
+        public virtual ClientResult Put(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DatetimeProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal.cs
index 80de69c435..06d5a0296a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal.cs
@@ -20,7 +20,7 @@ public partial class Decimal
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Decimal
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DecimalProperty body) => throw null;
+        public virtual ClientResult Put(DecimalProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DecimalProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal128.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal128.cs
index d61aec9fe5..3008dfa386 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal128.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Decimal128.cs
@@ -20,7 +20,7 @@ public partial class Decimal128
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Decimal128
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(Decimal128Property body) => throw null;
+        public virtual ClientResult Put(Decimal128Property body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(Decimal128Property body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/DictionaryString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/DictionaryString.cs
index 2d2de223e2..1f4db6785b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/DictionaryString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/DictionaryString.cs
@@ -20,7 +20,7 @@ public partial class DictionaryString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class DictionaryString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DictionaryStringProperty body) => throw null;
+        public virtual ClientResult Put(DictionaryStringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DictionaryStringProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Duration.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Duration.cs
index 1ad767557a..7d7ba87f76 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Duration.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Duration.cs
@@ -20,7 +20,7 @@ public partial class Duration
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Duration
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(DurationProperty body) => throw null;
+        public virtual ClientResult Put(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(DurationProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Enum.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Enum.cs
index 613de14ba6..bf72853700 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Enum.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Enum.cs
@@ -20,7 +20,7 @@ public partial class Enum
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Enum
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(EnumProperty body) => throw null;
+        public virtual ClientResult Put(EnumProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(EnumProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/ExtensibleEnum.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/ExtensibleEnum.cs
index 85441ef2ad..170fab5479 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/ExtensibleEnum.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/ExtensibleEnum.cs
@@ -20,7 +20,7 @@ public partial class ExtensibleEnum
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class ExtensibleEnum
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ExtensibleEnumProperty body) => throw null;
+        public virtual ClientResult Put(ExtensibleEnumProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ExtensibleEnumProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Float.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Float.cs
index 0595166016..fb995cec26 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Float.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Float.cs
@@ -20,7 +20,7 @@ public partial class Float
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Float
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(FloatProperty body) => throw null;
+        public virtual ClientResult Put(FloatProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(FloatProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/FloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/FloatLiteral.cs
index 136a80f526..520d2c84fc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/FloatLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/FloatLiteral.cs
@@ -20,7 +20,7 @@ public partial class FloatLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class FloatLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(FloatLiteralProperty body) => throw null;
+        public virtual ClientResult Put(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(FloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Int.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Int.cs
index a383cab086..1ae6c8c891 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Int.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Int.cs
@@ -20,7 +20,7 @@ public partial class Int
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Int
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IntProperty body) => throw null;
+        public virtual ClientResult Put(IntProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IntProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/IntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/IntLiteral.cs
index ea7c49ddb7..41d5e985e1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/IntLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/IntLiteral.cs
@@ -20,7 +20,7 @@ public partial class IntLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IntLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(IntLiteralProperty body) => throw null;
+        public virtual ClientResult Put(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(IntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Model.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Model.cs
index 150e06783c..0a251ffc7d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Model.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Model.cs
@@ -20,7 +20,7 @@ public partial class Model
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Model
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(ModelProperty body) => throw null;
+        public virtual ClientResult Put(ModelProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(ModelProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Never.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Never.cs
index 5cbea0d440..1a7fe82aa6 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Never.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/Never.cs
@@ -20,7 +20,7 @@ public partial class Never
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Never
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(NeverProperty body) => throw null;
+        public virtual ClientResult Put(NeverProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(NeverProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/String.cs
index adae364cae..35fe0e825e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/String.cs
@@ -20,7 +20,7 @@ public partial class String
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class String
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(StringProperty body) => throw null;
+        public virtual ClientResult Put(StringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(StringProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/StringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/StringLiteral.cs
index 2522b57660..a1c71cae2b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/StringLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/StringLiteral.cs
@@ -20,7 +20,7 @@ public partial class StringLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(StringLiteralProperty body) => throw null;
+        public virtual ClientResult Put(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(StringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionEnumValue.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionEnumValue.cs
index 54cb1ee051..6eb221cb0f 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionEnumValue.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionEnumValue.cs
@@ -20,7 +20,7 @@ public partial class UnionEnumValue
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionEnumValue
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnionEnumValueProperty body) => throw null;
+        public virtual ClientResult Put(UnionEnumValueProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnionEnumValueProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs
index 1c22f8857c..9854397c85 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionFloatLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionFloatLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnionFloatLiteralProperty body) => throw null;
+        public virtual ClientResult Put(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnionFloatLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionIntLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionIntLiteral.cs
index 2bb5657af9..349f95c5f8 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionIntLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionIntLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionIntLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionIntLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnionIntLiteralProperty body) => throw null;
+        public virtual ClientResult Put(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnionIntLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionStringLiteral.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionStringLiteral.cs
index d3cfa25811..201ab5ae08 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionStringLiteral.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnionStringLiteral.cs
@@ -20,7 +20,7 @@ public partial class UnionStringLiteral
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnionStringLiteral
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnionStringLiteralProperty body) => throw null;
+        public virtual ClientResult Put(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnionStringLiteralProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownArray.cs
index 184470bc21..abb00dd897 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownArray.cs
@@ -20,7 +20,7 @@ public partial class UnknownArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnknownArray
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnknownArrayProperty body) => throw null;
+        public virtual ClientResult Put(UnknownArrayProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnknownArrayProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownDict.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownDict.cs
index 1bdf922f78..e123fdd906 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownDict.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownDict.cs
@@ -20,7 +20,7 @@ public partial class UnknownDict
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnknownDict
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnknownDictProperty body) => throw null;
+        public virtual ClientResult Put(UnknownDictProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnknownDictProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownInt.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownInt.cs
index f66a5c802a..352dc6a68a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownInt.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownInt.cs
@@ -20,7 +20,7 @@ public partial class UnknownInt
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnknownInt
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnknownIntProperty body) => throw null;
+        public virtual ClientResult Put(UnknownIntProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnknownIntProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownString.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownString.cs
index dc45d614bc..dbcf8b93ce 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownString.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/property/value-types/src/Generated/UnknownString.cs
@@ -20,7 +20,7 @@ public partial class UnknownString
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class UnknownString
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(UnknownStringProperty body) => throw null;
+        public virtual ClientResult Put(UnknownStringProperty body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(UnknownStringProperty body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Boolean.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Boolean.cs
index 3bbbd3d173..12a173aba7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Boolean.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Boolean.cs
@@ -19,7 +19,7 @@ public partial class Boolean
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Boolean
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(bool body) => throw null;
+        public virtual ClientResult Put(bool body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(bool body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Type.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Type.cs
index fda852ef0e..941ee7e41d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Type.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Type.cs
@@ -19,7 +19,7 @@ public partial class Decimal128Type
 
         public virtual Task ResponseBodyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ResponseBody() => throw null;
+        public virtual ClientResult ResponseBody(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> ResponseBodyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class Decimal128Type
 
         public virtual Task RequestBodyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult RequestBody(decimal body) => throw null;
+        public virtual ClientResult RequestBody(decimal body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequestBodyAsync(decimal body, CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class Decimal128Type
 
         public virtual Task RequestParameterAsync(decimal value, RequestOptions options) => throw null;
 
-        public virtual ClientResult RequestParameter(decimal value) => throw null;
+        public virtual ClientResult RequestParameter(decimal value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequestParameterAsync(decimal value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Verify.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Verify.cs
index e21c71ed9b..a59b85d215 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Verify.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Decimal128Verify.cs
@@ -20,7 +20,7 @@ public partial class Decimal128Verify
 
         public virtual Task PrepareVerifyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> PrepareVerify() => throw null;
+        public virtual ClientResult> PrepareVerify(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> PrepareVerifyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Decimal128Verify
 
         public virtual Task VerifyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Verify(decimal body) => throw null;
+        public virtual ClientResult Verify(decimal body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task VerifyAsync(decimal body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalType.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalType.cs
index 87623b6d6d..281338de6c 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalType.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalType.cs
@@ -19,7 +19,7 @@ public partial class DecimalType
 
         public virtual Task ResponseBodyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult ResponseBody() => throw null;
+        public virtual ClientResult ResponseBody(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> ResponseBodyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class DecimalType
 
         public virtual Task RequestBodyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult RequestBody(decimal body) => throw null;
+        public virtual ClientResult RequestBody(decimal body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequestBodyAsync(decimal body, CancellationToken cancellationToken = default) => throw null;
 
@@ -35,7 +35,7 @@ public partial class DecimalType
 
         public virtual Task RequestParameterAsync(decimal value, RequestOptions options) => throw null;
 
-        public virtual ClientResult RequestParameter(decimal value) => throw null;
+        public virtual ClientResult RequestParameter(decimal value, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task RequestParameterAsync(decimal value, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalVerify.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalVerify.cs
index 1798fcb7e7..4014e93159 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalVerify.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/DecimalVerify.cs
@@ -20,7 +20,7 @@ public partial class DecimalVerify
 
         public virtual Task PrepareVerifyAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult> PrepareVerify() => throw null;
+        public virtual ClientResult> PrepareVerify(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task>> PrepareVerifyAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class DecimalVerify
 
         public virtual Task VerifyAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Verify(decimal body) => throw null;
+        public virtual ClientResult Verify(decimal body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task VerifyAsync(decimal body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/String.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/String.cs
index cedadc21b1..b1b7388d36 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/String.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/String.cs
@@ -19,7 +19,7 @@ public partial class String
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -27,7 +27,7 @@ public partial class String
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(string body) => throw null;
+        public virtual ClientResult Put(string body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(string body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Unknown.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Unknown.cs
index ccd1f905db..39e08fd702 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Unknown.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/scalar/src/Generated/Unknown.cs
@@ -20,7 +20,7 @@ public partial class Unknown
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class Unknown
 
         public virtual Task PutAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Put(BinaryData body) => throw null;
+        public virtual ClientResult Put(BinaryData body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task PutAsync(BinaryData body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/EnumsOnly.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/EnumsOnly.cs
index d24da83e08..00b1e30fd3 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/EnumsOnly.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/EnumsOnly.cs
@@ -20,7 +20,7 @@ public partial class EnumsOnly
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class EnumsOnly
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(EnumsOnlyCases prop) => throw null;
+        public virtual ClientResult Send(EnumsOnlyCases prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(EnumsOnlyCases prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/FloatsOnly.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/FloatsOnly.cs
index 79bd3bf635..86d06f8752 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/FloatsOnly.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/FloatsOnly.cs
@@ -20,7 +20,7 @@ public partial class FloatsOnly
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class FloatsOnly
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(GetResponseProp1 prop) => throw null;
+        public virtual ClientResult Send(GetResponseProp1 prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(GetResponseProp1 prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/IntsOnly.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/IntsOnly.cs
index 4024631fc8..3af98894e9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/IntsOnly.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/IntsOnly.cs
@@ -20,7 +20,7 @@ public partial class IntsOnly
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class IntsOnly
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(GetResponseProp2 prop) => throw null;
+        public virtual ClientResult Send(GetResponseProp2 prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(GetResponseProp2 prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedLiterals.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedLiterals.cs
index 1ba4c2d1de..57c0a3189b 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedLiterals.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedLiterals.cs
@@ -20,7 +20,7 @@ public partial class MixedLiterals
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class MixedLiterals
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(MixedLiteralsCases prop) => throw null;
+        public virtual ClientResult Send(MixedLiteralsCases prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(MixedLiteralsCases prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedTypes.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedTypes.cs
index ddb3dfcdbd..5769b9d132 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedTypes.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/MixedTypes.cs
@@ -20,7 +20,7 @@ public partial class MixedTypes
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class MixedTypes
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(MixedTypesCases prop) => throw null;
+        public virtual ClientResult Send(MixedTypesCases prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(MixedTypesCases prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/ModelsOnly.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/ModelsOnly.cs
index 6e8bd9ba2f..8eb665a415 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/ModelsOnly.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/ModelsOnly.cs
@@ -21,7 +21,7 @@ public partial class ModelsOnly
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -29,7 +29,7 @@ public partial class ModelsOnly
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(BinaryData prop) => throw null;
+        public virtual ClientResult Send(BinaryData prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(BinaryData prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringAndArray.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringAndArray.cs
index f0a404777c..e0152cd181 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringAndArray.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringAndArray.cs
@@ -20,7 +20,7 @@ public partial class StringAndArray
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringAndArray
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(StringAndArrayCases prop) => throw null;
+        public virtual ClientResult Send(StringAndArrayCases prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(StringAndArrayCases prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensible.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensible.cs
index 9f0c1cff15..414c87dc27 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensible.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensible.cs
@@ -20,7 +20,7 @@ public partial class StringExtensible
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringExtensible
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(GetResponseProp3 prop) => throw null;
+        public virtual ClientResult Send(GetResponseProp3 prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(GetResponseProp3 prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensibleNamed.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensibleNamed.cs
index 096497b473..657248d680 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensibleNamed.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringExtensibleNamed.cs
@@ -20,7 +20,7 @@ public partial class StringExtensibleNamed
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringExtensibleNamed
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(StringExtensibleNamedUnion prop) => throw null;
+        public virtual ClientResult Send(StringExtensibleNamedUnion prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(StringExtensibleNamedUnion prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringsOnly.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringsOnly.cs
index 8dc2feeb5c..5b3707a82a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringsOnly.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/type/union/src/Generated/StringsOnly.cs
@@ -20,7 +20,7 @@ public partial class StringsOnly
 
         public virtual Task GetAsync(RequestOptions options) => throw null;
 
-        public virtual ClientResult Get() => throw null;
+        public virtual ClientResult Get(CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> GetAsync(CancellationToken cancellationToken = default) => throw null;
 
@@ -28,7 +28,7 @@ public partial class StringsOnly
 
         public virtual Task SendAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Send(GetResponseProp4 prop) => throw null;
+        public virtual ClientResult Send(GetResponseProp4 prop, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task SendAsync(GetResponseProp4 prop, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs
index 4f3e4e8833..c0e65f7fb4 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v1/src/Generated/AddedClient.cs
@@ -25,7 +25,7 @@ public partial class AddedClient
 
         public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1(ModelV1 body) => throw null;
+        public virtual ClientResult V1(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs
index c14b77224f..acbc40ab5d 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/AddedClient.cs
@@ -25,7 +25,7 @@ public partial class AddedClient
 
         public virtual Task V1Async(string headerV2, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1(string headerV2, ModelV1 body) => throw null;
+        public virtual ClientResult V1(string headerV2, ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1Async(string headerV2, ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class AddedClient
 
         public virtual Task V2Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V2(ModelV2 body) => throw null;
+        public virtual ClientResult V2(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V2Async(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs
index a3e3e2561f..fb097982e0 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/added/v2/src/Generated/InterfaceV2.cs
@@ -20,7 +20,7 @@ public partial class InterfaceV2
 
         public virtual Task V2InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V2InInterface(ModelV2 body) => throw null;
+        public virtual ClientResult V2InInterface(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V2InInterfaceAsync(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs
index 01ca1bac05..c8a62475a7 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v1/src/Generated/MadeOptionalClient.cs
@@ -25,7 +25,7 @@ public partial class MadeOptionalClient
 
         public virtual Task TestAsync(string @param, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(string @param, TestModel body) => throw null;
+        public virtual ClientResult Test(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs
index 0e1845360c..24ee4a3365 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/madeOptional/v2/src/Generated/MadeOptionalClient.cs
@@ -25,7 +25,7 @@ public partial class MadeOptionalClient
 
         public virtual Task TestAsync(BinaryContent content, string @param = null, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(TestModel body, string @param = null) => throw null;
+        public virtual ClientResult Test(TestModel body, string @param = null, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(TestModel body, string @param = null, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs
index 1b690de1d7..6872adbaa1 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/InterfaceV1.cs
@@ -20,7 +20,7 @@ public partial class InterfaceV1
 
         public virtual Task V1InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1InInterface(ModelV1 body) => throw null;
+        public virtual ClientResult V1InInterface(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1InInterfaceAsync(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs
index 916f45fd30..22e266f457 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v1/src/Generated/RemovedClient.cs
@@ -25,7 +25,7 @@ public partial class RemovedClient
 
         public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1(ModelV1 body) => throw null;
+        public virtual ClientResult V1(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class RemovedClient
 
         public virtual Task V2Async(string @param, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V2(string @param, ModelV2 body) => throw null;
+        public virtual ClientResult V2(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V2Async(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -41,7 +41,7 @@ public partial class RemovedClient
 
         public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult ModelV3(ModelV3 body) => throw null;
+        public virtual ClientResult ModelV3(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs
index f959fcc9d9..d5c685403e 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2/src/Generated/RemovedClient.cs
@@ -25,7 +25,7 @@ public partial class RemovedClient
 
         public virtual Task V2Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V2(ModelV2 body) => throw null;
+        public virtual ClientResult V2(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V2Async(ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class RemovedClient
 
         public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult ModelV3(ModelV3 body) => throw null;
+        public virtual ClientResult ModelV3(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs
index 37ff67ae66..e9c63b510a 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/InterfaceV1.cs
@@ -20,7 +20,7 @@ public partial class InterfaceV1
 
         public virtual Task V1InInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1InInterface(ModelV1 body) => throw null;
+        public virtual ClientResult V1InInterface(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1InInterfaceAsync(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs
index aec443226b..75322a5719 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/removed/v2Preview/src/Generated/RemovedClient.cs
@@ -25,7 +25,7 @@ public partial class RemovedClient
 
         public virtual Task V1Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V1(ModelV1 body) => throw null;
+        public virtual ClientResult V1(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V1Async(ModelV1 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -33,7 +33,7 @@ public partial class RemovedClient
 
         public virtual Task V2Async(string @param, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult V2(string @param, ModelV2 body) => throw null;
+        public virtual ClientResult V2(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> V2Async(string @param, ModelV2 body, CancellationToken cancellationToken = default) => throw null;
 
@@ -41,7 +41,7 @@ public partial class RemovedClient
 
         public virtual Task ModelV3Async(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult ModelV3(ModelV3 body) => throw null;
+        public virtual ClientResult ModelV3(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> ModelV3Async(ModelV3 body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs
index 25c04f8125..75760719b9 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/OldInterface.cs
@@ -20,7 +20,7 @@ public partial class OldInterface
 
         public virtual Task NewOpInNewInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult NewOpInNewInterface(OldModel body) => throw null;
+        public virtual ClientResult NewOpInNewInterface(OldModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> NewOpInNewInterfaceAsync(OldModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs
index a6024326c4..282c86d481 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v1/src/Generated/RenamedFromClient.cs
@@ -25,7 +25,7 @@ public partial class RenamedFromClient
 
         public virtual Task OldOpAsync(string oldQuery, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult OldOp(string oldQuery, OldModel body) => throw null;
+        public virtual ClientResult OldOp(string oldQuery, OldModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> OldOpAsync(string oldQuery, OldModel body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs
index ff671a89f8..6c1edad7bf 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/NewInterface.cs
@@ -20,7 +20,7 @@ public partial class NewInterface
 
         public virtual Task NewOpInNewInterfaceAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult NewOpInNewInterface(NewModel body) => throw null;
+        public virtual ClientResult NewOpInNewInterface(NewModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> NewOpInNewInterfaceAsync(NewModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs
index 795ef372f6..5aafccf90c 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/renamedFrom/v2/src/Generated/RenamedFromClient.cs
@@ -25,7 +25,7 @@ public partial class RenamedFromClient
 
         public virtual Task NewOpAsync(string newQuery, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult NewOp(string newQuery, NewModel body) => throw null;
+        public virtual ClientResult NewOp(string newQuery, NewModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> NewOpAsync(string newQuery, NewModel body, CancellationToken cancellationToken = default) => throw null;
 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs
index 9b9291ec28..f07d9147cc 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v1/src/Generated/ReturnTypeChangedFromClient.cs
@@ -24,7 +24,7 @@ public partial class ReturnTypeChangedFromClient
 
         public virtual Task TestAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(string body) => throw null;
+        public virtual ClientResult Test(string body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(string body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs
index 6210793c43..26bed9a285 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/returnTypeChangedFrom/v2/src/Generated/ReturnTypeChangedFromClient.cs
@@ -24,7 +24,7 @@ public partial class ReturnTypeChangedFromClient
 
         public virtual Task TestAsync(BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(string body) => throw null;
+        public virtual ClientResult Test(string body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(string body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs
index 9fe1dab017..862cabbd80 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v1/src/Generated/TypeChangedFromClient.cs
@@ -25,7 +25,7 @@ public partial class TypeChangedFromClient
 
         public virtual Task TestAsync(BinaryContent content, int @param, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(TestModel body, int @param) => throw null;
+        public virtual ClientResult Test(TestModel body, int @param, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(TestModel body, int @param, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs
index 90ad3cde4e..5565c68658 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/versioning/typeChangedFrom/v2/src/Generated/TypeChangedFromClient.cs
@@ -25,7 +25,7 @@ public partial class TypeChangedFromClient
 
         public virtual Task TestAsync(string @param, BinaryContent content, RequestOptions options = null) => throw null;
 
-        public virtual ClientResult Test(string @param, TestModel body) => throw null;
+        public virtual ClientResult Test(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null;
 
         public virtual Task> TestAsync(string @param, TestModel body, CancellationToken cancellationToken = default) => throw null;
     }
diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs
index 441af564ed..278862d6b0 100644
--- a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs
+++ b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs
@@ -108,14 +108,15 @@ public virtual async Task SayHiAsync(string headParameter, string
         /// 
         /// 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   or  is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult SayHi(string headParameter, string queryParameter, string optionalQuery = null)
+        public virtual ClientResult SayHi(string headParameter, string queryParameter, string optionalQuery = null, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(headParameter, nameof(headParameter));
             Argument.AssertNotNull(queryParameter, nameof(queryParameter));
 
-            ClientResult result = SayHi(headParameter, queryParameter, optionalQuery, options: null);
+            ClientResult result = SayHi(headParameter, queryParameter, optionalQuery, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -189,15 +190,16 @@ public virtual async Task HelloAgainAsync(string p2, string p1, Bi
         /// 
         /// 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  ,  or  is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult HelloAgain(string p2, string p1, RoundTripModel action)
+        public virtual ClientResult HelloAgain(string p2, string p1, RoundTripModel action, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(p2, nameof(p2));
             Argument.AssertNotNull(p1, nameof(p1));
             Argument.AssertNotNull(action, nameof(action));
 
-            ClientResult result = HelloAgain(p2, p1, action, options: null);
+            ClientResult result = HelloAgain(p2, p1, action, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((RoundTripModel)result, result.GetRawResponse());
         }
 
@@ -303,10 +305,11 @@ public virtual async Task HelloDemo2Async(RequestOptions options)
         }
 
         ///  Return hi in demo2. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult HelloDemo2()
+        public virtual ClientResult HelloDemo2(CancellationToken cancellationToken = default)
         {
-            ClientResult result = HelloDemo2(options: null);
+            ClientResult result = HelloDemo2(cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -363,13 +366,14 @@ public virtual async Task CreateLiteralAsync(BinaryContent content
 
         ///  Create with literal value. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult CreateLiteral(Thing body)
+        public virtual ClientResult CreateLiteral(Thing body, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(body, nameof(body));
 
-            ClientResult result = CreateLiteral(body, options: null);
+            ClientResult result = CreateLiteral(body, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -421,10 +425,11 @@ public virtual async Task HelloLiteralAsync(RequestOptions options
         }
 
         ///  Send literal parameters. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult HelloLiteral()
+        public virtual ClientResult HelloLiteral(CancellationToken cancellationToken = default)
         {
-            ClientResult result = HelloLiteral(options: null);
+            ClientResult result = HelloLiteral(cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -475,10 +480,11 @@ public virtual async Task TopActionAsync(DateTimeOffset action, Re
 
         ///  top level method. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult TopAction(DateTimeOffset action)
+        public virtual ClientResult TopAction(DateTimeOffset action, CancellationToken cancellationToken = default)
         {
-            ClientResult result = TopAction(action, options: null);
+            ClientResult result = TopAction(action, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -624,9 +630,10 @@ public virtual async Task AnonymousBodyAsync(BinaryContent content
         ///  optional literal float. 
         ///  optional literal bool. 
         ///  optional nullable collection. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  ,  or  is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult AnonymousBody(string name, BinaryData requiredUnion, ThingRequiredLiteralString requiredLiteralString, ThingRequiredLiteralInt requiredLiteralInt, ThingRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingOptionalLiteralString? optionalLiteralString = default, ThingOptionalLiteralInt? optionalLiteralInt = default, ThingOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default)
+        public virtual ClientResult AnonymousBody(string name, BinaryData requiredUnion, ThingRequiredLiteralString requiredLiteralString, ThingRequiredLiteralInt requiredLiteralInt, ThingRequiredLiteralFloat requiredLiteralFloat, bool requiredLiteralBool, string requiredBadDescription, IEnumerable requiredNullableList, ThingOptionalLiteralString? optionalLiteralString = default, ThingOptionalLiteralInt? optionalLiteralInt = default, ThingOptionalLiteralFloat? optionalLiteralFloat = default, bool? optionalLiteralBool = default, IEnumerable optionalNullableList = default, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(name, nameof(name));
             Argument.AssertNotNull(requiredUnion, nameof(requiredUnion));
@@ -647,7 +654,7 @@ public virtual ClientResult AnonymousBody(string name, BinaryData require
                 optionalNullableList?.ToList() as IList ?? new ChangeTrackingList(),
                 requiredNullableList?.ToList() as IList ?? new ChangeTrackingList(),
                 null);
-            ClientResult result = AnonymousBody(spreadModel, options: null);
+            ClientResult result = AnonymousBody(spreadModel, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -737,14 +744,15 @@ public virtual async Task FriendlyModelAsync(BinaryContent content
 
         ///  Model can have its friendly name. 
         ///  name of the NotFriend. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult FriendlyModel(string name)
+        public virtual ClientResult FriendlyModel(string name, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(name, nameof(name));
 
             Friend spreadModel = new Friend(name, null);
-            ClientResult result = FriendlyModel(spreadModel, options: null);
+            ClientResult result = FriendlyModel(spreadModel, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Friend)result, result.GetRawResponse());
         }
 
@@ -797,10 +805,11 @@ public virtual async Task AddTimeHeaderAsync(RequestOptions option
         }
 
         ///  addTimeHeader. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult AddTimeHeader()
+        public virtual ClientResult AddTimeHeader(CancellationToken cancellationToken = default)
         {
-            return AddTimeHeader(options: null);
+            return AddTimeHeader(cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
         }
 
         ///  addTimeHeader. 
@@ -855,14 +864,15 @@ public virtual async Task ProjectedNameModelAsync(BinaryContent co
 
         ///  Model can have its projected name. 
         ///  name of the ModelWithProjectedName. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult ProjectedNameModel(string name)
+        public virtual ClientResult ProjectedNameModel(string name, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(name, nameof(name));
 
             ProjectedModel spreadModel = new ProjectedModel(name, null);
-            ClientResult result = ProjectedNameModel(spreadModel, options: null);
+            ClientResult result = ProjectedNameModel(spreadModel, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((ProjectedModel)result, result.GetRawResponse());
         }
 
@@ -915,10 +925,11 @@ public virtual async Task ReturnsAnonymousModelAsync(RequestOption
         }
 
         ///  return anonymous model. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult ReturnsAnonymousModel()
+        public virtual ClientResult ReturnsAnonymousModel(CancellationToken cancellationToken = default)
         {
-            ClientResult result = ReturnsAnonymousModel(options: null);
+            ClientResult result = ReturnsAnonymousModel(cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((ReturnsAnonymousModelResponse)result, result.GetRawResponse());
         }
 
@@ -975,13 +986,14 @@ public virtual async Task GetUnknownValueAsync(string accept, Requ
 
         ///  get extensible enum. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult GetUnknownValue(string accept)
+        public virtual ClientResult GetUnknownValue(string accept, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(accept, nameof(accept));
 
-            ClientResult result = GetUnknownValue(accept, options: null);
+            ClientResult result = GetUnknownValue(accept, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue(result.GetRawResponse().Content.ToObjectFromJson(), result.GetRawResponse());
         }
 
@@ -1042,13 +1054,14 @@ public virtual async Task InternalProtocolAsync(BinaryContent cont
 
         ///  When set protocol false and convenient true, then the protocol method should be internal. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult InternalProtocol(Thing body)
+        public virtual ClientResult InternalProtocol(Thing body, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(body, nameof(body));
 
-            ClientResult result = InternalProtocol(body, options: null);
+            ClientResult result = InternalProtocol(body, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
             return ClientResult.FromValue((Thing)result, result.GetRawResponse());
         }
 
@@ -1100,10 +1113,11 @@ public virtual async Task StillConvenientAsync(RequestOptions opti
         }
 
         ///  When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one. 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult StillConvenient()
+        public virtual ClientResult StillConvenient(CancellationToken cancellationToken = default)
         {
-            return StillConvenient(options: null);
+            return StillConvenient(cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
         }
 
         ///  When set protocol false and convenient true, the convenient method should be generated even it has the same signature as protocol one. 
@@ -1158,13 +1172,14 @@ public virtual async Task HeadAsBooleanAsync(string id, RequestOpt
 
         ///  head as boolean. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult HeadAsBoolean(string id)
+        public virtual ClientResult HeadAsBoolean(string id, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(id, nameof(id));
 
-            return HeadAsBoolean(id, options: null);
+            return HeadAsBoolean(id, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
         }
 
         ///  head as boolean. 
@@ -1223,13 +1238,14 @@ public virtual async Task WithApiVersionAsync(string p1, RequestOp
 
         ///  Return hi again. 
         /// 
+        ///  The cancellation token that can be used to cancel the operation. 
         ///   is null. 
         ///  Service returned a non-success status code. 
-        public virtual ClientResult WithApiVersion(string p1)
+        public virtual ClientResult WithApiVersion(string p1, CancellationToken cancellationToken = default)
         {
             Argument.AssertNotNull(p1, nameof(p1));
 
-            return WithApiVersion(p1, options: null);
+            return WithApiVersion(p1, cancellationToken.CanBeCanceled ? new RequestOptions { CancellationToken = cancellationToken } : null);
         }
 
         ///  Return hi again. 

From 68f0609ee775b941b82de8a1c474eac5a74b5209 Mon Sep 17 00:00:00 2001
From: Weidong Xu 
Date: Thu, 12 Dec 2024 10:35:46 +0800
Subject: [PATCH 54/71] http-client-java, doc, require JDK 17 (#5333)

clientcore now requires JDK 17.

Therefore since emitter requires JDK too, we'd better just ask user to
install 17
---
 packages/http-client-java/README.md           | 2 +-
 packages/http-client-java/generator/README.md | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/packages/http-client-java/README.md b/packages/http-client-java/README.md
index 949431ffd9..b36be08cae 100644
--- a/packages/http-client-java/README.md
+++ b/packages/http-client-java/README.md
@@ -6,7 +6,7 @@ This is a TypeSpec library that will emit a Java SDK from TypeSpec.
 
 Install [Node.js](https://nodejs.org/) 20 or above. (Verify by running `node --version`)
 
-Install [Java](https://docs.microsoft.com/java/openjdk/download) 11 or above. (Verify by running `java --version`)
+Install [Java](https://docs.microsoft.com/java/openjdk/download) 17 or above. (Verify by running `java --version`)
 
 Install [Maven](https://maven.apache.org/install.html). (Verify by running `mvn --version`)
 
diff --git a/packages/http-client-java/generator/README.md b/packages/http-client-java/generator/README.md
index 2fa6f134ca..6efa989f3b 100644
--- a/packages/http-client-java/generator/README.md
+++ b/packages/http-client-java/generator/README.md
@@ -10,8 +10,8 @@ The **Microsoft Java client generator** tool generates client libraries for acce
 
 ## Prerequisites
 
-- [Java 11 or above](https://adoptium.net/temurin/releases/)
-- [Maven](https://maven.apache.org/download.cgi)
+- [Java 17 or above](https://docs.microsoft.com/java/openjdk/download)
+- [Maven](https://maven.apache.org/install.html)
 
 ## Build
 

From 53f69799d37762b67b0e050abee76fb5670f1cf2 Mon Sep 17 00:00:00 2001
From: Nisha Bhatia <67986960+nisha-bhatia@users.noreply.github.com>
Date: Wed, 11 Dec 2024 18:56:03 -0800
Subject: [PATCH 55/71] Update FormatLines in XmlDocStatement.cs to handle line
 breaks (#5214)

Fixes https://github.com/microsoft/typespec/issues/4377

---------

Co-authored-by: Dapeng Zhang 
---
 .../FormattableStringExpression.cs            |   4 +-
 .../src/Shared/StringExtensions.cs            |   8 +-
 .../src/Statements/XmlDocStatement.cs         |  21 +-
 .../src/Utilities/FormattableStringHelpers.cs | 144 ++++++++++
 .../src/Writers/CodeWriter.cs                 |   2 +-
 .../FormattableStringHelpersTests.cs          | 247 ++++++++++++++++++
 .../test/Utilities/StringExtensionsTests.cs   |  93 ++++++-
 .../test/Writers/CodeWriterTests.cs           |  14 +-
 .../SingleLineSummaryWithLineBreaks.cs        |   6 +
 .../Client/Structure/Default/DefaultTests.cs  |   1 -
 10 files changed, 525 insertions(+), 15 deletions(-)
 create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/FormattableStringHelpersTests.cs
 create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/TestData/CodeWriterTests/SingleLineSummaryWithLineBreaks.cs

diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs
index f33202003f..e0e1c9542a 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Expressions/FormattableStringExpression.cs
@@ -30,7 +30,7 @@ internal override void Write(CodeWriter writer)
         {
             writer.AppendRaw("$\"");
             var argumentCount = 0;
-            foreach ((var span, bool isLiteral) in StringExtensions.GetPathParts(Format))
+            foreach ((var span, bool isLiteral) in StringExtensions.GetFormattableStringFormatParts(Format))
             {
                 if (isLiteral)
                 {
@@ -51,7 +51,7 @@ internal override void Write(CodeWriter writer)
         private static void Validate(string format, IReadOnlyList args)
         {
             var count = 0;
-            foreach (var (_, isLiteral) in StringExtensions.GetPathParts(format))
+            foreach (var (_, isLiteral) in StringExtensions.GetFormattableStringFormatParts(format))
             {
                 if (!isLiteral)
                     count++;
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Shared/StringExtensions.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Shared/StringExtensions.cs
index dcd99996fb..b9b17932ec 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Shared/StringExtensions.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Shared/StringExtensions.cs
@@ -83,16 +83,18 @@ public static string ToCleanName(this string name, bool isCamelCase = true)
         [return: NotNullIfNotNull(nameof(name))]
         public static string ToVariableName(this string name) => ToCleanName(name, isCamelCase: false);
 
-        public static GetPathPartsEnumerator GetPathParts(string? path) => new GetPathPartsEnumerator(path);
+        public static GetPathPartsEnumerator GetFormattableStringFormatParts(string? format) => new GetPathPartsEnumerator(format);
+
+        public static GetPathPartsEnumerator GetFormattableStringFormatParts(ReadOnlySpan format) => new GetPathPartsEnumerator(format);
 
         public ref struct GetPathPartsEnumerator
         {
             private ReadOnlySpan _path;
             public Part Current { get; private set; }
 
-            public GetPathPartsEnumerator(ReadOnlySpan path)
+            public GetPathPartsEnumerator(ReadOnlySpan format)
             {
-                _path = path;
+                _path = format;
                 Current = default;
             }
 
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/XmlDocStatement.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/XmlDocStatement.cs
index b9958aea25..722d17bb0f 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/XmlDocStatement.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Statements/XmlDocStatement.cs
@@ -29,18 +29,29 @@ public XmlDocStatement(string startTag, string endTag, IEnumerable EscapeLines(IEnumerable lines)
+        private List NormalizeLines(IEnumerable lines)
         {
-            List escapedLines = new List();
+            List result = new List();
+
+            // break lines if they have line breaks
             foreach (var line in lines)
             {
-                escapedLines.Add(FormattableStringFactory.Create(EscapeLine(line.Format), EscapeArguments(line.GetArguments())));
+                var breakLines = FormattableStringHelpers.BreakLines(line);
+                result.AddRange(breakLines);
             }
-            return escapedLines;
+
+            // escape lines if they have invalid characters
+            for (int i = 0; i < result.Count; i++)
+            {
+                var line = result[i];
+                result[i] = FormattableStringFactory.Create(EscapeLine(line.Format), EscapeArguments(line.GetArguments()));
+            }
+
+            return result;
         }
 
         private static object?[] EscapeArguments(object?[] objects)
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/FormattableStringHelpers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/FormattableStringHelpers.cs
index 241fc18c0c..6c9ca2626b 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/FormattableStringHelpers.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Utilities/FormattableStringHelpers.cs
@@ -7,6 +7,7 @@
 using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Runtime.CompilerServices;
+using System.Text;
 using Microsoft.Generator.CSharp.Providers;
 
 namespace Microsoft.Generator.CSharp
@@ -97,5 +98,148 @@ public static string ReplaceLast(this string text, string oldValue, string newVa
             var position = text.LastIndexOf(oldValue, StringComparison.Ordinal);
             return position < 0 ? text : text.Substring(0, position) + newValue + text.Substring(position + oldValue.Length);
         }
+
+        internal static IReadOnlyList BreakLines(FormattableString input)
+        {
+            // handle empty input fs - we should not throw it away when it is empty
+            if (input.Format.Length == 0)
+            {
+                return [input]; // return it as is
+            }
+
+            StringBuilder formatBuilder = new StringBuilder();
+            var args = new List();
+            List result = new List();
+
+            var hasEmptyLastLine = BreakLinesCore(input, formatBuilder, args, result);
+
+            // if formatBuilder is not empty at end, add it to result
+            // or when the last char is line break, we should also construct one and add it into the result
+            if (formatBuilder.Length > 0 || hasEmptyLastLine)
+            {
+                FormattableString formattableString = FormattableStringFactory.Create(formatBuilder.ToString(), args.ToArray());
+                result.Add(formattableString);
+            }
+            return result;
+        }
+
+        private static bool BreakLinesCore(FormattableString input, StringBuilder formatBuilder, List args, List result)
+        {
+            // stackalloc cannot be used in a loop, we must allocate it here.
+            // for a format string with length n, the worst case that produces the most segments is when all its content is the char to split.
+            // For instance, when the format string is all \n, it will produce n+1 segments (because we did not omit empty entries).
+            Span splitIndices = stackalloc Range[input.Format.Length + 1];
+            ReadOnlySpan formatSpan = input.Format.AsSpan();
+            foreach ((ReadOnlySpan span, bool isLiteral, int index) in StringExtensions.GetFormattableStringFormatParts(formatSpan))
+            {
+                // if isLiteral - put in formatBuilder
+                if (isLiteral)
+                {
+                    var numSplits = span.SplitAny(splitIndices, ["\r\n", "\n"]);
+                    for (int i = 0; i < numSplits; i++)
+                    {
+                        var part = span[splitIndices[i]];
+                        // the literals could contain { and }, but they are unescaped. Since we are putting them back into the format, we need to escape them again.
+                        var startsWithCurlyBrace = part.Length > 0 && (part[0] == '{' || part[0] == '}');
+                        var start = startsWithCurlyBrace ? 1 : 0;
+                        var endsWithCurlyBrace = part.Length > 0 && (part[^1] == '{' || part[^1] == '}');
+                        var end = endsWithCurlyBrace ? part.Length - 1 : part.Length;
+                        if (startsWithCurlyBrace)
+                        {
+                            formatBuilder.Append(part[0]).Append(part[0]);
+                        }
+                        if (start <= end) // ensure that we have follow up characters before we move on
+                        {
+                            formatBuilder.Append(part[start..end]);
+                            if (endsWithCurlyBrace)
+                            {
+                                formatBuilder.Append(part[^1]).Append(part[^1]);
+                            }
+                        }
+                        if (i < numSplits - 1)
+                        {
+                            FormattableString formattableString = FormattableStringFactory.Create(formatBuilder.ToString(), args.ToArray());
+                            result.Add(formattableString);
+                            formatBuilder.Clear();
+                            args.Clear();
+                        }
+                    }
+                }
+                // if not Literal, is Args - recurse through Args and check if args has breaklines
+                else
+                {
+                    var arg = input.GetArgument(index);
+                    // we only break lines in the arguments if the argument is a string or FormattableString and it does not have a format specifier (indicating by : in span)
+                    // we do nothing if the argument has a format specifier because we do not really know in which form to break them
+                    // considering the chance of having these cases would be very rare, we are leaving the part of "arguments with formatter specifier" empty
+                    var indexOfFormatSpecifier = span.IndexOf(':');
+                    switch (arg)
+                    {
+                        case string str when indexOfFormatSpecifier < 0:
+                            BreakLinesCoreForString(str.AsSpan(), formatBuilder, args, result);
+                            break;
+                        case FormattableString fs when indexOfFormatSpecifier < 0:
+                            BreakLinesCore(fs, formatBuilder, args, result);
+                            break;
+                        default:
+                            // if not a string or FormattableString, add to args because we cannot parse it
+                            // add to FormatBuilder to maintain equal count between args and formatBuilder
+                            formatBuilder.Append('{');
+                            formatBuilder.Append(args.Count);
+                            if (indexOfFormatSpecifier >= 0)
+                            {
+                                formatBuilder.Append(span[indexOfFormatSpecifier..]);
+                            }
+                            formatBuilder.Append('}');
+                            args.Add(arg);
+                            break;
+                    }
+                }
+            }
+
+            return formatSpan[^1] == '\n';
+
+            static void BreakLinesCoreForString(ReadOnlySpan span, StringBuilder formatBuilder, List args, List result)
+            {
+                int start = 0, end = 0;
+                bool isLast = false;
+                // go into the loop when there are characters left
+                while (end < span.Length)
+                {
+                    // we should not check both `\r\n` and `\n` because `\r\n` contains `\n`, if we use `IndexOf` to check both of them, there must be duplicate searches and we cannot have O(n) time complexity.
+                    var indexOfLF = span[start..].IndexOf('\n');
+                    // check if the line already ends.
+                    if (indexOfLF < 0)
+                    {
+                        end = span.Length;
+                        isLast = true;
+                    }
+                    else
+                    {
+                        end = start + indexOfLF;
+                    }
+                    // omit \r if there is one before the \n to include the case that line breaks are using \r\n
+                    int partEnd = end;
+                    if (end > 0 && span[end - 1] == '\r')
+                    {
+                        partEnd--;
+                    }
+
+                    formatBuilder.Append('{')
+                        .Append(args.Count)
+                        .Append('}');
+                    args.Add(span[start..partEnd].ToString());
+                    start = end + 1; // goes to the next char after the \n we found
+
+                    if (!isLast)
+                    {
+                        FormattableString formattableString = FormattableStringFactory.Create(formatBuilder.ToString(), args.ToArray());
+                        result.Add(formattableString);
+                        formatBuilder.Clear();
+                        args.Clear();
+                    }
+                }
+            }
+        }
     }
 }
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs
index d1281aab16..48b21614f5 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Writers/CodeWriter.cs
@@ -79,7 +79,7 @@ public CodeWriter Append(FormattableString formattableString)
             const string declarationFormatString = ":D"; // :D :)
             const string identifierFormatString = ":I";
             const string crefFormatString = ":C"; // wraps content into "see cref" tag, available only in xmlDoc
-            foreach ((var span, bool isLiteral, int index) in StringExtensions.GetPathParts(formattableString.Format))
+            foreach ((var span, bool isLiteral, int index) in StringExtensions.GetFormattableStringFormatParts(formattableString.Format))
             {
                 if (isLiteral)
                 {
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/FormattableStringHelpersTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/FormattableStringHelpersTests.cs
new file mode 100644
index 0000000000..3c8988e7de
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/FormattableStringHelpersTests.cs
@@ -0,0 +1,247 @@
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+
+namespace Microsoft.Generator.CSharp.Tests.Utilities
+{
+    public class FormattableStringHelpersTests
+    {
+        [TestCaseSource(nameof(TestBuildBreakLines))]
+        public void TestBreakLines(FormattableString input, List expected)
+        {
+            var result = FormattableStringHelpers.BreakLines(input);
+            Assert.AreEqual(expected.Count, result.Count);
+            // format in the line we have is the same as expected
+            for (int i = 0; i < result.Count; i++)
+            {
+                Assert.AreEqual(result[i].Format, expected[i].Format);
+                Assert.AreEqual(result[i].ArgumentCount, expected[i].ArgumentCount);
+                CollectionAssert.AreEqual(result[i].GetArguments(), expected[i].GetArguments());
+            }
+        }
+
+        public static IEnumerable TestBuildBreakLines
+        {
+            get
+            {
+                yield return new TestCaseData(
+                    (FormattableString)$"\n\n\n\n",
+                    new List
+                    {
+                        $"", $"", $"", $"", $"" // four line breaks should produce 5 lines.
+                    })
+                    .SetName("TestBreakLines_AllLineBreaks");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"A timestamp indicating the last modified time\nclient. The operation will be performed only\nbeen modified since the specified time.",
+                    new List {
+                        $"A timestamp indicating the last modified time",
+                        $"client. The operation will be performed only",
+                        $"been modified since the specified time."
+                    }).SetName("TestBreakLines_AllLiteralsNoArgs");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"A timestamp indicating \rthe last modified time\nclient. The operation will be performed only\nbeen modified since the specified time.",
+                    new List {
+                        $"A timestamp indicating \rthe last modified time",
+                        $"client. The operation will be performed only",
+                        $"been modified since the specified time."
+                    }).SetName("TestBreakLines_AllLiteralsNoArgsWithCR");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"A timestamp indicating the last modified time\r\nclient. The operation will be performed only\r\nbeen modified since the specified time.",
+                    new List {
+                        $"A timestamp indicating the last modified time",
+                        $"client. The operation will be performed only",
+                        $"been modified since the specified time."
+                    }).SetName("TestBreakLines_AllLiteralsNoArgsWithCRLF");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"A timestamp indicating the last modified time\r\nclient. The operation will be performed only\nbeen modified since the specified time.",
+                    new List {
+                        $"A timestamp indicating the last modified time",
+                        $"client. The operation will be performed only",
+                        $"been modified since the specified time."
+                    }).SetName("TestBreakLines_AllLiteralsNoArgsWithMixedCRLF");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"{"A timestamp indicating the last modified time\nclient. The operation will be performed only\nbeen modified since the specified time."}",
+                    new List {
+                        $"{"A timestamp indicating the last modified time"}",
+                        $"{"client. The operation will be performed only"}",
+                        $"{"been modified since the specified time."}"
+                    }).SetName("TestBreakLines_OneArgOnly");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"{"A timestamp indicating \rthe last modified time\nclient. The operation will be performed only\nbeen modified since the specified time."}",
+                    new List {
+                        $"{"A timestamp indicating \rthe last modified time"}",
+                        $"{"client. The operation will be performed only"}",
+                        $"{"been modified since the specified time."}"
+                    }).SetName("TestBreakLines_OneArgOnlyWithCR");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"{"A timestamp indicating \rthe last modified time\r\r\r\nclient. The operation will be performed only\nbeen modified since the specified time."}",
+                    new List {
+                        $"{"A timestamp indicating \rthe last modified time\r\r"}",
+                        $"{"client. The operation will be performed only"}",
+                        $"{"been modified since the specified time."}"
+                    }).SetName("TestBreakLines_OneArgOnlyWithMultipleCRs");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"{"A timestamp indicating the last modified time\r\nclient. The operation will be performed only\r\nbeen modified since the specified time."}",
+                    new List {
+                        $"{"A timestamp indicating the last modified time"}",
+                        $"{"client. The operation will be performed only"}",
+                        $"{"been modified since the specified time."}"
+                    }).SetName("TestBreakLines_OneArgOnlyWithCRLF");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"{"A timestamp indicating the last modified time\r\nclient. The operation will be performed only\nbeen modified since the specified time."}",
+                    new List {
+                        $"{"A timestamp indicating the last modified time"}",
+                        $"{"client. The operation will be performed only"}",
+                        $"{"been modified since the specified time."}"
+                    }).SetName("TestBreakLines_OneArgOnlyWithMixedCRLF");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x"}second\nthird{"y"}",
+                    new List {
+                        $"first{"x"}second",
+                        $"third{"y"}"
+                    }).SetName("TestBreakLines_LineBreaksInFormat");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x\nz"}second\nthird{"y"}",
+                    new List {
+                        $"first{"x"}",
+                        $"{"z"}second",
+                        $"third{"y"}"
+                    }).SetName("TestBreakLines_LineBreakInArgument");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x"}second\nthird{"y\n"}",
+                    new List {
+                        $"first{"x"}second",
+                        $"third{"y"}",
+                        $"{""}"
+                    }).SetName("TestBreakLines_LineBreaksAtEndOfArgument");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x"}second\nthird{null}",
+                    new List {
+                        $"first{"x"}second",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_NullArgument");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x":L}second\nthird{null}",
+                    new List {
+                        $"first{"x":L}second",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_TrivialFormatSpecifier");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{",
+                    new List {
+                        $"first{{"
+                    }).SetName("TestBreakLines_LiteralOpenBrace");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first}}",
+                    new List {
+                        $"first}}"
+                    }).SetName("TestBreakLines_LiteralCloseBrace");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{}}",
+                    new List {
+                        $"first{{}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBrace");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{T}}",
+                    new List {
+                        $"first{{T}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithT");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first {"name"}: {{T}}, last {"name"}: {{U}}",
+                    new List {
+                        $"first {"name"}: {{T}}, last {"name"}: {{U}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithArgs");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{\n}}",
+                    new List {
+                        $"first{{",
+                        $"}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithLineBreaks");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{T\n}}",
+                    new List {
+                        $"first{{T",
+                        $"}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithLineBreaksAndT");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{T{"name"}\n}}",
+                    new List {
+                        $"first{{T{"name"}",
+                        $"}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithLineBreaksAndArgs");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first{{T{"last\nname"}\n}}",
+                    new List {
+                        $"first{{T{"last"}",
+                        $"{"name"}",
+                        $"}}"
+                    }).SetName("TestBreakLines_LiteralOpenAndCloseBraceWithLineBreaksAndArgsContainingLineBreaks");
+
+                FormattableString inner = $"{"x"}\n{"y"}z";
+                FormattableString outter = $"first{inner}Second\nthird{null}";
+                yield return new TestCaseData(
+                    outter,
+                    new List {
+                        $"first{"x"}",
+                        $"{"y"}zSecond",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_RecursiveFormattableStrings");
+
+                inner = $"\n\n\n\n";
+                outter = $"first{inner}second\nthird{null}";
+                yield return new TestCaseData(
+                    outter,
+                    new List {
+                        $"first",
+                        $"",
+                        $"",
+                        $"",
+                        $"second",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_RecursiveFormattableStringsWithAllLineBreaks");
+
+                yield return new TestCaseData(
+                    (FormattableString)$"first\n\n\n\nsecond\nthird{null}",
+                    new List {
+                        $"first",
+                        $"",
+                        $"",
+                        $"",
+                        $"second",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_MultipleLineBreaks");
+
+                // current solution of format specifier in argument is that we ignore them during the process of line breaking.
+                yield return new TestCaseData(
+                    (FormattableString)$"first{"x\ny":L}second\nthird{null}",
+                    new List {
+                        $"first{"x\ny":L}second",
+                        $"third{null}"
+                    }).SetName("TestBreakLines_FormatSpecifierInArg");
+            }
+        }
+    }
+}
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/StringExtensionsTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/StringExtensionsTests.cs
index 4c67a059a7..1f1a6d8b43 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/StringExtensionsTests.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Utilities/StringExtensionsTests.cs
@@ -1,8 +1,8 @@
 // Copyright (c) Microsoft Corporation. All rights reserved.
 // Licensed under the MIT License.
 
-using Microsoft.Generator.CSharp.Input;
-using Moq;
+using System;
+using System.Collections.Generic;
 using NUnit.Framework;
 
 namespace Microsoft.Generator.CSharp.Tests.Utilities
@@ -129,5 +129,94 @@ public void TestToApiVersionMemberName(string apiVersion, string expectedApiVers
             var name = apiVersion.ToApiVersionMemberName();
             Assert.AreEqual(expectedApiVersion, name);
         }
+
+        [TestCaseSource(nameof(BuildFormattableStringFormatParts))]
+        public void ValidateGetFormattableStringFormatParts(string format, IReadOnlyList parts)
+        {
+            var i = 0;
+            foreach (var (span, isLiteral, index) in StringExtensions.GetFormattableStringFormatParts(format))
+            {
+                Assert.AreEqual(parts[i].Value, span.ToString());
+                Assert.AreEqual(parts[i].IsLiteral, isLiteral);
+                Assert.AreEqual(parts[i].ArgumentIndex, index);
+                i++;
+            }
+        }
+
+        public record Part(string Value, bool IsLiteral, int ArgumentIndex);
+
+        public static IEnumerable BuildFormattableStringFormatParts
+        {
+            get
+            {
+                // simple case with only arguments
+                yield return new TestCaseData("{0}{1}", new Part[]
+                {
+                    new Part("0", false, 0),
+                    new Part("1", false, 1)
+                });
+                // simple case with only literals
+                yield return new TestCaseData("something", new Part[]
+                {
+                    new Part("something", true, -1) // literals do not have an argument index
+                });
+                // mixed case with both arguments and literals
+                yield return new TestCaseData("something{0}else{1}", new Part[]
+                {
+                    new Part("something", true, -1),
+                    new Part("0", false, 0),
+                    new Part("else", true, -1),
+                    new Part("1", false, 1)
+                });
+                // when the format contains a { or } literal at its end
+                FormattableString fs = $"This {"fs"} has literal {{";
+                yield return new TestCaseData(fs.Format, new Part[]
+                {
+                    new Part("This ", true, -1),
+                    new Part("0", false, 0),
+                    new Part(" has literal {", true, -1)
+                });
+                // when the format contains a { or } literal at its end
+                fs = $"This {"fs"} has literal }}";
+                yield return new TestCaseData(fs.Format, new Part[]
+                {
+                    new Part("This ", true, -1),
+                    new Part("0", false, 0),
+                    new Part(" has literal }", true, -1)
+                });
+                // when the format contains a { or } literal in its middle
+                fs = $"This {"fs"} has literal }} and {"fs"}";
+                yield return new TestCaseData(fs.Format, new Part[]
+                {
+                    new Part("This ", true, -1),
+                    new Part("0", false, 0),
+                    new Part(" has literal }", true, -1), // the implementation will break up the literals by { and } and unescape them
+                    new Part(" and ", true, -1),
+                    new Part("1", false, 1)
+                });
+                // when the format contains both literal { and } in its middle
+                fs = $"This {"fs"} has literal {{ and }} in the middle";
+                yield return new TestCaseData(fs.Format, new Part[]
+                {
+                    new Part("This ", true, -1),
+                    new Part("0", false, 0),
+                    new Part(" has literal {", true, -1),
+                    new Part(" and }", true, -1),
+                    new Part(" in the middle", true, -1)
+                });
+                // when the format contains both literal { and } in its middle but separated by an argument
+                fs = $"This {"fs"} has literal {{, {"fs"} and }} in the middle";
+                yield return new TestCaseData(fs.Format, new Part[]
+                {
+                    new Part("This ", true, -1),
+                    new Part("0", false, 0),
+                    new Part(" has literal {", true, -1),
+                    new Part(", ", true, -1),
+                    new Part("1", false, 1),
+                    new Part(" and }", true, -1),
+                    new Part(" in the middle", true, -1)
+                });
+            }
+        }
     }
 }
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/CodeWriterTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/CodeWriterTests.cs
index 46fd87da39..9f6832748d 100644
--- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/CodeWriterTests.cs
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/CodeWriterTests.cs
@@ -3,7 +3,6 @@
 
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Text;
 using Microsoft.Generator.CSharp.Expressions;
@@ -98,6 +97,19 @@ public void SeeCRefType(Type type, bool isNullable)
             Assert.AreEqual(expected, writer.ToString());
         }
 
+        [Test]
+        public void SingleLineSummaryWithLineBreaks()
+        {
+            FormattableString fs = $"Some\nmultiline\n{typeof(string)}\nsummary.";
+            using var writer = new CodeWriter();
+            var summary = new XmlDocSummaryStatement([fs]);
+            summary.Write(writer);
+
+            var expected = Helpers.GetExpectedFromFile();
+
+            Assert.AreEqual(expected, writer.ToString(false));
+        }
+
         [Test]
         public void MultiLineSummary()
         {
diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/TestData/CodeWriterTests/SingleLineSummaryWithLineBreaks.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/TestData/CodeWriterTests/SingleLineSummaryWithLineBreaks.cs
new file mode 100644
index 0000000000..b4b86abc93
--- /dev/null
+++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/test/Writers/TestData/CodeWriterTests/SingleLineSummaryWithLineBreaks.cs
@@ -0,0 +1,6 @@
+/// 
+/// Some
+/// multiline
+/// string
+/// summary.
+/// 
diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Client/Structure/Default/DefaultTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Client/Structure/Default/DefaultTests.cs
index ca0fa94f4e..fae20c8f35 100644
--- a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Client/Structure/Default/DefaultTests.cs
+++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Client/Structure/Default/DefaultTests.cs
@@ -35,7 +35,6 @@ public void Client_Structure_default_methods(Type client, string[] methodNames)
         [CadlRanchTest]
         public Task Client_Structure_default_One() => Test(async (host) =>
         {
-            //await new RenamedOperationClient(host, ClientType.RenamedOperation, null).RenamedOneAsync();
             var response = await new ServiceClient(host, ClientType.Default).OneAsync();
             Assert.AreEqual(204, response.GetRawResponse().Status);
         });

From 339dd17b796ed990de27cd6dc2f586012c8a79d9 Mon Sep 17 00:00:00 2001
From: Alan Zimmer <48699787+alzimmermsft@users.noreply.github.com>
Date: Wed, 11 Dec 2024 22:47:33 -0500
Subject: [PATCH 56/71] Move setting retrieval into constructor (#5338)

Moves getting the Autorest / TypeSpec settings into the constructor of
`JavaSettings` rather than each being an input parameter to the
constructor. This should make it less confusing when trying to
understand which setting turns into what `JavaSettings` configuration.
---
 .../core/extension/plugin/JavaSettings.java   | 464 +++++++++---------
 1 file changed, 226 insertions(+), 238 deletions(-)

diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java
index 00398cb2cc..0dc5e9e5be 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/extension/plugin/JavaSettings.java
@@ -108,68 +108,8 @@ public static JavaSettings getInstance() {
                 logger.debug("List of require : {}", autorestSettings.getRequire());
             }
 
-            final String fluent = getStringValue(host, "fluent");
-
-            final String flavor = getStringValue(host, "flavor", "azure");
-            final String defaultModelsSubPackageName = isBranded(flavor) ? "models" : "";
-
             setHeader(getStringValue(host, "license-header"));
-            instance = new JavaSettings(autorestSettings,
-                host.getValueWithJsonReader("modelerfour", jsonReader -> jsonReader.readMap(JsonReader::readUntyped)),
-                getBooleanValue(host, "azure-arm", false), getBooleanValue(host, "sdk-integration", false), fluent,
-                getBooleanValue(host, "regenerate-pom", false), header, getStringValue(host, "service-name"),
-                getStringValue(host, "namespace", "com.azure.app").toLowerCase(),
-                getBooleanValue(host, "client-side-validations", false), getStringValue(host, "client-type-prefix"),
-                getBooleanValue(host, "generate-client-interfaces", false),
-                getBooleanValue(host, "generate-client-as-impl", false),
-                getStringValue(host, "implementation-subpackage", "implementation"),
-                getStringValue(host, "models-subpackage", defaultModelsSubPackageName),
-                getStringValue(host, "custom-types", ""), getStringValue(host, "custom-types-subpackage", ""),
-                getStringValue(host, "fluent-subpackage", "fluent"),
-                getBooleanValue(host, "required-parameter-client-methods", false),
-                getBooleanValue(host, "generate-sync-async-clients", false),
-                getBooleanValue(host, "generate-builder-per-client", false),
-                getStringValue(host, "sync-methods", "essential"), getBooleanValue(host, "client-logger", false),
-                getBooleanValue(host, "required-fields-as-ctor-args", false),
-                getBooleanValue(host, "service-interface-as-public", true), getStringValue(host, "artifact-id", ""),
-                getStringValue(host, "credential-types", "none"), getStringValue(host, "credential-scopes"),
-                getStringValue(host, "customization-jar-path"), getStringValue(host, "customization-class"),
-                getBooleanValue(host, "optional-constant-as-enum", false), getBooleanValue(host, "data-plane", false),
-                getBooleanValue(host, "use-iterable", false),
-                host.getValueWithJsonReader("service-versions",
-                    jsonReader -> jsonReader.readArray(JsonReader::getString)),
-                getStringValue(host, "client-flattened-annotation-target", ""),
-                getStringValue(host, "key-credential-header-name", ""),
-                getBooleanValue(host, "disable-client-builder", false),
-                host.getValueWithJsonReader("polling", jsonReader -> jsonReader.readMap(PollingDetails::fromJson)),
-                getBooleanValue(host, "generate-samples", false), getBooleanValue(host, "generate-tests", false), false,
-                getBooleanValue(host, "annotate-getters-and-setters-for-serialization", false),
-                getStringValue(host, "default-http-exception-type"),
-                getBooleanValue(host, "use-default-http-status-code-to-exception-type-mapping", false),
-                host.getValueWithJsonReader("http-status-code-to-exception-type-mapping",
-                    JavaSettings::parseStatusCodeMapping),
-                getBooleanValue(host, "partial-update", false),
-                // If fluent default to false, this is because the automated test generation ends up with invalid code.
-                // Once that is fixed, this can be switched over to true.
-                getBooleanValue(host, "generic-response-type", fluent == null),
-                getBooleanValue(host, "stream-style-serialization", true),
-                getBooleanValue(host, "enable-sync-stack", false),
-                getBooleanValue(host, "output-model-immutable", false),
-                getBooleanValue(host, "use-input-stream-for-binary", false),
-                getBooleanValue(host, "no-custom-headers", true),
-                getBooleanValue(host, "include-read-only-in-constructor-args", false),
-                // setting the default as true as the Java design guideline recommends using String for URLs.
-                getBooleanValue(host, "url-as-string", true), getBooleanValue(host, "uuid-as-string", false),
-
-                // setting this to false by default as a lot of existing libraries still use swagger and
-                // were generated with required = true set in JsonProperty annotation
-                getBooleanValue(host, "disable-required-property-annotation", false),
-                getBooleanValue(host, "enable-page-size", false), getBooleanValue(host, "use-key-credential", false),
-                getBooleanValue(host, "null-byte-array-maps-to-empty-array", false),
-                getBooleanValue(host, "graal-vm-config", false), flavor,
-                getBooleanValue(host, "disable-typed-headers-methods", false),
-                getBooleanValue(host, "share-jsonserializable-code", false),
-                getBooleanValue(host, "use-object-for-unknown", false), getBooleanValue(host, "android", false));
+            instance = new JavaSettings(autorestSettings);
         }
         return instance;
     }
@@ -191,159 +131,108 @@ private static Map parseStatusCodeMapping(JsonReader jsonReader
      * Create a new JavaSettings object with the provided properties.
      *
      * @param autorestSettings The autorest settings.
-     * @param modelerSettings The modeler settings.
-     * @param azure Whether to generate the Azure.
-     * @param sdkIntegration Whether to generate the SDK integration.
-     * @param fluent The fluent generation mode.
-     * @param regeneratePom Whether to regenerate the POM.
-     * @param fileHeaderText The file header text.
-     * @param serviceName The service name.
-     * @param packageKeyword The package keyword.
-     * @param clientSideValidations Whether to add client-side validations to the generated clients.
-     * @param clientTypePrefix The prefix that will be added to each generated client type.
-     * @param generateClientInterfaces Whether interfaces will be generated for Service and Method Group clients.
-     * @param generateClientAsImpl Whether Service and Method Group clients will be generated as implementation
-     * @param implementationSubpackage The sub-package that the Service and Method Group client implementation classes
-     * will be put into.
-     * @param modelsSubpackage The sub-package that Enums, Exceptions, and Model types will be put into.
-     * @param customTypes The custom types that will be generated.
-     * @param customTypesSubpackage The sub-package that custom types will be put into.
-     * @param fluentSubpackage The sub-package that Fluent interfaces will be put into.
-     * @param requiredParameterClientMethods Whether Service and Method Group client method overloads that omit optional
-     * parameters will be created.
-     * @param generateSyncAsyncClients Whether Service and Method Group clients will be generated with both synchronous
-     * and asynchronous methods.
-     * @param generateBuilderPerClient Whether a builder will be generated for each Service and Method Group client.
-     * @param syncMethods The sync methods generation mode.
-     * @param clientLogger Whether to add a logger to the generated clients.
-     * @param requiredFieldsAsConstructorArgs Whether required fields will be included in the constructor arguments for
-     * generated models.
-     * @param serviceInterfaceAsPublic If set to true, proxy method service interface will be marked as public.
-     * @param artifactId The artifactId for the generated project.
-     * @param credentialType The type of credential to generate.
-     * @param credentialScopes The scopes for the generated credential.
-     * @param customizationJarPath The path to the customization jar.
-     * @param customizationClass The class to use for customization.
-     * @param optionalConstantAsEnum Whether to generate optional constants as enums.
-     * @param dataPlaneClient Whether to generate a data plane client.
-     * @param useIterable Whether to use Iterable instead of List for collection types.
-     * @param serviceVersions The versions of the service.
-     * @param clientFlattenAnnotationTarget The target for the @JsonFlatten annotation for
-     * x-ms-client-flatten.
-     * @param keyCredentialHeaderName The header name for the key credential.
-     * @param clientBuilderDisabled Whether to disable the client builder.
-     * @param pollingConfig The polling configuration.
-     * @param generateSamples Whether to generate samples.
-     * @param generateTests Whether to generate tests.
-     * @param generateSendRequestMethod Whether to generate the send request method.
-     * @param annotateGettersAndSettersForSerialization If set to true, Jackson JsonGetter and JsonSetter will annotate
-     * getters and setters in generated models to handle serialization and deserialization. For now, fields will
-     * continue being annotated to ensure that there are no backwards compatibility breaks.
-     * @param defaultHttpExceptionType The fully-qualified class that should be used as the default exception type. This
-     * class must extend from HttpResponseException.
-     * @param useDefaultHttpStatusCodeToExceptionTypeMapping Determines whether a well-known HTTP status code to
-     * exception type mapping should be used if an HTTP status code-exception mapping isn't provided.
-     * @param httpStatusCodeToExceptionTypeMapping A mapping of HTTP response status code to the exception type that
-     * should be thrown if that status code is seen. All exception types must be fully-qualified and extend from
-     * HttpResponseException.
-     * @param handlePartialUpdate If set to true, the generated model will handle partial updates.
-     * @param genericResponseTypes If set to true, responses will only use Response, ResponseBase, PagedResponse, and
-     * PagedResponseBase types with generics instead of creating a specific named type that extends one of those types.
-     * @param streamStyleSerialization If set to true, models will handle serialization themselves using stream-style
-     * serialization instead of relying on Jackson Databind.
-     * @param isSyncStackEnabled If set to true, sync methods are generated using sync stack. i.e these methods do
-     * not use sync-over-async stack.
-     * @param outputModelImmutable If set to true, the models that are determined as output only models will be made
-     * immutable without any public constructors or setter methods.
-     * @param streamResponseInputStream If set to true, sync methods will use {@code InputStream} for binary responses.
-     * @param noCustomHeaders If set to true, methods that have custom header types will also have an equivalent
-     * method that returns just the response with untyped headers.
-     * @param includeReadOnlyInConstructorArgs If set to true, read-only required properties will be included in the
-     * constructor if {@code requiredFieldsAsConstructorArgs} is true. This is a backwards compatibility flag as
-     * previously read-only required were included in constructors.
-     * @param urlAsString This generates all URLs as String type. This is enabled by default as required by the Java
-     * design guidelines. For backward compatibility, this can be set to false.
-     * @param disableRequiredPropertyAnnotation If set to true, the required property annotation will be disabled.
-     * @param pageSizeEnabled If set to true, the generated client will have support for page size.
-     * @param useKeyCredential If set to true, the generated client will have support for key credential.
-     * @param nullByteArrayMapsToEmptyArray If set to true, {@code ArrayType.BYTE_ARRAY} will return an empty array
-     * instead of null when the default value expression is null.
-     * @param generateGraalVmConfig If set to true, the generated client will have support for GraalVM.
-     * @param flavor The brand name we use to generate SDK.
-     * @param disableTypedHeadersMethods Prevents generating REST API methods that include typed headers. If set to
-     * true, {@code noCustomHeaders} will be ignored as no REST APIs with typed headers will be generated.
-     * @param shareJsonSerializableCode Whether models implementing {@code JsonSerializable} can attempt to share code
-     * for {@code toJson} and {@code fromJson}.
-     * @param android Whether to generate the Android client.
-     */
-    private JavaSettings(AutorestSettings autorestSettings, Map modelerSettings, boolean azure,
-        boolean sdkIntegration, String fluent, boolean regeneratePom, String fileHeaderText, String serviceName,
-        String packageKeyword, boolean clientSideValidations, String clientTypePrefix, boolean generateClientInterfaces,
-        boolean generateClientAsImpl, String implementationSubpackage, String modelsSubpackage, String customTypes,
-        String customTypesSubpackage, String fluentSubpackage, boolean requiredParameterClientMethods,
-        boolean generateSyncAsyncClients, boolean generateBuilderPerClient, String syncMethods, boolean clientLogger,
-        boolean requiredFieldsAsConstructorArgs, boolean serviceInterfaceAsPublic, String artifactId,
-        String credentialType, String credentialScopes, String customizationJarPath, String customizationClass,
-        boolean optionalConstantAsEnum, boolean dataPlaneClient, boolean useIterable, List serviceVersions,
-        String clientFlattenAnnotationTarget, String keyCredentialHeaderName, boolean clientBuilderDisabled,
-        Map pollingConfig, boolean generateSamples, boolean generateTests,
-        boolean generateSendRequestMethod, boolean annotateGettersAndSettersForSerialization,
-        String defaultHttpExceptionType, boolean useDefaultHttpStatusCodeToExceptionTypeMapping,
-        Map httpStatusCodeToExceptionTypeMapping, boolean handlePartialUpdate,
-        boolean genericResponseTypes, boolean streamStyleSerialization, boolean isSyncStackEnabled,
-        boolean outputModelImmutable, boolean streamResponseInputStream, boolean noCustomHeaders,
-        boolean includeReadOnlyInConstructorArgs, boolean urlAsString, boolean uuidAsString,
-        boolean disableRequiredPropertyAnnotation, boolean pageSizeEnabled, boolean useKeyCredential,
-        boolean nullByteArrayMapsToEmptyArray, boolean generateGraalVmConfig, String flavor,
-        boolean disableTypedHeadersMethods, boolean shareJsonSerializableCode, boolean useObjectForUnknown,
-        boolean android) {
-
+     */
+    private JavaSettings(AutorestSettings autorestSettings) {
         this.autorestSettings = autorestSettings;
-        this.modelerSettings = new ModelerSettings(modelerSettings);
-        this.azure = azure;
-        this.sdkIntegration = sdkIntegration;
-        this.fluent = fluent == null
+
+        // The modeler settings.
+        this.modelerSettings = new ModelerSettings(
+            host.getValueWithJsonReader("modelerfour", jsonReader -> jsonReader.readMap(JsonReader::readUntyped)));
+
+        // Whether to generate the Azure.
+        this.azure = getBooleanValue(host, "azure-arm", false);
+
+        // Whether to generate the SDK integration.
+        this.sdkIntegration = getBooleanValue(host, "sdk-integration", false);
+
+        // The fluent generation mode.
+        String fluentString = getStringValue(host, "fluent");
+        this.fluent = fluentString == null
             ? Fluent.NONE
-            : (fluent.isEmpty() || fluent.equalsIgnoreCase("true")
+            : (fluentString.isEmpty() || fluentString.equalsIgnoreCase("true")
                 ? Fluent.PREMIUM
-                : Fluent.valueOf(fluent.toUpperCase(Locale.ROOT)));
-        this.regeneratePom = regeneratePom;
-        this.fileHeaderText = fileHeaderText;
-        this.serviceName = serviceName;
-        this.packageName = packageKeyword;
-        this.clientSideValidations = clientSideValidations;
-        this.clientTypePrefix = clientTypePrefix;
-        this.generateClientInterfaces = generateClientInterfaces;
-        this.generateClientAsImpl = generateClientAsImpl || generateSyncAsyncClients || generateClientInterfaces;
-        this.implementationSubpackage = implementationSubpackage;
-        this.modelsSubpackage = modelsSubpackage;
+                : Fluent.valueOf(fluentString.toUpperCase(Locale.ROOT)));
+
+        // Whether to regenerate the POM.
+        this.regeneratePom = getBooleanValue(host, "regenerate-pom", false);
+
+        // The file header text.
+        this.fileHeaderText = header;
+
+        // The service name.
+        this.serviceName = getStringValue(host, "service-name");
+
+        // The package keyword.
+        this.packageName = getStringValue(host, "namespace", "com.azure.app").toLowerCase();
+
+        // Whether to add client-side validations to the generated clients.
+        this.clientSideValidations = getBooleanValue(host, "client-side-validations", false);
+
+        // The prefix that will be added to each generated client type.
+        this.clientTypePrefix = getStringValue(host, "client-type-prefix");
+
+        // Whether interfaces will be generated for Service and Method Group clients.
+        this.generateClientInterfaces = getBooleanValue(host, "generate-client-interfaces", false);
+
+        // The sub-package that the Service and Method Group client implementation classes will be put into.
+        this.implementationSubpackage = getStringValue(host, "implementation-subpackage", "implementation");
+
+        // The brand name we use to generate SDK.
+        this.flavor = getStringValue(host, "flavor", "azure");
+
+        this.modelsSubpackage = getStringValue(host, "models-subpackage", isBranded(this.flavor) ? "models" : "");
+
+        // The custom types that will be generated.
+        String customTypes = getStringValue(host, "custom-types", "");
         this.customTypes = (customTypes == null || customTypes.isEmpty())
             ? new ArrayList<>()
             : Arrays.asList(customTypes.split(","));
-        this.customTypesSubpackage = customTypesSubpackage;
-        this.fluentSubpackage = fluentSubpackage;
-        this.requiredParameterClientMethods = requiredParameterClientMethods;
-        this.generateSyncAsyncClients = generateSyncAsyncClients;
-        this.generateBuilderPerClient = generateBuilderPerClient;
-        this.syncMethods = SyncMethodsGeneration.fromValue(syncMethods);
-        this.clientLogger = clientLogger;
-        this.requiredFieldsAsConstructorArgs = requiredFieldsAsConstructorArgs;
-        this.serviceInterfaceAsPublic = serviceInterfaceAsPublic;
-        this.artifactId = artifactId;
-        this.optionalConstantAsEnum = optionalConstantAsEnum;
-        this.dataPlaneClient = dataPlaneClient;
-        this.useIterable = useIterable;
-        this.serviceVersions = serviceVersions;
-        this.clientFlattenAnnotationTarget
-            = (clientFlattenAnnotationTarget == null || clientFlattenAnnotationTarget.isEmpty())
-                ? ClientFlattenAnnotationTarget.TYPE
-                : ClientFlattenAnnotationTarget.valueOf(clientFlattenAnnotationTarget.toUpperCase(Locale.ROOT));
 
+        // The sub-package that custom types will be put into.
+        this.customTypesSubpackage = getStringValue(host, "custom-types-subpackage", "");
+
+        // The sub-package that Fluent interfaces will be put into.
+        this.fluentSubpackage = getStringValue(host, "fluent-subpackage", "fluent");
+
+        // Whether Service and Method Group client method overloads that omit optional parameters will be created.
+        this.requiredParameterClientMethods = getBooleanValue(host, "required-parameter-client-methods", false);
+
+        // Whether Service and Method Group clients will be generated with both synchronous and asynchronous methods.
+        this.generateSyncAsyncClients = getBooleanValue(host, "generate-sync-async-clients", false);
+
+        // Whether Service and Method Group clients will be generated as implementation
+        this.generateClientAsImpl = getBooleanValue(host, "generate-client-as-impl", false)
+            || this.generateSyncAsyncClients
+            || this.generateClientInterfaces;
+
+        // Whether a builder will be generated for each Service and Method Group client.
+        this.generateBuilderPerClient = getBooleanValue(host, "generate-builder-per-client", false);
+
+        // The sync methods generation mode.
+        this.syncMethods = SyncMethodsGeneration.fromValue(getStringValue(host, "sync-methods", "essential"));
+
+        // Whether to add a logger to the generated clients.
+        this.clientLogger = getBooleanValue(host, "client-logger", false);
+
+        // Whether required fields will be included in the constructor arguments for generated models.
+        this.requiredFieldsAsConstructorArgs = getBooleanValue(host, "required-fields-as-ctor-args", false);
+
+        // If set to true, proxy method service interface will be marked as public.
+        this.serviceInterfaceAsPublic = getBooleanValue(host, "service-interface-as-public", true);
+
+        // The artifactId for the generated project.
+        this.artifactId = getStringValue(host, "artifact-id", "");
+
+        // The types of credentials to generate.
+        String credentialType = getStringValue(host, "credential-types", "none");
         if (credentialType != null) {
             String[] splits = credentialType.split(",");
             this.credentialTypes
                 = Arrays.stream(splits).map(String::trim).map(CredentialType::fromValue).collect(Collectors.toSet());
         }
+
+        // The scopes for the generated credential.
+        String credentialScopes = getStringValue(host, "credential-scopes");
         if (credentialScopes != null) {
             String[] splits = credentialScopes.split(",");
             this.credentialScopes = Arrays.stream(splits).map(String::trim).map(split -> {
@@ -353,50 +242,149 @@ private JavaSettings(AutorestSettings autorestSettings, Map mode
                 return split;
             }).collect(Collectors.toSet());
         }
-        this.customizationJarPath = customizationJarPath;
-        this.customizationClass = customizationClass;
-        this.keyCredentialHeaderName = keyCredentialHeaderName;
-        this.clientBuilderDisabled = clientBuilderDisabled;
+
+        // The path to the customization jar.
+        this.customizationJarPath = getStringValue(host, "customization-jar-path");
+
+        // The class to use for customization.
+        this.customizationClass = getStringValue(host, "customization-class");
+
+        // Whether to generate optional constants as enums.
+        this.optionalConstantAsEnum = getBooleanValue(host, "optional-constant-as-enum", false);
+
+        // Whether to generate a data plane client.
+        this.dataPlaneClient = getBooleanValue(host, "data-plane", false);
+
+        // Whether to use Iterable instead of List for collection types.
+        this.useIterable = getBooleanValue(host, "use-iterable", false);
+
+        // The versions of the service.
+        this.serviceVersions = host.getValueWithJsonReader("service-versions",
+            jsonReader -> jsonReader.readArray(JsonReader::getString));
+
+        // The target for the @JsonFlatten annotation for x-ms-client-flatten.
+        String clientFlattenAnnotationTarget = getStringValue(host, "client-flattened-annotation-target", "");
+        this.clientFlattenAnnotationTarget
+            = (clientFlattenAnnotationTarget == null || clientFlattenAnnotationTarget.isEmpty())
+                ? ClientFlattenAnnotationTarget.TYPE
+                : ClientFlattenAnnotationTarget.valueOf(clientFlattenAnnotationTarget.toUpperCase(Locale.ROOT));
+
+        // The header name for the key credential.
+        this.keyCredentialHeaderName = getStringValue(host, "key-credential-header-name", "");
+
+        // Whether to disable the client builder.
+        this.clientBuilderDisabled = getBooleanValue(host, "disable-client-builder", false);
+
+        // The polling configuration.
+        Map pollingConfig
+            = host.getValueWithJsonReader("polling", jsonReader -> jsonReader.readMap(PollingDetails::fromJson));
         if (pollingConfig != null) {
             if (!pollingConfig.containsKey("default")) {
                 pollingConfig.put("default", new PollingDetails());
             }
         }
         this.pollingConfig = pollingConfig;
-        this.generateSamples = generateSamples;
-        this.generateTests = generateTests;
-        this.generateSendRequestMethod = generateSendRequestMethod;
-        this.annotateGettersAndSettersForSerialization = annotateGettersAndSettersForSerialization;
+
+        // Whether to generate samples.
+        this.generateSamples = getBooleanValue(host, "generate-samples", false);
+
+        // Whether to generate tests.
+        this.generateTests = getBooleanValue(host, "generate-tests", false);
+
+        // Whether to generate the send request method.
+        this.generateSendRequestMethod = false;
+
+        // If set to true, Jackson JsonGetter and JsonSetter will annotate getters and setters in generated models to
+        // handle serialization and deserialization. For now, fields will continue being annotated to ensure that there
+        // are no backwards compatibility breaks.
+        this.annotateGettersAndSettersForSerialization
+            = getBooleanValue(host, "annotate-getters-and-setters-for-serialization", false);
 
         // Error HTTP status code exception type handling.
-        this.defaultHttpExceptionType = defaultHttpExceptionType;
-        this.useDefaultHttpStatusCodeToExceptionTypeMapping = useDefaultHttpStatusCodeToExceptionTypeMapping;
-        this.httpStatusCodeToExceptionTypeMapping = httpStatusCodeToExceptionTypeMapping;
-
-        this.handlePartialUpdate = handlePartialUpdate;
-
-        this.genericResponseTypes = genericResponseTypes;
-
-        this.streamStyleSerialization = streamStyleSerialization;
-        this.syncStackEnabled = isSyncStackEnabled;
-
-        this.outputModelImmutable = outputModelImmutable;
-
-        this.isInputStreamForBinary = streamResponseInputStream;
-        this.noCustomHeaders = noCustomHeaders;
-        this.includeReadOnlyInConstructorArgs = includeReadOnlyInConstructorArgs;
-        this.urlAsString = urlAsString;
-        this.uuidAsString = uuidAsString;
-        this.disableRequiredJsonAnnotation = disableRequiredPropertyAnnotation;
-        this.pageSizeEnabled = pageSizeEnabled;
-        this.useKeyCredential = useKeyCredential;
-        this.nullByteArrayMapsToEmptyArray = nullByteArrayMapsToEmptyArray;
-        this.generateGraalVmConfig = generateGraalVmConfig;
-        this.flavor = flavor;
-        this.disableTypedHeadersMethods = disableTypedHeadersMethods;
-        this.shareJsonSerializableCode = shareJsonSerializableCode;
-        this.useObjectForUnknown = useObjectForUnknown;
-        this.android = android;
+        // The fully-qualified class that should be used as the default exception type. This class must extend from
+        // HttpResponseException
+        this.defaultHttpExceptionType = getStringValue(host, "default-http-exception-type");
+
+        // Whether to use the default HTTP status code to exception type mapping.
+        this.useDefaultHttpStatusCodeToExceptionTypeMapping
+            = getBooleanValue(host, "use-default-http-status-code-to-exception-type-mapping", false);
+
+        // A mapping of HTTP response status code to the exception type that should be thrown if that status code is
+        // seen. All exception types must be fully-qualified and extend from HttpResponseException.
+        this.httpStatusCodeToExceptionTypeMapping = host
+            .getValueWithJsonReader("http-status-code-to-exception-type-mapping", JavaSettings::parseStatusCodeMapping);
+
+        // Whether to handle partial updates.
+        this.handlePartialUpdate = getBooleanValue(host, "partial-update", false);
+
+        // If set to true, responses will only use Response, ResponseBase, PagedResponse, and PagedResponseBase types
+        // with generics instead of creating a specific named type that extends one of those types.
+        // If fluent default to false, this is because the automated test generation ends up with invalid code.
+        // Once that is fixed, this can be switched over to true.
+        this.genericResponseTypes = getBooleanValue(host, "generic-response-type", fluentString == null);
+
+        // If set to true, models will handle serialization themselves using stream-style serialization instead of
+        // relying on Jackson Databind.
+        this.streamStyleSerialization = getBooleanValue(host, "stream-style-serialization", true);
+
+        // If set to true, sync methods are generated using sync stack. i.e these methods do not use sync-over-async
+        // stack.
+        this.syncStackEnabled = getBooleanValue(host, "enable-sync-stack", false);
+
+        // If set to true, the models that are determined as output only models will be made immutable without any
+        // public constructors or setter methods.
+        this.outputModelImmutable = getBooleanValue(host, "output-model-immutable", false);
+
+        // Whether to use InputStream for binary responses.
+        this.isInputStreamForBinary = getBooleanValue(host, "use-input-stream-for-binary", false);
+
+        // If set to true, methods that have custom header types will also have an equivalent method that returns just
+        // the response with untyped headers.
+        this.noCustomHeaders = getBooleanValue(host, "no-custom-headers", true);
+
+        // If set to true, read-only required properties will be included in the constructor if
+        // {@code requiredFieldsAsConstructorArgs} is true. This is a backwards compatibility flag as previously
+        // read-only required were included in constructors.
+        this.includeReadOnlyInConstructorArgs = getBooleanValue(host, "include-read-only-in-constructor-args", false);
+
+        // This generates all URLs as String type. This is enabled by default as required by the Java design guidelines.
+        // For backward compatibility, this can be set to false.
+        // setting the default as true as the Java design guideline recommends using String for URLs.
+        this.urlAsString = getBooleanValue(host, "url-as-string", true);
+
+        // Generate UUID as string.
+        this.uuidAsString = getBooleanValue(host, "uuid-as-string", false);
+
+        // If set to true, the required property annotation will be disabled.
+        // setting this to false by default as a lot of existing libraries still use swagger and were generated with
+        // required = true set in JsonProperty annotation
+        this.disableRequiredJsonAnnotation = getBooleanValue(host, "disable-required-property-annotation", false);
+
+        // If set to true, the generated client will have support for page size.
+        this.pageSizeEnabled = getBooleanValue(host, "enable-page-size", false);
+
+        // If set to true, the generated client will have support for key credential.
+        this.useKeyCredential = getBooleanValue(host, "use-key-credential", false);
+
+        // If set to true, {@code ArrayType.BYTE_ARRAY} will return an empty array instead of null when the default
+        // value expression is null.
+        this.nullByteArrayMapsToEmptyArray = getBooleanValue(host, "null-byte-array-maps-to-empty-array", false);
+
+        // If set to true, the generated client will have support for GraalVM.
+        this.generateGraalVmConfig = getBooleanValue(host, "graal-vm-config", false);
+
+        // Prevents generating REST API methods that include typed headers. If set to true, {@code noCustomHeaders}
+        // will be ignored as no REST APIs with typed headers will be generated.
+        this.disableTypedHeadersMethods = getBooleanValue(host, "disable-typed-headers-methods", false);
+
+        // Whether models implementing {@code JsonSerializable} can attempt to share code for toJson and fromJson.
+        this.shareJsonSerializableCode = getBooleanValue(host, "share-jsonserializable-code", false);
+
+        // Whether to use object for unknown.
+        this.useObjectForUnknown = getBooleanValue(host, "use-object-for-unknown", false);
+
+        // Whether to generate the Android client.
+        this.android = getBooleanValue(host, "android", false);
     }
 
     /**

From b2c14ccb8f240c85a52351d547eaa71b8638886c Mon Sep 17 00:00:00 2001
From: Dapeng Zhang 
Date: Thu, 12 Dec 2024 13:35:39 +0800
Subject: [PATCH 57/71] bump TCGC version to 0.48.6 (#5331)

Fixes https://github.com/microsoft/typespec/issues/5330
---
 packages/http-client-csharp/package-lock.json | 8 ++++----
 packages/http-client-csharp/package.json      | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/packages/http-client-csharp/package-lock.json b/packages/http-client-csharp/package-lock.json
index 7d35c77562..234f218d55 100644
--- a/packages/http-client-csharp/package-lock.json
+++ b/packages/http-client-csharp/package-lock.json
@@ -15,7 +15,7 @@
         "@azure-tools/cadl-ranch": "0.16.1",
         "@azure-tools/cadl-ranch-specs": "0.39.3",
         "@azure-tools/typespec-azure-core": "0.48.0",
-        "@azure-tools/typespec-client-generator-core": "0.48.4",
+        "@azure-tools/typespec-client-generator-core": "0.48.6",
         "@microsoft/api-extractor": "^7.47.11",
         "@types/node": "~22.7.5",
         "@typespec/compiler": "0.62.0",
@@ -215,9 +215,9 @@
       }
     },
     "node_modules/@azure-tools/typespec-client-generator-core": {
-      "version": "0.48.4",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz",
-      "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==",
+      "version": "0.48.6",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.6.tgz",
+      "integrity": "sha512-SVD4JCON52UIs4AogxQs8OrXjFdEf9EJPuK76Ze33VhtYdNNXPLJir2uV1wNJAnNtH2i3IMBkfrq2RjV1HHpdA==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
diff --git a/packages/http-client-csharp/package.json b/packages/http-client-csharp/package.json
index 39d2a2a9d8..36d968db1c 100644
--- a/packages/http-client-csharp/package.json
+++ b/packages/http-client-csharp/package.json
@@ -58,7 +58,7 @@
     "@azure-tools/cadl-ranch": "0.16.1",
     "@azure-tools/cadl-ranch-specs": "0.39.3",
     "@azure-tools/typespec-azure-core": "0.48.0",
-    "@azure-tools/typespec-client-generator-core": "0.48.4",
+    "@azure-tools/typespec-client-generator-core": "0.48.6",
     "@microsoft/api-extractor": "^7.47.11",
     "@types/node": "~22.7.5",
     "@typespec/compiler": "0.62.0",

From 093e98620a616a31ce5d43857d9b3a758c36fc72 Mon Sep 17 00:00:00 2001
From: Weidong Xu 
Date: Thu, 12 Dec 2024 17:20:33 +0800
Subject: [PATCH 58/71] http-client-java, map typespec.rest.resource model to
 sdk base namespace (#5349)

Also update package name to json classes.

https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/clientcore/core/src/main/java/io/clientcore/core/serialization/json
---
 .../emitter/src/code-model-builder.ts         | 46 +++++++++++--------
 .../model/clientmodel/ExternalPackage.java    |  2 +-
 2 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts
index 279be70a54..b1d967337a 100644
--- a/packages/http-client-java/emitter/src/code-model-builder.ts
+++ b/packages/http-client-java/emitter/src/code-model-builder.ts
@@ -2537,25 +2537,33 @@ export class CodeModelBuilder {
     // clientNamespace from TCGC
     const clientNamespace: string | undefined = type?.clientNamespace;
 
-    if (this.isBranded() && type) {
-      // special handling for namespace of model that cannot be mapped to azure-core
-      if (type.crossLanguageDefinitionId === "TypeSpec.Http.File") {
-        // TypeSpec.Http.File
-        return this.baseJavaNamespace;
-      } else if (type.crossLanguageDefinitionId === "Azure.Core.Foundations.OperationState") {
-        // Azure.Core.OperationState
-        return this.baseJavaNamespace;
-      } else if (
-        type.crossLanguageDefinitionId === "Azure.Core.ResourceOperationStatus" ||
-        type.crossLanguageDefinitionId === "Azure.Core.Foundations.OperationStatus"
-      ) {
-        // Azure.Core.ResourceOperationStatus<>
-        // Azure.Core.Foundations.OperationStatus<>
-        // usually this model will not be generated, but javadoc of protocol method requires it be in SDK namespace
-        return this.baseJavaNamespace;
-      } else if (type.crossLanguageDefinitionId.startsWith("Azure.ResourceManager.")) {
-        // models in Azure.ResourceManager
-        return this.baseJavaNamespace;
+    if (type) {
+      if (this.isBranded()) {
+        // special handling for namespace of model that cannot be mapped to azure-core
+        if (type.crossLanguageDefinitionId === "TypeSpec.Http.File") {
+          // TypeSpec.Http.File
+          return this.baseJavaNamespace;
+        } else if (type.crossLanguageDefinitionId === "Azure.Core.Foundations.OperationState") {
+          // Azure.Core.OperationState
+          return this.baseJavaNamespace;
+        } else if (
+          type.crossLanguageDefinitionId === "Azure.Core.ResourceOperationStatus" ||
+          type.crossLanguageDefinitionId === "Azure.Core.Foundations.OperationStatus"
+        ) {
+          // Azure.Core.ResourceOperationStatus<>
+          // Azure.Core.Foundations.OperationStatus<>
+          // usually this model will not be generated, but javadoc of protocol method requires it be in SDK namespace
+          return this.baseJavaNamespace;
+        } else if (type.crossLanguageDefinitionId.startsWith("Azure.ResourceManager.")) {
+          // models in Azure.ResourceManager
+          return this.baseJavaNamespace;
+        }
+      } else {
+        // special handling for namespace of model in TypeSpec.Rest.Resource
+        if (type.crossLanguageDefinitionId.startsWith("TypeSpec.Rest.Resource.")) {
+          // models in TypeSpec.Rest.Resource
+          return this.baseJavaNamespace;
+        }
       }
     }
 
diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java
index 278c615f90..d8e1f15566 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ExternalPackage.java
@@ -8,7 +8,7 @@
 public class ExternalPackage {
 
     public static final String CLIENTCORE_PACKAGE_NAME = "io.clientcore.core";
-    public static final String CLIENTCORE_JSON_PACKAGE_NAME = "io.clientcore.core.json";
+    public static final String CLIENTCORE_JSON_PACKAGE_NAME = "io.clientcore.core.serialization.json";
 
     public static final String AZURE_CORE_PACKAGE_NAME = "com.azure.core";
     public static final String AZURE_JSON_PACKAGE_NAME = "com.azure.json";

From df5a8854d22b73a6ac67a73f7f5da475631d9ca3 Mon Sep 17 00:00:00 2001
From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com>
Date: Thu, 12 Dec 2024 17:31:49 +0800
Subject: [PATCH 59/71] http-client-java, unify branded/unbranded
 ExpandableEnum (#5334)

### Issue
- Last item of https://github.com/Azure/autorest.java/issues/2841
- Previous unbranded implementation has two major issues
  - No `equals()` override
  - Non-string implementation can't compile

### This PR
- Apply current branded ExpandableEnum interface implementation to
unbranded
- `fromString` will be unified as `fromValue`, and will throw if
parameter is null(previously will return null)

### Test
Tested with openai, no compilation issue found:
```java// Code generated by Microsoft (R) TypeSpec Code Generator.

package com.openai;

import io.clientcore.core.annotation.Metadata;
import io.clientcore.core.util.ExpandableEnum;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;

/**
 * Defines values for OlympicRecordModel.
 */
public final class OlympicRecordModel implements ExpandableEnum {
    private static final Map VALUES = new ConcurrentHashMap<>();

    private static final Function NEW_INSTANCE = OlympicRecordModel::new;

    /**
     * Static value 9.58 for OlympicRecordModel.
     */
    @Metadata(generated = true)
    public static final OlympicRecordModel OLYMPIC_100_METERS = fromValue(9.58);

    /**
     * Static value 19.3 for OlympicRecordModel.
     */
    @Metadata(generated = true)
    public static final OlympicRecordModel OLYMPIC_200_METERS = fromValue(19.3);

    private final Double value;

    private OlympicRecordModel(Double value) {
        this.value = value;
    }

    /**
     * Creates or finds a OlympicRecordModel.
     *
     * @param value a value to look for.
     * @return the corresponding OlympicRecordModel.
     * @throws IllegalArgumentException if value is null.
     */
    @Metadata(generated = true)
    public static OlympicRecordModel fromValue(Double value) {
        if (value == null) {
            throw new IllegalArgumentException("'value' cannot be null.");
        }
        return VALUES.computeIfAbsent(value, NEW_INSTANCE);
    }

    /**
     * Gets known OlympicRecordModel values.
     *
     * @return Known OlympicRecordModel values.
     */
    @Metadata(generated = true)
    public static Collection values() {
        return new ArrayList<>(VALUES.values());
    }

    /**
     * Gets the value of the OlympicRecordModel instance.
     *
     * @return the value of the OlympicRecordModel instance.
     */
    @Metadata(generated = true)
    @Override
    public Double getValue() {
        return this.value;
    }

    @Metadata(generated = true)
    @Override
    public String toString() {
        return Objects.toString(this.value);
    }

    @Metadata(generated = true)
    @Override
    public boolean equals(Object obj) {
        return this == obj;
    }

    @Metadata(generated = true)
    @Override
    public int hashCode() {
        return Objects.hashCode(this.value);
    }
}

```
---
 .../generator/core/mapper/ChoiceMapper.java   |   6 +-
 .../core/model/clientmodel/ClassType.java     |   1 +
 .../core/model/clientmodel/EnumType.java      |   3 +-
 .../generator/core/template/EnumTemplate.java | 285 +++++++-----------
 .../models/PriorityModel.java                 |   5 +-
 .../models/OlympicRecordModel.java            |   5 +-
 .../enumservice/models/PriorityModel.java     |   5 +-
 7 files changed, 125 insertions(+), 185 deletions(-)

diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ChoiceMapper.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ChoiceMapper.java
index 5433e6f68b..c8f34e3d46 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ChoiceMapper.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/mapper/ChoiceMapper.java
@@ -4,6 +4,7 @@
 package com.microsoft.typespec.http.client.generator.core.mapper;
 
 import com.microsoft.typespec.http.client.generator.core.extension.model.codemodel.ChoiceSchema;
+import com.microsoft.typespec.http.client.generator.core.extension.plugin.JavaSettings;
 import com.microsoft.typespec.http.client.generator.core.model.clientmodel.ClassType;
 import com.microsoft.typespec.http.client.generator.core.model.clientmodel.EnumType;
 import com.microsoft.typespec.http.client.generator.core.model.clientmodel.IType;
@@ -53,9 +54,12 @@ protected boolean useCodeModelNameForEnumMember() {
     private IType createChoiceType(ChoiceSchema enumType) {
         IType elementType = Mappers.getSchemaMapper().map(enumType.getChoiceType());
         boolean isStringEnum = elementType == ClassType.STRING;
-        if (isStringEnum) {
+        JavaSettings javaSettings = JavaSettings.getInstance();
+        if (isStringEnum && javaSettings.isBranded()) {
+            // for branded string enum, will generate ExpandableStringEnum subclass
             return MapperUtils.createEnumType(enumType, true, useCodeModelNameForEnumMember());
         } else {
+            // other cases, will generate ExpandableEnum interface implementation
             return MapperUtils.createEnumType(enumType, true, useCodeModelNameForEnumMember(), "getValue", "fromValue");
         }
     }
diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java
index 0477cfebbd..37e8ae191e 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/ClassType.java
@@ -143,6 +143,7 @@ public String getGenericClass() {
             put(SimpleResponse.class, new ClassDetails(SimpleResponse.class, "io.clientcore.core.http.SimpleResponse"));
             put(ExpandableStringEnum.class,
                 new ClassDetails(ExpandableStringEnum.class, "io.clientcore.core.util.ExpandableEnum"));
+            put(ExpandableEnum.class, new ClassDetails(ExpandableEnum.class, "io.clientcore.core.util.ExpandableEnum"));
             put(HttpResponseException.class, new ClassDetails(HttpResponseException.class,
                 "io.clientcore.core.http.exception.HttpResponseException"));
             put(HttpTrait.class, new ClassDetails(HttpTrait.class, "io.clientcore.core.models.traits.HttpTrait"));
diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/EnumType.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/EnumType.java
index b4728d0413..ab4fff4375 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/EnumType.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/model/clientmodel/EnumType.java
@@ -120,8 +120,7 @@ public final String defaultValueExpression(String sourceExpression) {
                     return getName() + "." + enumValue.getName();
                 }
             }
-            return String.format("%1$s.from%2$s(%3$s)", getName(),
-                CodeNamer.toPascalCase(this.getElementType().toString()),
+            return String.format("%1$s.%2$s(%3$s)", getName(), getFromMethodName(),
                 this.getElementType().defaultValueExpression(sourceExpression));
         } else {
             for (ClientEnumValue enumValue : this.getValues()) {
diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java
index f75dd15152..8b1b3567c9 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/EnumTemplate.java
@@ -41,7 +41,7 @@ public final void write(EnumType enumType, JavaFile javaFile) {
             if (settings.isBranded()) {
                 writeBrandedExpandableEnum(enumType, javaFile, settings);
             } else {
-                writeExpandableStringEnumInterface(enumType, javaFile, settings);
+                writeExpandableEnumInterface(enumType, javaFile, settings);
             }
         } else {
             writeEnum(enumType, javaFile, settings);
@@ -59,185 +59,8 @@ protected void writeBrandedExpandableEnum(EnumType enumType, JavaFile javaFile,
         if (enumType.getElementType() == ClassType.STRING) {
             writeExpandableStringEnum(enumType, javaFile, settings);
         } else {
-            Set imports = new HashSet<>();
-            imports.add("java.util.Collection");
-            imports.add("java.lang.IllegalArgumentException");
-            imports.add("java.util.Map");
-            imports.add("java.util.concurrent.ConcurrentHashMap");
-            imports.add("java.util.ArrayList");
-            imports.add("java.util.Objects");
-            imports.add(ClassType.EXPANDABLE_ENUM.getFullName());
-            imports.add("java.util.function.Function");
-            if (!settings.isStreamStyleSerialization()) {
-                imports.add("com.fasterxml.jackson.annotation.JsonCreator");
-            }
-
-            addGeneratedImport(imports);
-
-            javaFile.declareImport(imports);
-            javaFile.javadocComment(comment -> comment.description(enumType.getDescription()));
-
-            String enumName = enumType.getName();
-            IType elementType = enumType.getElementType();
-            String typeName = elementType.getClientType().asNullable().toString();
-            String pascalTypeName = CodeNamer.toPascalCase(typeName);
-            String declaration = enumName + " implements ExpandableEnum<" + pascalTypeName + ">";
-            javaFile.publicFinalClass(declaration, classBlock -> {
-                classBlock.privateStaticFinalVariable(
-                    String.format("Map<%1$s, %2$s> VALUES = new ConcurrentHashMap<>()", pascalTypeName, enumName));
-                classBlock.privateStaticFinalVariable(
-                    String.format("Function<%1$s, %2$s> NEW_INSTANCE = %2$s::new", pascalTypeName, enumName));
-
-                for (ClientEnumValue enumValue : enumType.getValues()) {
-                    String value = enumValue.getValue();
-                    classBlock.javadocComment(CoreUtils.isNullOrEmpty(enumValue.getDescription())
-                        ? "Static value " + value + " for " + enumName + "."
-                        : enumValue.getDescription());
-                    addGeneratedAnnotation(classBlock);
-                    classBlock.publicStaticFinalVariable(String.format("%1$s %2$s = fromValue(%3$s)", enumName,
-                        enumValue.getName(), elementType.defaultValueExpression(value)));
-                }
-
-                classBlock.variable(pascalTypeName + " value", JavaVisibility.Private, JavaModifier.Final);
-                classBlock.privateConstructor(enumName + "(" + pascalTypeName + " value)", ctor -> {
-                    ctor.line("this.value = value;");
-                });
-
-                // fromValue(typeName)
-                classBlock.javadocComment(comment -> {
-                    comment.description("Creates or finds a " + enumName);
-                    comment.param("value", "a value to look for");
-                    comment.methodReturns("the corresponding " + enumName);
-                });
-
-                addGeneratedAnnotation(classBlock);
-                if (!settings.isStreamStyleSerialization()) {
-                    classBlock.annotation("JsonCreator");
-                }
-
-                classBlock.publicStaticMethod(String.format("%1$s fromValue(%2$s value)", enumName, pascalTypeName),
-                    function -> {
-                        function.line("Objects.requireNonNull(value, \"'value' cannot be null.\");");
-                        function.methodReturn("VALUES.computeIfAbsent(value, NEW_INSTANCE)");
-                    });
-
-                // values
-                classBlock.javadocComment(comment -> {
-                    comment.description("Gets known " + enumName + " values.");
-                    comment.methodReturns("Known " + enumName + " values.");
-                });
-                addGeneratedAnnotation(classBlock);
-                classBlock.publicStaticMethod(String.format("Collection<%s> values()", enumName),
-                    function -> function.methodReturn("new ArrayList<>(VALUES.values())"));
-
-                // getValue
-                classBlock.javadocComment(comment -> {
-                    comment.description("Gets the value of the " + enumName + " instance.");
-                    comment.methodReturns("the value of the " + enumName + " instance.");
-                });
-
-                addGeneratedAnnotation(classBlock);
-                classBlock.annotation("Override");
-                classBlock.publicMethod(pascalTypeName + " getValue()",
-                    function -> function.methodReturn("this.value"));
-
-                // toString
-                addGeneratedAnnotation(classBlock);
-                classBlock.annotation("Override");
-                classBlock.method(JavaVisibility.Public, null, "String toString()",
-                    function -> function.methodReturn("Objects.toString(this.value)"));
-
-                // equals
-                addGeneratedAnnotation(classBlock);
-                classBlock.annotation("Override");
-                classBlock.method(JavaVisibility.Public, null, "boolean equals(Object obj)",
-                    function -> function.methodReturn("this == obj"));
-
-                // hashcode
-                addGeneratedAnnotation(classBlock);
-                classBlock.annotation("Override");
-                classBlock.method(JavaVisibility.Public, null, "int hashCode()",
-                    function -> function.methodReturn("Objects.hashCode(this.value)"));
-            });
-        }
-    }
-
-    private void writeExpandableStringEnumInterface(EnumType enumType, JavaFile javaFile, JavaSettings settings) {
-        Set imports = new HashSet<>();
-        imports.add("java.util.Collection");
-        imports.add("java.util.concurrent.ConcurrentHashMap");
-        imports.add("java.util.Map");
-        imports.add(getStringEnumImport());
-        if (!settings.isStreamStyleSerialization()) {
-            imports.add("com.fasterxml.jackson.annotation.JsonCreator");
+            writeExpandableEnumInterface(enumType, javaFile, settings);
         }
-
-        addGeneratedImport(imports);
-
-        javaFile.declareImport(imports);
-        javaFile.javadocComment(comment -> comment.description(enumType.getDescription()));
-
-        String enumName = enumType.getName();
-        IType elementType = enumType.getElementType();
-        String typeName = elementType.getClientType().toString();
-        String pascalTypeName = CodeNamer.toPascalCase(typeName);
-        String declaration = enumName + " implements ExpandableEnum<" + pascalTypeName + ">";
-
-        javaFile.publicFinalClass(declaration, classBlock -> {
-            classBlock.privateStaticFinalVariable("Map VALUES = new ConcurrentHashMap<>()");
-
-            for (ClientEnumValue enumValue : enumType.getValues()) {
-                String value = enumValue.getValue();
-                classBlock.javadocComment(CoreUtils.isNullOrEmpty(enumValue.getDescription())
-                    ? "Static value " + value + " for " + enumName + "."
-                    : enumValue.getDescription());
-                addGeneratedAnnotation(classBlock);
-                classBlock.publicStaticFinalVariable(String.format("%1$s %2$s = from%3$s(%4$s)", enumName,
-                    enumValue.getName(), pascalTypeName, elementType.defaultValueExpression(value)));
-            }
-
-            classBlock.variable("String name", JavaVisibility.Private, JavaModifier.Final);
-            classBlock.privateConstructor(enumName + "(String name)", ctor -> {
-                ctor.line("this.name = name;");
-            });
-
-            // fromString(typeName)
-            classBlock.javadocComment(comment -> {
-                comment.description("Creates or finds a " + enumName);
-                comment.param("name", "a name to look for");
-                comment.methodReturns("the corresponding " + enumName);
-            });
-
-            addGeneratedAnnotation(classBlock);
-            if (!settings.isStreamStyleSerialization()) {
-                classBlock.annotation("JsonCreator");
-            }
-
-            classBlock.publicStaticMethod(String.format("%1$s from%2$s(%3$s name)", enumName, pascalTypeName, typeName),
-                function -> {
-                    function.ifBlock("name == null", ifAction -> ifAction.methodReturn("null"));
-                    function.line(enumName + " value = VALUES.get(name);");
-                    function.ifBlock("value != null", ifAction -> {
-                        ifAction.line("return value;");
-                    });
-                    function.methodReturn("VALUES.computeIfAbsent(name, key -> new " + enumName + "(key))");
-                });
-
-            // getValue
-            classBlock.javadocComment(comment -> {
-                comment.description("Gets the value of the " + enumName + " instance.");
-                comment.methodReturns("the value of the " + enumName + " instance.");
-            });
-
-            addGeneratedAnnotation(classBlock);
-            classBlock.annotation("Override");
-            classBlock.publicMethod(pascalTypeName + " getValue()", function -> function.methodReturn("this.name"));
-
-            addGeneratedAnnotation(classBlock);
-            classBlock.annotation("Override");
-            classBlock.method(JavaVisibility.Public, null, "String toString()",
-                function -> function.methodReturn("name"));
-        });
     }
 
     private void writeExpandableStringEnum(EnumType enumType, JavaFile javaFile, JavaSettings settings) {
@@ -385,6 +208,110 @@ private void writeEnum(EnumType enumType, JavaFile javaFile, JavaSettings settin
         });
     }
 
+    private void writeExpandableEnumInterface(EnumType enumType, JavaFile javaFile, JavaSettings settings) {
+        Set imports = new HashSet<>();
+        imports.add("java.util.Collection");
+        imports.add("java.lang.IllegalArgumentException");
+        imports.add("java.util.Map");
+        imports.add("java.util.concurrent.ConcurrentHashMap");
+        imports.add("java.util.ArrayList");
+        imports.add("java.util.Objects");
+        imports.add(ClassType.EXPANDABLE_ENUM.getFullName());
+        imports.add("java.util.function.Function");
+        if (!settings.isStreamStyleSerialization()) {
+            imports.add("com.fasterxml.jackson.annotation.JsonCreator");
+        }
+
+        addGeneratedImport(imports);
+
+        javaFile.declareImport(imports);
+        javaFile.javadocComment(comment -> comment.description(enumType.getDescription()));
+
+        String enumName = enumType.getName();
+        IType elementType = enumType.getElementType();
+        String typeName = elementType.getClientType().asNullable().toString();
+        String pascalTypeName = CodeNamer.toPascalCase(typeName);
+        String declaration = enumName + " implements ExpandableEnum<" + pascalTypeName + ">";
+        javaFile.publicFinalClass(declaration, classBlock -> {
+            classBlock.privateStaticFinalVariable(
+                String.format("Map<%1$s, %2$s> VALUES = new ConcurrentHashMap<>()", pascalTypeName, enumName));
+            classBlock.privateStaticFinalVariable(
+                String.format("Function<%1$s, %2$s> NEW_INSTANCE = %2$s::new", pascalTypeName, enumName));
+
+            for (ClientEnumValue enumValue : enumType.getValues()) {
+                String value = enumValue.getValue();
+                classBlock.javadocComment(CoreUtils.isNullOrEmpty(enumValue.getDescription())
+                    ? "Static value " + value + " for " + enumName + "."
+                    : enumValue.getDescription());
+                addGeneratedAnnotation(classBlock);
+                classBlock.publicStaticFinalVariable(String.format("%1$s %2$s = fromValue(%3$s)", enumName,
+                    enumValue.getName(), elementType.defaultValueExpression(value)));
+            }
+
+            classBlock.variable(pascalTypeName + " value", JavaVisibility.Private, JavaModifier.Final);
+            classBlock.privateConstructor(enumName + "(" + pascalTypeName + " value)", ctor -> {
+                ctor.line("this.value = value;");
+            });
+
+            // fromValue(typeName)
+            classBlock.javadocComment(comment -> {
+                comment.description("Creates or finds a " + enumName);
+                comment.param("value", "a value to look for");
+                comment.methodReturns("the corresponding " + enumName);
+                comment.methodThrows("IllegalArgumentException", "if value is null");
+            });
+
+            addGeneratedAnnotation(classBlock);
+            if (!settings.isStreamStyleSerialization()) {
+                classBlock.annotation("JsonCreator");
+            }
+
+            classBlock.publicStaticMethod(String.format("%1$s fromValue(%2$s value)", enumName, pascalTypeName),
+                function -> {
+                    function.ifBlock("value == null",
+                        ifBlock -> ifBlock.line("throw new IllegalArgumentException(\"'value' cannot be null.\");"));
+                    function.methodReturn("VALUES.computeIfAbsent(value, NEW_INSTANCE)");
+                });
+
+            // values
+            classBlock.javadocComment(comment -> {
+                comment.description("Gets known " + enumName + " values.");
+                comment.methodReturns("Known " + enumName + " values.");
+            });
+            addGeneratedAnnotation(classBlock);
+            classBlock.publicStaticMethod(String.format("Collection<%s> values()", enumName),
+                function -> function.methodReturn("new ArrayList<>(VALUES.values())"));
+
+            // getValue
+            classBlock.javadocComment(comment -> {
+                comment.description("Gets the value of the " + enumName + " instance.");
+                comment.methodReturns("the value of the " + enumName + " instance.");
+            });
+
+            addGeneratedAnnotation(classBlock);
+            classBlock.annotation("Override");
+            classBlock.publicMethod(pascalTypeName + " getValue()", function -> function.methodReturn("this.value"));
+
+            // toString
+            addGeneratedAnnotation(classBlock);
+            classBlock.annotation("Override");
+            classBlock.method(JavaVisibility.Public, null, "String toString()",
+                function -> function.methodReturn("Objects.toString(this.value)"));
+
+            // equals
+            addGeneratedAnnotation(classBlock);
+            classBlock.annotation("Override");
+            classBlock.method(JavaVisibility.Public, null, "boolean equals(Object obj)",
+                function -> function.methodReturn("this == obj"));
+
+            // hashcode
+            addGeneratedAnnotation(classBlock);
+            classBlock.annotation("Override");
+            classBlock.method(JavaVisibility.Public, null, "int hashCode()",
+                function -> function.methodReturn("Objects.hashCode(this.value)"));
+        });
+    }
+
     protected String getStringEnumImport() {
         return ClassType.EXPANDABLE_STRING_ENUM.getFullName();
     }
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java
index 33536bff25..cf1fbdf017 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/armresourceprovider/models/PriorityModel.java
@@ -42,10 +42,13 @@ private PriorityModel(Integer value) {
      * 
      * @param value a value to look for.
      * @return the corresponding PriorityModel.
+     * @throws IllegalArgumentException if value is null.
      */
     @JsonCreator
     public static PriorityModel fromValue(Integer value) {
-        Objects.requireNonNull(value, "'value' cannot be null.");
+        if (value == null) {
+            throw new IllegalArgumentException("'value' cannot be null.");
+        }
         return VALUES.computeIfAbsent(value, NEW_INSTANCE);
     }
 
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java
index c46f716d2b..1b12c43962 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/OlympicRecordModel.java
@@ -44,10 +44,13 @@ private OlympicRecordModel(Double value) {
      * 
      * @param value a value to look for.
      * @return the corresponding OlympicRecordModel.
+     * @throws IllegalArgumentException if value is null.
      */
     @Generated
     public static OlympicRecordModel fromValue(Double value) {
-        Objects.requireNonNull(value, "'value' cannot be null.");
+        if (value == null) {
+            throw new IllegalArgumentException("'value' cannot be null.");
+        }
         return VALUES.computeIfAbsent(value, NEW_INSTANCE);
     }
 
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java
index 43b1221128..c5c75d6d73 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/tsptest/enumservice/models/PriorityModel.java
@@ -44,10 +44,13 @@ private PriorityModel(Integer value) {
      * 
      * @param value a value to look for.
      * @return the corresponding PriorityModel.
+     * @throws IllegalArgumentException if value is null.
      */
     @Generated
     public static PriorityModel fromValue(Integer value) {
-        Objects.requireNonNull(value, "'value' cannot be null.");
+        if (value == null) {
+            throw new IllegalArgumentException("'value' cannot be null.");
+        }
         return VALUES.computeIfAbsent(value, NEW_INSTANCE);
     }
 

From c315925a7e9c158606bb1305e290b8c5547b1980 Mon Sep 17 00:00:00 2001
From: Weidong Xu 
Date: Fri, 13 Dec 2024 07:01:08 +0800
Subject: [PATCH 60/71] http-client-java, remove code of convert contentType to
 header param (#5351)

for
https://github.com/Azure/azure-sdk-for-java/pull/43318/files#r1878889294

test PR https://github.com/Azure/autorest.java/pull/2996, it passes
---
 .../core/preprocessor/tranformer/Transformer.java  | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/preprocessor/tranformer/Transformer.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/preprocessor/tranformer/Transformer.java
index 90e5af1b9c..f6777723a8 100644
--- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/preprocessor/tranformer/Transformer.java
+++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/preprocessor/tranformer/Transformer.java
@@ -39,7 +39,6 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Optional;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -206,19 +205,6 @@ private void transformOperationGroups(List operationGroups, Code
                                 }
                             }
                         }
-                        // convert contentType to header param
-                        Optional contentType = request.getParameters()
-                            .stream()
-                            .filter(p -> (p.getProtocol() == null || p.getProtocol().getHttp() == null)
-                                && "contentType".equals(p.getLanguage().getDefault().getName()))
-                            .findFirst();
-                        if (contentType.isPresent()) {
-                            Protocols protocols = new Protocols();
-                            protocols.setHttp(new Protocol());
-                            protocols.getHttp().setIn(RequestParameterLocation.HEADER);
-                            contentType.get().setProtocol(protocols);
-                            contentType.get().getLanguage().getDefault().setSerializedName("Content-Type");
-                        }
                     }
                     renameOdataParameterNames(request);
                     deduplicateParameterNames(request);

From cc6f41abb14d14d716f4188abe0f2b118f16c86b Mon Sep 17 00:00:00 2001
From: Yuchao Yan 
Date: Fri, 13 Dec 2024 09:37:27 +0800
Subject: [PATCH 61/71] [python] bump tsp 0.63.0 (#5352)

bump tsp 0.63.0
---
 packages/http-client-python/CHANGELOG.md      |    6 +
 packages/http-client-python/package-lock.json | 6839 ++++++++---------
 packages/http-client-python/package.json      |   47 +-
 3 files changed, 3437 insertions(+), 3455 deletions(-)

diff --git a/packages/http-client-python/CHANGELOG.md b/packages/http-client-python/CHANGELOG.md
index 3e48e543ab..6d5cbbd6e2 100644
--- a/packages/http-client-python/CHANGELOG.md
+++ b/packages/http-client-python/CHANGELOG.md
@@ -1,5 +1,11 @@
 # Change Log - @typespec/http-client-python
 
+## 0.4.3
+
+### Bump dependencies
+
+- Bump `@typespec/*` 0.63.0 and `@azure-tools/*` 0.49.0
+
 ## 0.4.2
 
 ### Bug Fixes
diff --git a/packages/http-client-python/package-lock.json b/packages/http-client-python/package-lock.json
index aa6c583052..f2351a2db2 100644
--- a/packages/http-client-python/package-lock.json
+++ b/packages/http-client-python/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "@typespec/http-client-python",
-  "version": "0.4.2",
+  "version": "0.4.3",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "@typespec/http-client-python",
-      "version": "0.4.2",
+      "version": "0.4.3",
       "hasInstallScript": true,
       "license": "MIT",
       "dependencies": {
@@ -15,21 +15,22 @@
         "tsx": "~4.19.1"
       },
       "devDependencies": {
-        "@azure-tools/cadl-ranch-expect": "~0.15.6",
-        "@azure-tools/cadl-ranch-specs": "~0.39.1",
-        "@azure-tools/typespec-autorest": "~0.48.0",
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-        "@azure-tools/typespec-azure-rulesets": "~0.48.0",
-        "@azure-tools/typespec-client-generator-core": "~0.48.5",
+        "@azure-tools/cadl-ranch": "~0.16.2",
+        "@azure-tools/cadl-ranch-expect": "~0.15.7",
+        "@azure-tools/cadl-ranch-specs": "~0.39.6",
+        "@azure-tools/typespec-autorest": "~0.49.0",
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+        "@azure-tools/typespec-azure-rulesets": "~0.49.0",
+        "@azure-tools/typespec-client-generator-core": "~0.49.0",
         "@types/js-yaml": "~4.0.5",
         "@types/node": "~22.5.4",
         "@types/semver": "7.5.8",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0",
         "c8": "^10.1.2",
         "chalk": "5.3.0",
         "rimraf": "~6.0.1",
@@ -41,32 +42,32 @@
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
-        "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
-        "@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0",
-        "@azure-tools/typespec-azure-rulesets": ">=0.48.0 <3.0.0",
-        "@azure-tools/typespec-client-generator-core": ">=0.48.5 <1.0.0",
-        "@typespec/compiler": ">=0.62.0 <1.0.0",
-        "@typespec/http": ">=0.62.0 <1.0.0",
-        "@typespec/openapi": ">=0.62.0 <1.0.0",
-        "@typespec/rest": ">=0.62.0 <1.0.0",
-        "@typespec/versioning": ">=0.62.0 <1.0.0"
+        "@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
+        "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
+        "@azure-tools/typespec-azure-resource-manager": ">=0.49.0 <1.0.0",
+        "@azure-tools/typespec-azure-rulesets": ">=0.49.0 <3.0.0",
+        "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0",
+        "@typespec/compiler": ">=0.63.0 <1.0.0",
+        "@typespec/http": ">=0.63.0 <1.0.0",
+        "@typespec/openapi": ">=0.63.0 <1.0.0",
+        "@typespec/rest": ">=0.63.0 <1.0.0",
+        "@typespec/versioning": ">=0.63.0 <1.0.0"
       }
     },
     "node_modules/@azure-tools/cadl-ranch": {
-      "version": "0.16.1",
-      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch/-/cadl-ranch-0.16.1.tgz",
-      "integrity": "sha512-4tyd+2GDsZjkcsiB14T2m5imkPCokJkFLKrPe0mINb5Z6DVVzk/2BkhId//zk9KinpYL0ThG9ewM1ZeJ0jnoeg==",
+      "version": "0.16.2",
+      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch/-/cadl-ranch-0.16.2.tgz",
+      "integrity": "sha512-1FtmiOp89qo3Jj2Gq6hTq23paolHocxNoBIugZPcEPY0ZNwOe+Ea24D0v0e3gd6RbomRKfKbmr3UVodN/xWLQA==",
       "dev": true,
       "dependencies": {
         "@azure-tools/cadl-ranch-api": "~0.5.0",
         "@azure-tools/cadl-ranch-coverage-sdk": "~0.9.0",
-        "@azure-tools/cadl-ranch-expect": "~0.15.6",
+        "@azure-tools/cadl-ranch-expect": "~0.15.7",
         "@azure/identity": "^4.4.1",
         "@types/js-yaml": "^4.0.5",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
         "ajv": "8.17.1",
         "axios": "^1.7.5",
         "body-parser": "^1.20.3",
@@ -131,79 +132,79 @@
       }
     },
     "node_modules/@azure-tools/cadl-ranch-expect": {
-      "version": "0.15.6",
-      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.6.tgz",
-      "integrity": "sha512-t601oyRwiSy/Nbbro5A7OHZSKsVGxGRJMPnd4X80dYetTBinUHXS2+cVx+fVQlUmb/4Ru/qNOvG0jtTJY9/XHw==",
+      "version": "0.15.7",
+      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.7.tgz",
+      "integrity": "sha512-3f6PLUn4vVyiKOTnqdxppHhpQ3chb2D6ZMI7w65Xf5DYByyqC/rnMU25AjUu1jiIKwwANDtd6UDX6pWQrj87vQ==",
       "dev": true,
       "engines": {
         "node": ">=16.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/cadl-ranch-specs": {
-      "version": "0.39.1",
-      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-specs/-/cadl-ranch-specs-0.39.1.tgz",
-      "integrity": "sha512-eZy1fHt9wVFQ4aHTEz9zCKW2vFk34mN3tB3Qbuk9tZMaD62FSHVO0PkawOTFuxOlhavRkd7sw2W2nihWIVVqeQ==",
+      "version": "0.39.6",
+      "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-specs/-/cadl-ranch-specs-0.39.6.tgz",
+      "integrity": "sha512-oa8CDSVZhpO8xwjxLjgAa8ppyBel/QCCw9DjAd6sdj/VumJq+Bzcj9wKly0Vy4RFqdPSxPMdCcjlED63Xb1+YQ==",
       "dev": true,
       "dependencies": {
-        "@azure-tools/cadl-ranch": "~0.16.1",
+        "@azure-tools/cadl-ranch": "~0.16.2",
         "@azure-tools/cadl-ranch-api": "~0.5.0"
       },
       "engines": {
         "node": ">=16.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/cadl-ranch-expect": "~0.15.6",
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0",
-        "@typespec/xml": "~0.62.0"
+        "@azure-tools/cadl-ranch-expect": "~0.15.7",
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0",
+        "@typespec/xml": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-autorest": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.48.0.tgz",
-      "integrity": "sha512-AyoNMq3EORugHynFF8bN0TJh+zYxui/ApU5DoVEL7Xr1yMD6k9p5b90VD4HiCsP0dz8470ApFnjt5Vl6xCSzig==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.49.0.tgz",
+      "integrity": "sha512-stwfhmEc3yPeXbM8yfLKVCtaX5mR0H+sL74Xy/eMdEWoJgiE3aJxkgRWESu/7/vo99vugzo/HRwIEO5ELnyfRg==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-        "@azure-tools/typespec-client-generator-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+        "@azure-tools/typespec-client-generator-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-core": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.48.0.tgz",
-      "integrity": "sha512-80qyqgTgBbrnCGXtz6eWAMBdEAjYVVL780L0Ye+rBEd6VoA0m3JrgzUqf5bC0Iwju6lEtBAb8o6sefKD/NGA7g==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.49.0.tgz",
+      "integrity": "sha512-hNKy+aePmPkB1brHQkO1tsJXqXPzt/9ehy10dv0rKdp9xq5dE3yBctHF5Aj3Nr8kr8GRG5z4KYpYPbV5guoT5w==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/rest": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/rest": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-resource-manager": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.48.0.tgz",
-      "integrity": "sha512-4JxPbKxd3EJ98sLbtfBlqyANWVrU6tT2nk3iLspg7MITPLhiMTeRT9BprsJXH18ks8qw8scR7/am5r57YERTmQ==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.49.0.tgz",
+      "integrity": "sha512-1xWuG8OBJDykYM6BFD2owV9WH+oC32zt7XteXA0T4nH2T+D+sEFKppkCOMtIjX7ENBAlecmbdwgSNTZYQf4vaw==",
       "dev": true,
       "dependencies": {
         "change-case": "~5.4.4",
@@ -213,48 +214,49 @@
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-azure-rulesets": {
-      "version": "0.48.0",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.48.0.tgz",
-      "integrity": "sha512-IkPxC8v9wVSl/eKU7N4NhqD3RPh+bIYpxDW5LBAhkuQVcE3RumAkWqh2pmkckihQRhgwiCXhcJVZAzBpVa5SUA==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.49.0.tgz",
+      "integrity": "sha512-qKynK3lp+eqlt6QPGFSptrt9uqJUfeuv6yVXYDuaX1Jqu7tbTAgGf0HtN8mqPzfu3eAb84bdq6VgNspxyXLDOg==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-        "@azure-tools/typespec-client-generator-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+        "@azure-tools/typespec-client-generator-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@azure-tools/typespec-client-generator-core": {
-      "version": "0.48.5",
-      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.5.tgz",
-      "integrity": "sha512-oAGyH99f3FMzTVE82A/hHupMlpDhxBUTL63wCUab9DM6Rqk+liBGobGl/EPdiOxpvcvhm1drEhkFCkqJt6JenA==",
+      "version": "0.49.0",
+      "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.49.0.tgz",
+      "integrity": "sha512-inFLRIeTU0mQg4PT19O3YwT/4YODLuTgIsXuhKDdG/sEsx8PG8AEFTabtnZJ0w3Lc4xuxKFJrzZ2ZH2iiAAbig==",
       "dev": true,
       "dependencies": {
         "change-case": "~5.4.4",
-        "pluralize": "^8.0.0"
+        "pluralize": "^8.0.0",
+        "yaml": "~2.5.1"
       },
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@azure-tools/typespec-azure-core": "~0.48.0",
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0",
-        "@typespec/openapi": "~0.62.0",
-        "@typespec/rest": "~0.62.0",
-        "@typespec/versioning": "~0.62.0"
+        "@azure-tools/typespec-azure-core": "~0.49.0",
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0",
+        "@typespec/openapi": "~0.63.0",
+        "@typespec/rest": "~0.63.0",
+        "@typespec/versioning": "~0.63.0"
       }
     },
     "node_modules/@azure/abort-controller": {
@@ -343,15 +345,15 @@
       }
     },
     "node_modules/@azure/core-rest-pipeline": {
-      "version": "1.17.0",
-      "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.17.0.tgz",
-      "integrity": "sha512-62Vv8nC+uPId3j86XJ0WI+sBf0jlqTqPUFCBNrGtlaUeQUIXWV/D8GE5A1d+Qx8H7OQojn2WguC8kChD6v0shA==",
+      "version": "1.18.1",
+      "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.18.1.tgz",
+      "integrity": "sha512-/wS73UEDrxroUEVywEm7J0p2c+IIiVxyfigCGfsKvCxxCET4V/Hef2aURqltrXMRjNmdmt5IuOgIpl8f6xdO5A==",
       "dev": true,
       "dependencies": {
         "@azure/abort-controller": "^2.0.0",
         "@azure/core-auth": "^1.8.0",
         "@azure/core-tracing": "^1.0.1",
-        "@azure/core-util": "^1.9.0",
+        "@azure/core-util": "^1.11.0",
         "@azure/logger": "^1.0.0",
         "http-proxy-agent": "^7.0.0",
         "https-proxy-agent": "^7.0.0",
@@ -458,9 +460,9 @@
       }
     },
     "node_modules/@azure/msal-node": {
-      "version": "2.16.0",
-      "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.0.tgz",
-      "integrity": "sha512-oww0oJTOOvPKTVXqVyxfcFVjExQKYEkKR5KM0cTG3jnzt6u/MRMx8XaK49L/bxV35r9sCHQFjNlEShad9qGSYA==",
+      "version": "2.16.2",
+      "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.2.tgz",
+      "integrity": "sha512-An7l1hEr0w1HMMh1LU+rtDtqL7/jw74ORlc9Wnh06v7TU/xpG39/Zdr1ZJu3QpjUfKJ+E0/OXMW8DRSWTlh7qQ==",
       "dev": true,
       "dependencies": {
         "@azure/msal-common": "14.16.0",
@@ -472,9 +474,9 @@
       }
     },
     "node_modules/@azure/storage-blob": {
-      "version": "12.25.0",
-      "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.25.0.tgz",
-      "integrity": "sha512-oodouhA3nCCIh843tMMbxty3WqfNT+Vgzj3Xo5jqR9UPnzq3d7mzLjlHAYz7lW+b4km3SIgz+NAgztvhm7Z6kQ==",
+      "version": "12.26.0",
+      "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.26.0.tgz",
+      "integrity": "sha512-SriLPKezypIsiZ+TtlFfE46uuBIap2HeaQVS78e1P7rz5OSbq0rsd52WE1mC5f7vAeLiXqv7I7oRhL3WFZEw3Q==",
       "dev": true,
       "dependencies": {
         "@azure/abort-controller": "^2.1.2",
@@ -589,10 +591,13 @@
       }
     },
     "node_modules/@bcoe/v8-coverage": {
-      "version": "0.2.3",
-      "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
-      "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
-      "dev": true
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.1.tgz",
+      "integrity": "sha512-W+a0/JpU28AqH4IKtwUPcEUnUyXMDLALcn5/JLczGGT9fHE2sIby/xP/oQnx3nxkForzgzPy201RAKcB4xPAFQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=18"
+      }
     },
     "node_modules/@colors/colors": {
       "version": "1.6.0",
@@ -615,291 +620,273 @@
       }
     },
     "node_modules/@esbuild/aix-ppc64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
-      "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz",
+      "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==",
       "cpu": [
         "ppc64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "aix"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/android-arm": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
-      "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz",
+      "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==",
       "cpu": [
         "arm"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "android"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/android-arm64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
-      "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz",
+      "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==",
       "cpu": [
         "arm64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "android"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/android-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
-      "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz",
+      "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "android"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/darwin-arm64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
-      "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz",
+      "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==",
       "cpu": [
         "arm64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "darwin"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/darwin-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
-      "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz",
+      "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "darwin"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/freebsd-arm64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
-      "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz",
+      "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==",
       "cpu": [
         "arm64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "freebsd"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/freebsd-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
-      "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz",
+      "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "freebsd"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-arm": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
-      "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz",
+      "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==",
       "cpu": [
         "arm"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-arm64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
-      "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz",
+      "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==",
       "cpu": [
         "arm64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-ia32": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
-      "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz",
+      "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==",
       "cpu": [
         "ia32"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-loong64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
-      "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz",
+      "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==",
       "cpu": [
         "loong64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-mips64el": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
-      "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz",
+      "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==",
       "cpu": [
         "mips64el"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-ppc64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
-      "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz",
+      "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==",
       "cpu": [
         "ppc64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-riscv64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
-      "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz",
+      "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==",
       "cpu": [
         "riscv64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-s390x": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
-      "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz",
+      "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==",
       "cpu": [
         "s390x"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/linux-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
-      "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz",
+      "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "linux"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/netbsd-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
-      "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz",
+      "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "netbsd"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/openbsd-arm64": {
@@ -918,67 +905,63 @@
       }
     },
     "node_modules/@esbuild/openbsd-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
-      "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz",
+      "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "openbsd"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/sunos-x64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
-      "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz",
+      "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==",
       "cpu": [
         "x64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "sunos"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/win32-arm64": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
-      "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz",
+      "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==",
       "cpu": [
         "arm64"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "win32"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/win32-ia32": {
-      "version": "0.21.5",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
-      "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
+      "version": "0.23.1",
+      "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz",
+      "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==",
       "cpu": [
         "ia32"
       ],
-      "dev": true,
       "optional": true,
       "os": [
         "win32"
       ],
       "engines": {
-        "node": ">=12"
+        "node": ">=18"
       }
     },
     "node_modules/@esbuild/win32-x64": {
@@ -1014,6 +997,18 @@
         "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
       }
     },
+    "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
+      "version": "3.4.3",
+      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
+      "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+      "dev": true,
+      "engines": {
+        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+      },
+      "funding": {
+        "url": "https://opencollective.com/eslint"
+      }
+    },
     "node_modules/@eslint-community/regexpp": {
       "version": "4.12.1",
       "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz",
@@ -1024,13 +1019,13 @@
       }
     },
     "node_modules/@eslint/config-array": {
-      "version": "0.18.0",
-      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.18.0.tgz",
-      "integrity": "sha512-fTxvnS1sRMu3+JjXwJG0j/i4RT9u4qJ+lqS/yCGap4lH4zZGzQ7tu+xZqQmcMZq5OBZDL4QRxQzRjkWcGt8IVw==",
+      "version": "0.19.1",
+      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.1.tgz",
+      "integrity": "sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==",
       "dev": true,
       "peer": true,
       "dependencies": {
-        "@eslint/object-schema": "^2.1.4",
+        "@eslint/object-schema": "^2.1.5",
         "debug": "^4.3.1",
         "minimatch": "^3.1.2"
       },
@@ -1038,21 +1033,10 @@
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
       }
     },
-    "node_modules/@eslint/config-array/node_modules/brace-expansion": {
-      "version": "1.1.11",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
-      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
-      "dev": true,
-      "peer": true,
-      "dependencies": {
-        "balanced-match": "^1.0.0",
-        "concat-map": "0.0.1"
-      }
-    },
     "node_modules/@eslint/config-array/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "peer": true,
       "dependencies": {
@@ -1067,19 +1051,6 @@
         }
       }
     },
-    "node_modules/@eslint/config-array/node_modules/minimatch": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
-      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
-      "dev": true,
-      "peer": true,
-      "dependencies": {
-        "brace-expansion": "^1.1.7"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
     "node_modules/@eslint/config-array/node_modules/ms": {
       "version": "2.1.3",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -1088,19 +1059,22 @@
       "peer": true
     },
     "node_modules/@eslint/core": {
-      "version": "0.7.0",
-      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz",
-      "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==",
+      "version": "0.9.1",
+      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.9.1.tgz",
+      "integrity": "sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==",
       "dev": true,
       "peer": true,
+      "dependencies": {
+        "@types/json-schema": "^7.0.15"
+      },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
       }
     },
     "node_modules/@eslint/eslintrc": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz",
-      "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==",
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz",
+      "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==",
       "dev": true,
       "peer": true,
       "dependencies": {
@@ -1138,21 +1112,10 @@
         "url": "https://github.com/sponsors/epoberezkin"
       }
     },
-    "node_modules/@eslint/eslintrc/node_modules/brace-expansion": {
-      "version": "1.1.11",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
-      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
-      "dev": true,
-      "peer": true,
-      "dependencies": {
-        "balanced-match": "^1.0.0",
-        "concat-map": "0.0.1"
-      }
-    },
     "node_modules/@eslint/eslintrc/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "peer": true,
       "dependencies": {
@@ -1174,19 +1137,6 @@
       "dev": true,
       "peer": true
     },
-    "node_modules/@eslint/eslintrc/node_modules/minimatch": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
-      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
-      "dev": true,
-      "peer": true,
-      "dependencies": {
-        "brace-expansion": "^1.1.7"
-      },
-      "engines": {
-        "node": "*"
-      }
-    },
     "node_modules/@eslint/eslintrc/node_modules/ms": {
       "version": "2.1.3",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
@@ -1195,9 +1145,9 @@
       "peer": true
     },
     "node_modules/@eslint/js": {
-      "version": "9.14.0",
-      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz",
-      "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==",
+      "version": "9.16.0",
+      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.16.0.tgz",
+      "integrity": "sha512-tw2HxzQkrbeuvyj1tG2Yqq+0H9wGoI2IMk4EOsQeX+vmd75FtJAzf+gTA69WF+baUKRYQ3x2kbLE08js5OsTVg==",
       "dev": true,
       "peer": true,
       "engines": {
@@ -1205,9 +1155,9 @@
       }
     },
     "node_modules/@eslint/object-schema": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.4.tgz",
-      "integrity": "sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==",
+      "version": "2.1.5",
+      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.5.tgz",
+      "integrity": "sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==",
       "dev": true,
       "peer": true,
       "engines": {
@@ -1215,9 +1165,9 @@
       }
     },
     "node_modules/@eslint/plugin-kit": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.2.tgz",
-      "integrity": "sha512-CXtq5nR4Su+2I47WPOlWud98Y5Lv8Kyxp2ukhgFx/eW6Blm18VXJO5WuQylPugRo8nbluoi6GvvxBLqHcvqUUw==",
+      "version": "0.2.4",
+      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.4.tgz",
+      "integrity": "sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==",
       "dev": true,
       "peer": true,
       "dependencies": {
@@ -1390,9 +1340,9 @@
       }
     },
     "node_modules/@rollup/rollup-android-arm-eabi": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.24.4.tgz",
-      "integrity": "sha512-jfUJrFct/hTA0XDM5p/htWKoNNTbDLY0KRwEt6pyOA6k2fmk0WVwl65PdUdJZgzGEHWx+49LilkcSaumQRyNQw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.28.1.tgz",
+      "integrity": "sha512-2aZp8AES04KI2dy3Ss6/MDjXbwBzj+i0GqKtWXgw2/Ma6E4jJvujryO6gJAghIRVz7Vwr9Gtl/8na3nDUKpraQ==",
       "cpu": [
         "arm"
       ],
@@ -1403,9 +1353,9 @@
       ]
     },
     "node_modules/@rollup/rollup-android-arm64": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.24.4.tgz",
-      "integrity": "sha512-j4nrEO6nHU1nZUuCfRKoCcvh7PIywQPUCBa2UsootTHvTHIoIu2BzueInGJhhvQO/2FTRdNYpf63xsgEqH9IhA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.28.1.tgz",
+      "integrity": "sha512-EbkK285O+1YMrg57xVA+Dp0tDBRB93/BZKph9XhMjezf6F4TpYjaUSuPt5J0fZXlSag0LmZAsTmdGGqPp4pQFA==",
       "cpu": [
         "arm64"
       ],
@@ -1416,9 +1366,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-arm64": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.24.4.tgz",
-      "integrity": "sha512-GmU/QgGtBTeraKyldC7cDVVvAJEOr3dFLKneez/n7BvX57UdhOqDsVwzU7UOnYA7AAOt+Xb26lk79PldDHgMIQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.28.1.tgz",
+      "integrity": "sha512-prduvrMKU6NzMq6nxzQw445zXgaDBbMQvmKSJaxpaZ5R1QDM8w+eGxo6Y/jhT/cLoCvnZI42oEqf9KQNYz1fqQ==",
       "cpu": [
         "arm64"
       ],
@@ -1429,9 +1379,9 @@
       ]
     },
     "node_modules/@rollup/rollup-darwin-x64": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.24.4.tgz",
-      "integrity": "sha512-N6oDBiZCBKlwYcsEPXGDE4g9RoxZLK6vT98M8111cW7VsVJFpNEqvJeIPfsCzbf0XEakPslh72X0gnlMi4Ddgg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.28.1.tgz",
+      "integrity": "sha512-WsvbOunsUk0wccO/TV4o7IKgloJ942hVFK1CLatwv6TJspcCZb9umQkPdvB7FihmdxgaKR5JyxDjWpCOp4uZlQ==",
       "cpu": [
         "x64"
       ],
@@ -1442,9 +1392,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-arm64": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.24.4.tgz",
-      "integrity": "sha512-py5oNShCCjCyjWXCZNrRGRpjWsF0ic8f4ieBNra5buQz0O/U6mMXCpC1LvrHuhJsNPgRt36tSYMidGzZiJF6mw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.28.1.tgz",
+      "integrity": "sha512-HTDPdY1caUcU4qK23FeeGxCdJF64cKkqajU0iBnTVxS8F7H/7BewvYoG+va1KPSL63kQ1PGNyiwKOfReavzvNA==",
       "cpu": [
         "arm64"
       ],
@@ -1455,9 +1405,9 @@
       ]
     },
     "node_modules/@rollup/rollup-freebsd-x64": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.24.4.tgz",
-      "integrity": "sha512-L7VVVW9FCnTTp4i7KrmHeDsDvjB4++KOBENYtNYAiYl96jeBThFfhP6HVxL74v4SiZEVDH/1ILscR5U9S4ms4g==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.28.1.tgz",
+      "integrity": "sha512-m/uYasxkUevcFTeRSM9TeLyPe2QDuqtjkeoTpP9SW0XxUWfcYrGDMkO/m2tTw+4NMAF9P2fU3Mw4ahNvo7QmsQ==",
       "cpu": [
         "x64"
       ],
@@ -1468,9 +1418,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.24.4.tgz",
-      "integrity": "sha512-10ICosOwYChROdQoQo589N5idQIisxjaFE/PAnX2i0Zr84mY0k9zul1ArH0rnJ/fpgiqfu13TFZR5A5YJLOYZA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.28.1.tgz",
+      "integrity": "sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==",
       "cpu": [
         "arm"
       ],
@@ -1481,9 +1431,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm-musleabihf": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.24.4.tgz",
-      "integrity": "sha512-ySAfWs69LYC7QhRDZNKqNhz2UKN8LDfbKSMAEtoEI0jitwfAG2iZwVqGACJT+kfYvvz3/JgsLlcBP+WWoKCLcw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.28.1.tgz",
+      "integrity": "sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==",
       "cpu": [
         "arm"
       ],
@@ -1494,9 +1444,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-gnu": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.24.4.tgz",
-      "integrity": "sha512-uHYJ0HNOI6pGEeZ/5mgm5arNVTI0nLlmrbdph+pGXpC9tFHFDQmDMOEqkmUObRfosJqpU8RliYoGz06qSdtcjg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.28.1.tgz",
+      "integrity": "sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==",
       "cpu": [
         "arm64"
       ],
@@ -1507,9 +1457,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-arm64-musl": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.24.4.tgz",
-      "integrity": "sha512-38yiWLemQf7aLHDgTg85fh3hW9stJ0Muk7+s6tIkSUOMmi4Xbv5pH/5Bofnsb6spIwD5FJiR+jg71f0CH5OzoA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.28.1.tgz",
+      "integrity": "sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==",
       "cpu": [
         "arm64"
       ],
@@ -1519,10 +1469,23 @@
         "linux"
       ]
     },
+    "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.28.1.tgz",
+      "integrity": "sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==",
+      "cpu": [
+        "loong64"
+      ],
+      "dev": true,
+      "optional": true,
+      "os": [
+        "linux"
+      ]
+    },
     "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.24.4.tgz",
-      "integrity": "sha512-q73XUPnkwt9ZNF2xRS4fvneSuaHw2BXuV5rI4cw0fWYVIWIBeDZX7c7FWhFQPNTnE24172K30I+dViWRVD9TwA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.28.1.tgz",
+      "integrity": "sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==",
       "cpu": [
         "ppc64"
       ],
@@ -1533,9 +1496,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-riscv64-gnu": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.24.4.tgz",
-      "integrity": "sha512-Aie/TbmQi6UXokJqDZdmTJuZBCU3QBDA8oTKRGtd4ABi/nHgXICulfg1KI6n9/koDsiDbvHAiQO3YAUNa/7BCw==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.28.1.tgz",
+      "integrity": "sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==",
       "cpu": [
         "riscv64"
       ],
@@ -1546,9 +1509,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-s390x-gnu": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.24.4.tgz",
-      "integrity": "sha512-P8MPErVO/y8ohWSP9JY7lLQ8+YMHfTI4bAdtCi3pC2hTeqFJco2jYspzOzTUB8hwUWIIu1xwOrJE11nP+0JFAQ==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.28.1.tgz",
+      "integrity": "sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==",
       "cpu": [
         "s390x"
       ],
@@ -1559,9 +1522,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-gnu": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.4.tgz",
-      "integrity": "sha512-K03TljaaoPK5FOyNMZAAEmhlyO49LaE4qCsr0lYHUKyb6QacTNF9pnfPpXnFlFD3TXuFbFbz7tJ51FujUXkXYA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.28.1.tgz",
+      "integrity": "sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==",
       "cpu": [
         "x64"
       ],
@@ -1572,9 +1535,9 @@
       ]
     },
     "node_modules/@rollup/rollup-linux-x64-musl": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.24.4.tgz",
-      "integrity": "sha512-VJYl4xSl/wqG2D5xTYncVWW+26ICV4wubwN9Gs5NrqhJtayikwCXzPL8GDsLnaLU3WwhQ8W02IinYSFJfyo34Q==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.28.1.tgz",
+      "integrity": "sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==",
       "cpu": [
         "x64"
       ],
@@ -1585,9 +1548,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-arm64-msvc": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.24.4.tgz",
-      "integrity": "sha512-ku2GvtPwQfCqoPFIJCqZ8o7bJcj+Y54cZSr43hHca6jLwAiCbZdBUOrqE6y29QFajNAzzpIOwsckaTFmN6/8TA==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.28.1.tgz",
+      "integrity": "sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==",
       "cpu": [
         "arm64"
       ],
@@ -1598,9 +1561,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-ia32-msvc": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.24.4.tgz",
-      "integrity": "sha512-V3nCe+eTt/W6UYNr/wGvO1fLpHUrnlirlypZfKCT1fG6hWfqhPgQV/K/mRBXBpxc0eKLIF18pIOFVPh0mqHjlg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.28.1.tgz",
+      "integrity": "sha512-ZkyTJ/9vkgrE/Rk9vhMXhf8l9D+eAhbAVbsGsXKy2ohmJaWg0LPQLnIxRdRp/bKyr8tXuPlXhIoGlEB5XpJnGA==",
       "cpu": [
         "ia32"
       ],
@@ -1611,9 +1574,9 @@
       ]
     },
     "node_modules/@rollup/rollup-win32-x64-msvc": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.24.4.tgz",
-      "integrity": "sha512-LTw1Dfd0mBIEqUVCxbvTE/LLo+9ZxVC9k99v1v4ahg9Aak6FpqOfNu5kRkeTAn0wphoC4JU7No1/rL+bBCEwhg==",
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.28.1.tgz",
+      "integrity": "sha512-ZvK2jBafvttJjoIdKm/Q/Bh7IJ1Ose9IBOwpOXcOvW3ikGTQGmKDgxTC6oCAzW6PynbkKP8+um1du81XJHZ0JA==",
       "cpu": [
         "x64"
       ],
@@ -1682,16 +1645,16 @@
       "dev": true
     },
     "node_modules/@typescript-eslint/eslint-plugin": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.13.0.tgz",
-      "integrity": "sha512-nQtBLiZYMUPkclSeC3id+x4uVd1SGtHuElTxL++SfP47jR0zfkZBJHc+gL4qPsgTuypz0k8Y2GheaDYn6Gy3rg==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz",
+      "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==",
       "dev": true,
       "dependencies": {
         "@eslint-community/regexpp": "^4.10.0",
-        "@typescript-eslint/scope-manager": "8.13.0",
-        "@typescript-eslint/type-utils": "8.13.0",
-        "@typescript-eslint/utils": "8.13.0",
-        "@typescript-eslint/visitor-keys": "8.13.0",
+        "@typescript-eslint/scope-manager": "8.18.0",
+        "@typescript-eslint/type-utils": "8.18.0",
+        "@typescript-eslint/utils": "8.18.0",
+        "@typescript-eslint/visitor-keys": "8.18.0",
         "graphemer": "^1.4.0",
         "ignore": "^5.3.1",
         "natural-compare": "^1.4.0",
@@ -1706,24 +1669,20 @@
       },
       "peerDependencies": {
         "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
-        "eslint": "^8.57.0 || ^9.0.0"
-      },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
+        "eslint": "^8.57.0 || ^9.0.0",
+        "typescript": ">=4.8.4 <5.8.0"
       }
     },
     "node_modules/@typescript-eslint/parser": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.13.0.tgz",
-      "integrity": "sha512-w0xp+xGg8u/nONcGw1UXAr6cjCPU1w0XVyBs6Zqaj5eLmxkKQAByTdV/uGgNN5tVvN/kKpoQlP2cL7R+ajZZIQ==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz",
+      "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/scope-manager": "8.13.0",
-        "@typescript-eslint/types": "8.13.0",
-        "@typescript-eslint/typescript-estree": "8.13.0",
-        "@typescript-eslint/visitor-keys": "8.13.0",
+        "@typescript-eslint/scope-manager": "8.18.0",
+        "@typescript-eslint/types": "8.18.0",
+        "@typescript-eslint/typescript-estree": "8.18.0",
+        "@typescript-eslint/visitor-keys": "8.18.0",
         "debug": "^4.3.4"
       },
       "engines": {
@@ -1734,18 +1693,14 @@
         "url": "https://opencollective.com/typescript-eslint"
       },
       "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0"
-      },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
+        "eslint": "^8.57.0 || ^9.0.0",
+        "typescript": ">=4.8.4 <5.8.0"
       }
     },
     "node_modules/@typescript-eslint/parser/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
         "ms": "^2.1.3"
@@ -1766,13 +1721,13 @@
       "dev": true
     },
     "node_modules/@typescript-eslint/scope-manager": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.13.0.tgz",
-      "integrity": "sha512-XsGWww0odcUT0gJoBZ1DeulY1+jkaHUciUq4jKNv4cpInbvvrtDoyBH9rE/n2V29wQJPk8iCH1wipra9BhmiMA==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz",
+      "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "8.13.0",
-        "@typescript-eslint/visitor-keys": "8.13.0"
+        "@typescript-eslint/types": "8.18.0",
+        "@typescript-eslint/visitor-keys": "8.18.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1783,13 +1738,13 @@
       }
     },
     "node_modules/@typescript-eslint/type-utils": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.13.0.tgz",
-      "integrity": "sha512-Rqnn6xXTR316fP4D2pohZenJnp+NwQ1mo7/JM+J1LWZENSLkJI8ID8QNtlvFeb0HnFSK94D6q0cnMX6SbE5/vA==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz",
+      "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/typescript-estree": "8.13.0",
-        "@typescript-eslint/utils": "8.13.0",
+        "@typescript-eslint/typescript-estree": "8.18.0",
+        "@typescript-eslint/utils": "8.18.0",
         "debug": "^4.3.4",
         "ts-api-utils": "^1.3.0"
       },
@@ -1800,16 +1755,15 @@
         "type": "opencollective",
         "url": "https://opencollective.com/typescript-eslint"
       },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
+      "peerDependencies": {
+        "eslint": "^8.57.0 || ^9.0.0",
+        "typescript": ">=4.8.4 <5.8.0"
       }
     },
     "node_modules/@typescript-eslint/type-utils/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
         "ms": "^2.1.3"
@@ -1830,9 +1784,9 @@
       "dev": true
     },
     "node_modules/@typescript-eslint/types": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.13.0.tgz",
-      "integrity": "sha512-4cyFErJetFLckcThRUFdReWJjVsPCqyBlJTi6IDEpc1GWCIIZRFxVppjWLIMcQhNGhdWJJRYFHpHoDWvMlDzng==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz",
+      "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==",
       "dev": true,
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1843,13 +1797,13 @@
       }
     },
     "node_modules/@typescript-eslint/typescript-estree": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.13.0.tgz",
-      "integrity": "sha512-v7SCIGmVsRK2Cy/LTLGN22uea6SaUIlpBcO/gnMGT/7zPtxp90bphcGf4fyrCQl3ZtiBKqVTG32hb668oIYy1g==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz",
+      "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "8.13.0",
-        "@typescript-eslint/visitor-keys": "8.13.0",
+        "@typescript-eslint/types": "8.18.0",
+        "@typescript-eslint/visitor-keys": "8.18.0",
         "debug": "^4.3.4",
         "fast-glob": "^3.3.2",
         "is-glob": "^4.0.3",
@@ -1864,16 +1818,23 @@
         "type": "opencollective",
         "url": "https://opencollective.com/typescript-eslint"
       },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
+      "peerDependencies": {
+        "typescript": ">=4.8.4 <5.8.0"
+      }
+    },
+    "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+      "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+      "dev": true,
+      "dependencies": {
+        "balanced-match": "^1.0.0"
       }
     },
     "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
         "ms": "^2.1.3"
@@ -1909,15 +1870,15 @@
       "dev": true
     },
     "node_modules/@typescript-eslint/utils": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.13.0.tgz",
-      "integrity": "sha512-A1EeYOND6Uv250nybnLZapeXpYMl8tkzYUxqmoKAWnI4sei3ihf2XdZVd+vVOmHGcp3t+P7yRrNsyyiXTvShFQ==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz",
+      "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==",
       "dev": true,
       "dependencies": {
         "@eslint-community/eslint-utils": "^4.4.0",
-        "@typescript-eslint/scope-manager": "8.13.0",
-        "@typescript-eslint/types": "8.13.0",
-        "@typescript-eslint/typescript-estree": "8.13.0"
+        "@typescript-eslint/scope-manager": "8.18.0",
+        "@typescript-eslint/types": "8.18.0",
+        "@typescript-eslint/typescript-estree": "8.18.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1927,17 +1888,18 @@
         "url": "https://opencollective.com/typescript-eslint"
       },
       "peerDependencies": {
-        "eslint": "^8.57.0 || ^9.0.0"
+        "eslint": "^8.57.0 || ^9.0.0",
+        "typescript": ">=4.8.4 <5.8.0"
       }
     },
     "node_modules/@typescript-eslint/visitor-keys": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.13.0.tgz",
-      "integrity": "sha512-7N/+lztJqH4Mrf0lb10R/CbI1EaAMMGyF5y0oJvFoAhafwgiRA7TXyd8TFn8FC8k5y2dTsYogg238qavRGNnlw==",
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz",
+      "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==",
       "dev": true,
       "dependencies": {
-        "@typescript-eslint/types": "8.13.0",
-        "eslint-visitor-keys": "^3.4.3"
+        "@typescript-eslint/types": "8.18.0",
+        "eslint-visitor-keys": "^4.2.0"
       },
       "engines": {
         "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1948,9 +1910,9 @@
       }
     },
     "node_modules/@typespec/compiler": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz",
-      "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz",
+      "integrity": "sha512-cC3YniwbFghn1fASX3r1IgNjMrwaY4gmzznkHT4f/NxE+HK4XoXWn4EG7287QgVMCaHUykzJCIfW9k7kIleW5A==",
       "dev": true,
       "dependencies": {
         "@babel/code-frame": "~7.25.7",
@@ -1958,7 +1920,7 @@
         "change-case": "~5.4.4",
         "globby": "~14.0.2",
         "mustache": "~4.2.0",
-        "picocolors": "~1.1.0",
+        "picocolors": "~1.1.1",
         "prettier": "~3.3.3",
         "prompts": "~2.4.2",
         "semver": "^7.6.3",
@@ -1977,16 +1939,16 @@
       }
     },
     "node_modules/@typespec/http": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz",
-      "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.63.0.tgz",
+      "integrity": "sha512-SYVbBmLPAPdWZfdMs0QlbpTnFREDnkINu2FR+0kRX12qzbRgpRbLsdhg59qx4TfKoh4IAPgSV+Fq84w7BWGsyQ==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/streams": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/streams": "~0.63.0"
       },
       "peerDependenciesMeta": {
         "@typespec/streams": {
@@ -1995,64 +1957,64 @@
       }
     },
     "node_modules/@typespec/openapi": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.62.0.tgz",
-      "integrity": "sha512-Xtm0Nd2BuSmEfSWGtc10ok22jyomYm9L2jY+kVTy+v5J89DrVh0o6+YpipUl1QhcItM1YMBphWHIHPfwkDRbnw==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.63.0.tgz",
+      "integrity": "sha512-/KzR60mj3P/LnNWd/QfH0KTN/If4+mjrsWNSB7/uab6c8Qu/lNsGlZDkmWq4EFiwBR7VmpdFz9FP7d/m3O+tGw==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0"
       }
     },
     "node_modules/@typespec/rest": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz",
-      "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.63.0.tgz",
+      "integrity": "sha512-HftzMjSDHAYX+ILE9C6pFS4oAq7oBHMCtpA8QgSFPDF4V5a8l1k2K8c4x1B+7yl+GkREmIdtpc6S0xZm2G7hXg==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0",
-        "@typespec/http": "~0.62.0"
+        "@typespec/compiler": "~0.63.0",
+        "@typespec/http": "~0.63.0"
       }
     },
     "node_modules/@typespec/versioning": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz",
-      "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.63.0.tgz",
+      "integrity": "sha512-BPvmPL+g20yEmSA8XRfbIHdToNOjssq4QfwOU6D7kKLLXnZHFb1hmuwW0tf0Wa/lYgoaUC60ONAeoXgNT1ZOIQ==",
       "dev": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0"
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@typespec/xml": {
-      "version": "0.62.0",
-      "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.62.0.tgz",
-      "integrity": "sha512-DexGTQHB75fncDcYfs5CIbNwO6NOhjwCaaNoHYAsVVzs4T8qwzw6WQdEEMzZRbgsxwnllFkxKwGhLtRMQdv/cQ==",
+      "version": "0.63.0",
+      "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.63.0.tgz",
+      "integrity": "sha512-2aQxWWqc5f4OTmC2nNafHi+ppr8GqwwMXx/2DnNjeshZF/JD0FNCYH8gV4gFZe7mfRfB9bAxNkcKj2AF01ntqA==",
       "dev": true,
       "peer": true,
       "engines": {
         "node": ">=18.0.0"
       },
       "peerDependencies": {
-        "@typespec/compiler": "~0.62.0"
+        "@typespec/compiler": "~0.63.0"
       }
     },
     "node_modules/@vitest/expect": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.4.tgz",
-      "integrity": "sha512-DOETT0Oh1avie/D/o2sgMHGrzYUFFo3zqESB2Hn70z6QB1HrS2IQ9z5DfyTqU8sg4Bpu13zZe9V4+UTNQlUeQA==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.8.tgz",
+      "integrity": "sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==",
       "dev": true,
       "dependencies": {
-        "@vitest/spy": "2.1.4",
-        "@vitest/utils": "2.1.4",
+        "@vitest/spy": "2.1.8",
+        "@vitest/utils": "2.1.8",
         "chai": "^5.1.2",
         "tinyrainbow": "^1.2.0"
       },
@@ -2061,12 +2023,12 @@
       }
     },
     "node_modules/@vitest/mocker": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.4.tgz",
-      "integrity": "sha512-Ky/O1Lc0QBbutJdW0rqLeFNbuLEyS+mIPiNdlVlp2/yhJ0SbyYqObS5IHdhferJud8MbbwMnexg4jordE5cCoQ==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.8.tgz",
+      "integrity": "sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==",
       "dev": true,
       "dependencies": {
-        "@vitest/spy": "2.1.4",
+        "@vitest/spy": "2.1.8",
         "estree-walker": "^3.0.3",
         "magic-string": "^0.30.12"
       },
@@ -2087,9 +2049,9 @@
       }
     },
     "node_modules/@vitest/pretty-format": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.4.tgz",
-      "integrity": "sha512-L95zIAkEuTDbUX1IsjRl+vyBSLh3PwLLgKpghl37aCK9Jvw0iP+wKwIFhfjdUtA2myLgjrG6VU6JCFLv8q/3Ww==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.8.tgz",
+      "integrity": "sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==",
       "dev": true,
       "dependencies": {
         "tinyrainbow": "^1.2.0"
@@ -2099,12 +2061,12 @@
       }
     },
     "node_modules/@vitest/runner": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.4.tgz",
-      "integrity": "sha512-sKRautINI9XICAMl2bjxQM8VfCMTB0EbsBc/EDFA57V6UQevEKY/TOPOF5nzcvCALltiLfXWbq4MaAwWx/YxIA==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.8.tgz",
+      "integrity": "sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==",
       "dev": true,
       "dependencies": {
-        "@vitest/utils": "2.1.4",
+        "@vitest/utils": "2.1.8",
         "pathe": "^1.1.2"
       },
       "funding": {
@@ -2112,12 +2074,12 @@
       }
     },
     "node_modules/@vitest/snapshot": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.4.tgz",
-      "integrity": "sha512-3Kab14fn/5QZRog5BPj6Rs8dc4B+mim27XaKWFWHWA87R56AKjHTGcBFKpvZKDzC4u5Wd0w/qKsUIio3KzWW4Q==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.8.tgz",
+      "integrity": "sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==",
       "dev": true,
       "dependencies": {
-        "@vitest/pretty-format": "2.1.4",
+        "@vitest/pretty-format": "2.1.8",
         "magic-string": "^0.30.12",
         "pathe": "^1.1.2"
       },
@@ -2126,9 +2088,9 @@
       }
     },
     "node_modules/@vitest/spy": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.4.tgz",
-      "integrity": "sha512-4JOxa+UAizJgpZfaCPKK2smq9d8mmjZVPMt2kOsg/R8QkoRzydHH1qHxIYNvr1zlEaFj4SXiaaJWxq/LPLKaLg==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.8.tgz",
+      "integrity": "sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==",
       "dev": true,
       "dependencies": {
         "tinyspy": "^3.0.2"
@@ -2138,12 +2100,12 @@
       }
     },
     "node_modules/@vitest/utils": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.4.tgz",
-      "integrity": "sha512-MXDnZn0Awl2S86PSNIim5PWXgIAx8CIkzu35mBdSApUip6RFOGXBCf3YFyeEu8n1IHk4bWD46DeYFu9mQlFIRg==",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.8.tgz",
+      "integrity": "sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==",
       "dev": true,
       "dependencies": {
-        "@vitest/pretty-format": "2.1.4",
+        "@vitest/pretty-format": "2.1.8",
         "loupe": "^3.1.2",
         "tinyrainbow": "^1.2.0"
       },
@@ -2151,18 +2113,6 @@
         "url": "https://opencollective.com/vitest"
       }
     },
-    "node_modules/abort-controller": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
-      "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
-      "dev": true,
-      "dependencies": {
-        "event-target-shim": "^5.0.0"
-      },
-      "engines": {
-        "node": ">=6.5"
-      }
-    },
     "node_modules/accepts": {
       "version": "1.3.8",
       "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
@@ -2200,40 +2150,14 @@
       }
     },
     "node_modules/agent-base": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz",
-      "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==",
+      "version": "7.1.3",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz",
+      "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
       "dev": true,
-      "dependencies": {
-        "debug": "^4.3.4"
-      },
       "engines": {
         "node": ">= 14"
       }
     },
-    "node_modules/agent-base/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
-      "dev": true,
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/agent-base/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "dev": true
-    },
     "node_modules/ajv": {
       "version": "8.17.1",
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
@@ -2344,9 +2268,9 @@
       }
     },
     "node_modules/axios": {
-      "version": "1.7.7",
-      "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz",
-      "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
+      "version": "1.7.9",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz",
+      "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==",
       "dev": true,
       "dependencies": {
         "follow-redirects": "^1.15.6",
@@ -2374,26 +2298,6 @@
       "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
       "dev": true
     },
-    "node_modules/base64-js": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
-      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ]
-    },
     "node_modules/basic-auth": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
@@ -2437,12 +2341,14 @@
       }
     },
     "node_modules/brace-expansion": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
-      "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+      "version": "1.1.11",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "balanced-match": "^1.0.0"
+        "balanced-match": "^1.0.0",
+        "concat-map": "0.0.1"
       }
     },
     "node_modules/braces": {
@@ -2457,30 +2363,6 @@
         "node": ">=8"
       }
     },
-    "node_modules/buffer": {
-      "version": "6.0.3",
-      "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
-      "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "dependencies": {
-        "base64-js": "^1.3.1",
-        "ieee754": "^1.2.1"
-      }
-    },
     "node_modules/buffer-equal-constant-time": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
@@ -2515,12 +2397,12 @@
       }
     },
     "node_modules/c8": {
-      "version": "10.1.2",
-      "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.2.tgz",
-      "integrity": "sha512-Qr6rj76eSshu5CgRYvktW0uM0CFY0yi4Fd5D0duDXO6sYinyopmftUiJVuzBQxQcwQLor7JWDVRP+dUfCmzgJw==",
+      "version": "10.1.3",
+      "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz",
+      "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==",
       "dev": true,
       "dependencies": {
-        "@bcoe/v8-coverage": "^0.2.3",
+        "@bcoe/v8-coverage": "^1.0.1",
         "@istanbuljs/schema": "^0.1.3",
         "find-up": "^5.0.0",
         "foreground-child": "^3.1.1",
@@ -2557,16 +2439,44 @@
       }
     },
     "node_modules/call-bind": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz",
-      "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==",
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
+      "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==",
       "dev": true,
       "dependencies": {
+        "call-bind-apply-helpers": "^1.0.0",
         "es-define-property": "^1.0.0",
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2",
         "get-intrinsic": "^1.2.4",
-        "set-function-length": "^1.2.1"
+        "set-function-length": "^1.2.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/call-bind-apply-helpers": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz",
+      "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==",
+      "dev": true,
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "function-bind": "^1.1.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/call-bound": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.2.tgz",
+      "integrity": "sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.8",
+        "get-intrinsic": "^1.2.5"
       },
       "engines": {
         "node": ">= 0.4"
@@ -2861,9 +2771,9 @@
       "dev": true
     },
     "node_modules/cross-spawn": {
-      "version": "7.0.3",
-      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
-      "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+      "version": "7.0.6",
+      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
       "dev": true,
       "dependencies": {
         "path-key": "^3.1.0",
@@ -3011,6 +2921,20 @@
         "npm": "1.2.8000 || >= 1.4.16"
       }
     },
+    "node_modules/dunder-proto": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.0.tgz",
+      "integrity": "sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==",
+      "dev": true,
+      "dependencies": {
+        "call-bind-apply-helpers": "^1.0.0",
+        "es-errors": "^1.3.0",
+        "gopd": "^1.2.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
     "node_modules/eastasianwidth": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
@@ -3054,13 +2978,10 @@
       }
     },
     "node_modules/es-define-property": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz",
-      "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==",
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+      "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
       "dev": true,
-      "dependencies": {
-        "get-intrinsic": "^1.2.4"
-      },
       "engines": {
         "node": ">= 0.4"
       }
@@ -3094,6 +3015,24 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/es-module-lexer": {
+      "version": "1.5.4",
+      "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz",
+      "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==",
+      "dev": true
+    },
+    "node_modules/es-object-atoms": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz",
+      "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==",
+      "dev": true,
+      "dependencies": {
+        "es-errors": "^1.3.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
     "node_modules/esbuild": {
       "version": "0.23.1",
       "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.23.1.tgz",
@@ -3132,357 +3071,560 @@
         "@esbuild/win32-x64": "0.23.1"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.23.1.tgz",
-      "integrity": "sha512-6VhYk1diRqrhBAqpJEdjASR/+WVRtfjpqKuNw11cLiaWpAT/Uu+nokB+UJnevzy/P9C/ty6AOe0dwueMrGh/iQ==",
-      "cpu": [
-        "ppc64"
-      ],
-      "optional": true,
-      "os": [
-        "aix"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
-    },
-    "node_modules/esbuild/node_modules/@esbuild/android-arm": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.23.1.tgz",
-      "integrity": "sha512-uz6/tEy2IFm9RYOyvKl88zdzZfwEfKZmnX9Cj1BHjeSGNuGLuMD1kR8y5bteYmwqKm1tj8m4cb/aKEorr6fHWQ==",
-      "cpu": [
-        "arm"
-      ],
-      "optional": true,
-      "os": [
-        "android"
-      ],
+    "node_modules/escalade": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+      "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+      "dev": true,
       "engines": {
-        "node": ">=18"
+        "node": ">=6"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/android-arm64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.23.1.tgz",
-      "integrity": "sha512-xw50ipykXcLstLeWH7WRdQuysJqejuAGPd30vd1i5zSyKK3WE+ijzHmLKxdiCMtH1pHz78rOg0BKSYOSB/2Khw==",
-      "cpu": [
-        "arm64"
-      ],
-      "optional": true,
-      "os": [
-        "android"
-      ],
-      "engines": {
-        "node": ">=18"
-      }
+    "node_modules/escape-html": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+      "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+      "dev": true
     },
-    "node_modules/esbuild/node_modules/@esbuild/android-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.23.1.tgz",
-      "integrity": "sha512-nlN9B69St9BwUoB+jkyU090bru8L0NA3yFvAd7k8dNsVH8bi9a8cUAUSEcEEgTp2z3dbEDGJGfP6VUnkQnlReg==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "android"
-      ],
+    "node_modules/escape-string-regexp": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+      "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+      "dev": true,
+      "peer": true,
       "engines": {
-        "node": ">=18"
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.23.1.tgz",
-      "integrity": "sha512-YsS2e3Wtgnw7Wq53XXBLcV6JhRsEq8hkfg91ESVadIrzr9wO6jJDMZnCQbHm1Guc5t/CdDiFSSfWP58FNuvT3Q==",
-      "cpu": [
-        "arm64"
-      ],
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
-      "engines": {
-        "node": ">=18"
+    "node_modules/eslint": {
+      "version": "9.16.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.16.0.tgz",
+      "integrity": "sha512-whp8mSQI4C8VXd+fLgSM0lh3UlmcFtVwUQjyKCFfsp+2ItAIYhlq/hqGahGqHE6cv9unM41VlqKk2VtKYR2TaA==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "@eslint-community/eslint-utils": "^4.2.0",
+        "@eslint-community/regexpp": "^4.12.1",
+        "@eslint/config-array": "^0.19.0",
+        "@eslint/core": "^0.9.0",
+        "@eslint/eslintrc": "^3.2.0",
+        "@eslint/js": "9.16.0",
+        "@eslint/plugin-kit": "^0.2.3",
+        "@humanfs/node": "^0.16.6",
+        "@humanwhocodes/module-importer": "^1.0.1",
+        "@humanwhocodes/retry": "^0.4.1",
+        "@types/estree": "^1.0.6",
+        "@types/json-schema": "^7.0.15",
+        "ajv": "^6.12.4",
+        "chalk": "^4.0.0",
+        "cross-spawn": "^7.0.5",
+        "debug": "^4.3.2",
+        "escape-string-regexp": "^4.0.0",
+        "eslint-scope": "^8.2.0",
+        "eslint-visitor-keys": "^4.2.0",
+        "espree": "^10.3.0",
+        "esquery": "^1.5.0",
+        "esutils": "^2.0.2",
+        "fast-deep-equal": "^3.1.3",
+        "file-entry-cache": "^8.0.0",
+        "find-up": "^5.0.0",
+        "glob-parent": "^6.0.2",
+        "ignore": "^5.2.0",
+        "imurmurhash": "^0.1.4",
+        "is-glob": "^4.0.0",
+        "json-stable-stringify-without-jsonify": "^1.0.1",
+        "lodash.merge": "^4.6.2",
+        "minimatch": "^3.1.2",
+        "natural-compare": "^1.4.0",
+        "optionator": "^0.9.3"
+      },
+      "bin": {
+        "eslint": "bin/eslint.js"
+      },
+      "engines": {
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://eslint.org/donate"
+      },
+      "peerDependencies": {
+        "jiti": "*"
+      },
+      "peerDependenciesMeta": {
+        "jiti": {
+          "optional": true
+        }
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/darwin-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.23.1.tgz",
-      "integrity": "sha512-aClqdgTDVPSEGgoCS8QDG37Gu8yc9lTHNAQlsztQ6ENetKEO//b8y31MMu2ZaPbn4kVsIABzVLXYLhCGekGDqw==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
+    "node_modules/eslint-scope": {
+      "version": "8.2.0",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
+      "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "esrecurse": "^4.3.0",
+        "estraverse": "^5.2.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://opencollective.com/eslint"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.23.1.tgz",
-      "integrity": "sha512-h1k6yS8/pN/NHlMl5+v4XPfikhJulk4G+tKGFIOwURBSFzE8bixw1ebjluLOjfwtLqY0kewfjLSrO6tN2MgIhA==",
-      "cpu": [
-        "arm64"
-      ],
-      "optional": true,
-      "os": [
-        "freebsd"
-      ],
+    "node_modules/eslint-visitor-keys": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+      "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
+      "dev": true,
       "engines": {
-        "node": ">=18"
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://opencollective.com/eslint"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.23.1.tgz",
-      "integrity": "sha512-lK1eJeyk1ZX8UklqFd/3A60UuZ/6UVfGT2LuGo3Wp4/z7eRTRYY+0xOu2kpClP+vMTi9wKOfXi2vjUpO1Ro76g==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "freebsd"
-      ],
+    "node_modules/eslint/node_modules/ajv": {
+      "version": "6.12.6",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+      "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "fast-deep-equal": "^3.1.1",
+        "fast-json-stable-stringify": "^2.0.0",
+        "json-schema-traverse": "^0.4.1",
+        "uri-js": "^4.2.2"
+      },
+      "funding": {
+        "type": "github",
+        "url": "https://github.com/sponsors/epoberezkin"
+      }
+    },
+    "node_modules/eslint/node_modules/ansi-styles": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "color-convert": "^2.0.1"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-arm": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.23.1.tgz",
-      "integrity": "sha512-CXXkzgn+dXAPs3WBwE+Kvnrf4WECwBdfjfeYHpMeVxWE0EceB6vhWGShs6wi0IYEqMSIzdOF1XjQ/Mkm5d7ZdQ==",
-      "cpu": [
-        "arm"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/eslint/node_modules/chalk": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "ansi-styles": "^4.1.0",
+        "supports-color": "^7.1.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/chalk?sponsor=1"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-arm64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.23.1.tgz",
-      "integrity": "sha512-/93bf2yxencYDnItMYV/v116zff6UyTjo4EtEQjUBeGiVpMmffDNUyD9UN2zV+V3LRV3/on4xdZ26NKzn6754g==",
-      "cpu": [
-        "arm64"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/eslint/node_modules/color-convert": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "color-name": "~1.1.4"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=7.0.0"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-ia32": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.23.1.tgz",
-      "integrity": "sha512-VTN4EuOHwXEkXzX5nTvVY4s7E/Krz7COC8xkftbbKRYAl96vPiUssGkeMELQMOnLOJ8k3BY1+ZY52tttZnHcXQ==",
-      "cpu": [
-        "ia32"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/eslint/node_modules/color-name": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/eslint/node_modules/debug": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "ms": "^2.1.3"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=6.0"
+      },
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-loong64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.23.1.tgz",
-      "integrity": "sha512-Vx09LzEoBa5zDnieH8LSMRToj7ir/Jeq0Gu6qJ/1GcBq9GkfoEAoXvLiW1U9J1qE/Y/Oyaq33w5p2ZWrNNHNEw==",
-      "cpu": [
-        "loong64"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/eslint/node_modules/json-schema-traverse": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+      "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/eslint/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/espree": {
+      "version": "10.3.0",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
+      "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "acorn": "^8.14.0",
+        "acorn-jsx": "^5.3.2",
+        "eslint-visitor-keys": "^4.2.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+      },
+      "funding": {
+        "url": "https://opencollective.com/eslint"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.23.1.tgz",
-      "integrity": "sha512-nrFzzMQ7W4WRLNUOU5dlWAqa6yVeI0P78WKGUo7lg2HShq/yx+UYkeNSE0SSfSure0SqgnsxPvmAUu/vu0E+3Q==",
-      "cpu": [
-        "mips64el"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/esquery": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz",
+      "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "estraverse": "^5.1.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=0.10"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.23.1.tgz",
-      "integrity": "sha512-dKN8fgVqd0vUIjxuJI6P/9SSSe/mB9rvA98CSH2sJnlZ/OCZWO1DJvxj8jvKTfYUdGfcq2dDxoKaC6bHuTlgcw==",
-      "cpu": [
-        "ppc64"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/esrecurse": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+      "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "estraverse": "^5.2.0"
+      },
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/estraverse": {
+      "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+      "dev": true,
+      "peer": true,
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/estree-walker": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
+      "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
+      "dev": true,
+      "dependencies": {
+        "@types/estree": "^1.0.0"
+      }
+    },
+    "node_modules/esutils": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+      "dev": true,
+      "peer": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/etag": {
+      "version": "1.8.1",
+      "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+      "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/events": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
+      "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
+      "dev": true,
       "engines": {
-        "node": ">=18"
+        "node": ">=0.8.x"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.23.1.tgz",
-      "integrity": "sha512-5AV4Pzp80fhHL83JM6LoA6pTQVWgB1HovMBsLQ9OZWLDqVY8MVobBXNSmAJi//Csh6tcY7e7Lny2Hg1tElMjIA==",
-      "cpu": [
-        "riscv64"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/expect-type": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz",
+      "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==",
+      "dev": true,
       "engines": {
-        "node": ">=18"
+        "node": ">=12.0.0"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-s390x": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.23.1.tgz",
-      "integrity": "sha512-9ygs73tuFCe6f6m/Tb+9LtYxWR4c9yg7zjt2cYkjDbDpV/xVn+68cQxMXCjUpYwEkze2RcU/rMnfIXNRFmSoDw==",
-      "cpu": [
-        "s390x"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/express": {
+      "version": "4.21.2",
+      "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz",
+      "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
+      "dev": true,
+      "dependencies": {
+        "accepts": "~1.3.8",
+        "array-flatten": "1.1.1",
+        "body-parser": "1.20.3",
+        "content-disposition": "0.5.4",
+        "content-type": "~1.0.4",
+        "cookie": "0.7.1",
+        "cookie-signature": "1.0.6",
+        "debug": "2.6.9",
+        "depd": "2.0.0",
+        "encodeurl": "~2.0.0",
+        "escape-html": "~1.0.3",
+        "etag": "~1.8.1",
+        "finalhandler": "1.3.1",
+        "fresh": "0.5.2",
+        "http-errors": "2.0.0",
+        "merge-descriptors": "1.0.3",
+        "methods": "~1.1.2",
+        "on-finished": "2.4.1",
+        "parseurl": "~1.3.3",
+        "path-to-regexp": "0.1.12",
+        "proxy-addr": "~2.0.7",
+        "qs": "6.13.0",
+        "range-parser": "~1.2.1",
+        "safe-buffer": "5.2.1",
+        "send": "0.19.0",
+        "serve-static": "1.16.2",
+        "setprototypeof": "1.2.0",
+        "statuses": "2.0.1",
+        "type-is": "~1.6.18",
+        "utils-merge": "1.0.1",
+        "vary": "~1.1.2"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">= 0.10.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/express"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/linux-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.23.1.tgz",
-      "integrity": "sha512-EV6+ovTsEXCPAp58g2dD68LxoP/wK5pRvgy0J/HxPGB009omFPv3Yet0HiaqvrIrgPTBuC6wCH1LTOY91EO5hQ==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "linux"
-      ],
+    "node_modules/express-promise-router": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/express-promise-router/-/express-promise-router-4.1.1.tgz",
+      "integrity": "sha512-Lkvcy/ZGrBhzkl3y7uYBHLMtLI4D6XQ2kiFg9dq7fbktBch5gjqJ0+KovX0cvCAvTJw92raWunRLM/OM+5l4fA==",
+      "dev": true,
+      "dependencies": {
+        "is-promise": "^4.0.0",
+        "lodash.flattendeep": "^4.0.0",
+        "methods": "^1.0.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=10"
+      },
+      "peerDependencies": {
+        "@types/express": "^4.0.0",
+        "express": "^4.0.0"
+      },
+      "peerDependenciesMeta": {
+        "@types/express": {
+          "optional": true
+        }
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.23.1.tgz",
-      "integrity": "sha512-aevEkCNu7KlPRpYLjwmdcuNz6bDFiE7Z8XC4CPqExjTvrHugh28QzUXVOZtiYghciKUacNktqxdpymplil1beA==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "netbsd"
-      ],
+    "node_modules/fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+      "dev": true
+    },
+    "node_modules/fast-glob": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
+      "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
+      "dev": true,
+      "dependencies": {
+        "@nodelib/fs.stat": "^2.0.2",
+        "@nodelib/fs.walk": "^1.2.3",
+        "glob-parent": "^5.1.2",
+        "merge2": "^1.3.0",
+        "micromatch": "^4.0.4"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=8.6.0"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.23.1.tgz",
-      "integrity": "sha512-aY2gMmKmPhxfU+0EdnN+XNtGbjfQgwZj43k8G3fyrDM/UdZww6xrWxmDkuz2eCZchqVeABjV5BpildOrUbBTqA==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "openbsd"
-      ],
+    "node_modules/fast-glob/node_modules/glob-parent": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+      "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+      "dev": true,
+      "dependencies": {
+        "is-glob": "^4.0.1"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">= 6"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/sunos-x64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.23.1.tgz",
-      "integrity": "sha512-RBRT2gqEl0IKQABT4XTj78tpk9v7ehp+mazn2HbUeZl1YMdaGAQqhapjGTCe7uw7y0frDi4gS0uHzhvpFuI1sA==",
-      "cpu": [
-        "x64"
-      ],
-      "optional": true,
-      "os": [
-        "sunos"
+    "node_modules/fast-json-stable-stringify": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/fast-levenshtein": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+      "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/fast-uri": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz",
+      "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==",
+      "dev": true
+    },
+    "node_modules/fast-xml-parser": {
+      "version": "4.5.0",
+      "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz",
+      "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/NaturalIntelligence"
+        },
+        {
+          "type": "paypal",
+          "url": "https://paypal.me/naturalintelligence"
+        }
       ],
-      "engines": {
-        "node": ">=18"
+      "dependencies": {
+        "strnum": "^1.0.5"
+      },
+      "bin": {
+        "fxparser": "src/cli/cli.js"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/win32-arm64": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.23.1.tgz",
-      "integrity": "sha512-4O+gPR5rEBe2FpKOVyiJ7wNDPA8nGzDuJ6gN4okSA1gEOYZ67N8JPk58tkWtdtPeLz7lBnY6I5L3jdsr3S+A6A==",
-      "cpu": [
-        "arm64"
-      ],
-      "optional": true,
-      "os": [
-        "win32"
+    "node_modules/fastq": {
+      "version": "1.17.1",
+      "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
+      "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
+      "dev": true,
+      "dependencies": {
+        "reusify": "^1.0.4"
+      }
+    },
+    "node_modules/fecha": {
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
+      "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==",
+      "dev": true
+    },
+    "node_modules/fetch-blob": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
+      "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/jimmywarting"
+        },
+        {
+          "type": "paypal",
+          "url": "https://paypal.me/jimmywarting"
+        }
       ],
+      "dependencies": {
+        "node-domexception": "^1.0.0",
+        "web-streams-polyfill": "^3.0.3"
+      },
       "engines": {
-        "node": ">=18"
+        "node": "^12.20 || >= 14.13"
       }
     },
-    "node_modules/esbuild/node_modules/@esbuild/win32-ia32": {
-      "version": "0.23.1",
-      "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.23.1.tgz",
-      "integrity": "sha512-BcaL0Vn6QwCwre3Y717nVHZbAa4UBEigzFm6VdsVdT/MbZ38xoj1X9HPkZhbmaBGUD1W8vxAfffbDe8bA6AKnQ==",
-      "cpu": [
-        "ia32"
-      ],
-      "optional": true,
-      "os": [
-        "win32"
-      ],
+    "node_modules/file-entry-cache": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
+      "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+      "dev": true,
+      "peer": true,
+      "dependencies": {
+        "flat-cache": "^4.0.0"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">=16.0.0"
       }
     },
-    "node_modules/escalade": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
-      "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+    "node_modules/fill-range": {
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
       "dev": true,
+      "dependencies": {
+        "to-regex-range": "^5.0.1"
+      },
       "engines": {
-        "node": ">=6"
+        "node": ">=8"
       }
     },
-    "node_modules/escape-html": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
-      "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
-      "dev": true
+    "node_modules/finalhandler": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
+      "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
+      "dev": true,
+      "dependencies": {
+        "debug": "2.6.9",
+        "encodeurl": "~2.0.0",
+        "escape-html": "~1.0.3",
+        "on-finished": "2.4.1",
+        "parseurl": "~1.3.3",
+        "statuses": "2.0.1",
+        "unpipe": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
     },
-    "node_modules/escape-string-regexp": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
-      "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+    "node_modules/find-up": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+      "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
       "dev": true,
-      "peer": true,
+      "dependencies": {
+        "locate-path": "^6.0.0",
+        "path-exists": "^4.0.0"
+      },
       "engines": {
         "node": ">=10"
       },
@@ -3490,209 +3632,221 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/eslint": {
-      "version": "9.14.0",
-      "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz",
-      "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==",
+    "node_modules/flat-cache": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
+      "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
       "dev": true,
       "peer": true,
       "dependencies": {
-        "@eslint-community/eslint-utils": "^4.2.0",
-        "@eslint-community/regexpp": "^4.12.1",
-        "@eslint/config-array": "^0.18.0",
-        "@eslint/core": "^0.7.0",
-        "@eslint/eslintrc": "^3.1.0",
-        "@eslint/js": "9.14.0",
-        "@eslint/plugin-kit": "^0.2.0",
-        "@humanfs/node": "^0.16.6",
-        "@humanwhocodes/module-importer": "^1.0.1",
-        "@humanwhocodes/retry": "^0.4.0",
-        "@types/estree": "^1.0.6",
-        "@types/json-schema": "^7.0.15",
-        "ajv": "^6.12.4",
-        "chalk": "^4.0.0",
-        "cross-spawn": "^7.0.2",
-        "debug": "^4.3.2",
-        "escape-string-regexp": "^4.0.0",
-        "eslint-scope": "^8.2.0",
-        "eslint-visitor-keys": "^4.2.0",
-        "espree": "^10.3.0",
-        "esquery": "^1.5.0",
-        "esutils": "^2.0.2",
-        "fast-deep-equal": "^3.1.3",
-        "file-entry-cache": "^8.0.0",
-        "find-up": "^5.0.0",
-        "glob-parent": "^6.0.2",
-        "ignore": "^5.2.0",
-        "imurmurhash": "^0.1.4",
-        "is-glob": "^4.0.0",
-        "json-stable-stringify-without-jsonify": "^1.0.1",
-        "lodash.merge": "^4.6.2",
-        "minimatch": "^3.1.2",
-        "natural-compare": "^1.4.0",
-        "optionator": "^0.9.3",
-        "text-table": "^0.2.0"
-      },
-      "bin": {
-        "eslint": "bin/eslint.js"
+        "flatted": "^3.2.9",
+        "keyv": "^4.5.4"
       },
       "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://eslint.org/donate"
-      },
-      "peerDependencies": {
-        "jiti": "*"
+        "node": ">=16"
+      }
+    },
+    "node_modules/flatted": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz",
+      "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/fn.name": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
+      "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==",
+      "dev": true
+    },
+    "node_modules/follow-redirects": {
+      "version": "1.15.9",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
+      "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "individual",
+          "url": "https://github.com/sponsors/RubenVerborgh"
+        }
+      ],
+      "engines": {
+        "node": ">=4.0"
       },
       "peerDependenciesMeta": {
-        "jiti": {
+        "debug": {
           "optional": true
         }
       }
     },
-    "node_modules/eslint-scope": {
-      "version": "8.2.0",
-      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
-      "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
+    "node_modules/for-each": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
+      "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "esrecurse": "^4.3.0",
-        "estraverse": "^5.2.0"
-      },
-      "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/eslint"
+        "is-callable": "^1.1.3"
       }
     },
-    "node_modules/eslint-visitor-keys": {
-      "version": "3.4.3",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
-      "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
+    "node_modules/foreground-child": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
+      "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
       "dev": true,
+      "dependencies": {
+        "cross-spawn": "^7.0.0",
+        "signal-exit": "^4.0.1"
+      },
       "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+        "node": ">=14"
       },
       "funding": {
-        "url": "https://opencollective.com/eslint"
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/eslint/node_modules/ajv": {
-      "version": "6.12.6",
-      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
-      "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+    "node_modules/form-data": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.2.tgz",
+      "integrity": "sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "fast-deep-equal": "^3.1.1",
-        "fast-json-stable-stringify": "^2.0.0",
-        "json-schema-traverse": "^0.4.1",
-        "uri-js": "^4.2.2"
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.8",
+        "mime-types": "^2.1.12"
       },
-      "funding": {
-        "type": "github",
-        "url": "https://github.com/sponsors/epoberezkin"
+      "engines": {
+        "node": ">= 6"
       }
     },
-    "node_modules/eslint/node_modules/ansi-styles": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
-      "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+    "node_modules/formdata-polyfill": {
+      "version": "4.0.10",
+      "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
+      "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "color-convert": "^2.0.1"
+        "fetch-blob": "^3.1.2"
       },
       "engines": {
-        "node": ">=8"
-      },
+        "node": ">=12.20.0"
+      }
+    },
+    "node_modules/forwarded": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+      "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/fresh": {
+      "version": "0.5.2",
+      "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
+      "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/fsevents": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+      "hasInstallScript": true,
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "engines": {
+        "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+      }
+    },
+    "node_modules/function-bind": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+      "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+      "dev": true,
       "funding": {
-        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/eslint/node_modules/brace-expansion": {
-      "version": "1.1.11",
-      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
-      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+    "node_modules/functions-have-names": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+      "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
       "dev": true,
-      "peer": true,
-      "dependencies": {
-        "balanced-match": "^1.0.0",
-        "concat-map": "0.0.1"
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+      "dev": true,
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
       }
     },
-    "node_modules/eslint/node_modules/chalk": {
-      "version": "4.1.2",
-      "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
-      "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+    "node_modules/get-intrinsic": {
+      "version": "1.2.6",
+      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.6.tgz",
+      "integrity": "sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "ansi-styles": "^4.1.0",
-        "supports-color": "^7.1.0"
+        "call-bind-apply-helpers": "^1.0.1",
+        "dunder-proto": "^1.0.0",
+        "es-define-property": "^1.0.1",
+        "es-errors": "^1.3.0",
+        "es-object-atoms": "^1.0.0",
+        "function-bind": "^1.1.2",
+        "gopd": "^1.2.0",
+        "has-symbols": "^1.1.0",
+        "hasown": "^2.0.2",
+        "math-intrinsics": "^1.0.0"
       },
       "engines": {
-        "node": ">=10"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/chalk/chalk?sponsor=1"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/eslint/node_modules/color-convert": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
-      "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
-      "dev": true,
-      "peer": true,
+    "node_modules/get-tsconfig": {
+      "version": "4.8.1",
+      "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz",
+      "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==",
       "dependencies": {
-        "color-name": "~1.1.4"
+        "resolve-pkg-maps": "^1.0.0"
       },
-      "engines": {
-        "node": ">=7.0.0"
+      "funding": {
+        "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
       }
     },
-    "node_modules/eslint/node_modules/color-name": {
-      "version": "1.1.4",
-      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
-      "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/eslint/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+    "node_modules/glob": {
+      "version": "11.0.0",
+      "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz",
+      "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "ms": "^2.1.3"
+        "foreground-child": "^3.1.0",
+        "jackspeak": "^4.0.1",
+        "minimatch": "^10.0.0",
+        "minipass": "^7.1.2",
+        "package-json-from-dist": "^1.0.0",
+        "path-scurry": "^2.0.0"
       },
-      "engines": {
-        "node": ">=6.0"
+      "bin": {
+        "glob": "dist/esm/bin.mjs"
       },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
-      }
-    },
-    "node_modules/eslint/node_modules/eslint-visitor-keys": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
-      "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
-      "dev": true,
-      "peer": true,
       "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+        "node": "20 || >=22"
       },
       "funding": {
-        "url": "https://opencollective.com/eslint"
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/eslint/node_modules/glob-parent": {
+    "node_modules/glob-parent": {
       "version": "6.0.2",
       "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
       "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
@@ -3705,548 +3859,409 @@
         "node": ">=10.13.0"
       }
     },
-    "node_modules/eslint/node_modules/json-schema-traverse": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
-      "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/eslint/node_modules/minimatch": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
-      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+    "node_modules/glob/node_modules/brace-expansion": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+      "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "brace-expansion": "^1.1.7"
-      },
-      "engines": {
-        "node": "*"
+        "balanced-match": "^1.0.0"
       }
     },
-    "node_modules/eslint/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/espree": {
-      "version": "10.3.0",
-      "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
-      "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
+    "node_modules/glob/node_modules/minimatch": {
+      "version": "10.0.1",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
+      "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "acorn": "^8.14.0",
-        "acorn-jsx": "^5.3.2",
-        "eslint-visitor-keys": "^4.2.0"
+        "brace-expansion": "^2.0.1"
       },
       "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+        "node": "20 || >=22"
       },
       "funding": {
-        "url": "https://opencollective.com/eslint"
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/espree/node_modules/eslint-visitor-keys": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
-      "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
+    "node_modules/globals": {
+      "version": "14.0.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
+      "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
       "dev": true,
       "peer": true,
       "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+        "node": ">=18"
       },
       "funding": {
-        "url": "https://opencollective.com/eslint"
-      }
-    },
-    "node_modules/esquery": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz",
-      "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==",
-      "dev": true,
-      "peer": true,
-      "dependencies": {
-        "estraverse": "^5.1.0"
-      },
-      "engines": {
-        "node": ">=0.10"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/esrecurse": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
-      "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+    "node_modules/globby": {
+      "version": "14.0.2",
+      "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz",
+      "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "estraverse": "^5.2.0"
+        "@sindresorhus/merge-streams": "^2.1.0",
+        "fast-glob": "^3.3.2",
+        "ignore": "^5.2.4",
+        "path-type": "^5.0.0",
+        "slash": "^5.1.0",
+        "unicorn-magic": "^0.1.0"
       },
       "engines": {
-        "node": ">=4.0"
-      }
-    },
-    "node_modules/estraverse": {
-      "version": "5.3.0",
-      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
-      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
-      "dev": true,
-      "peer": true,
-      "engines": {
-        "node": ">=4.0"
-      }
-    },
-    "node_modules/estree-walker": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz",
-      "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==",
-      "dev": true,
-      "dependencies": {
-        "@types/estree": "^1.0.0"
-      }
-    },
-    "node_modules/esutils": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
-      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
-      "dev": true,
-      "peer": true,
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
-    "node_modules/etag": {
-      "version": "1.8.1",
-      "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
-      "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.6"
-      }
-    },
-    "node_modules/event-target-shim": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
-      "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/events": {
-      "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
-      "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
-      "dev": true,
-      "engines": {
-        "node": ">=0.8.x"
-      }
-    },
-    "node_modules/expect-type": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz",
-      "integrity": "sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==",
-      "dev": true,
-      "engines": {
-        "node": ">=12.0.0"
-      }
-    },
-    "node_modules/express": {
-      "version": "4.21.1",
-      "resolved": "https://registry.npmjs.org/express/-/express-4.21.1.tgz",
-      "integrity": "sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ==",
-      "dev": true,
-      "dependencies": {
-        "accepts": "~1.3.8",
-        "array-flatten": "1.1.1",
-        "body-parser": "1.20.3",
-        "content-disposition": "0.5.4",
-        "content-type": "~1.0.4",
-        "cookie": "0.7.1",
-        "cookie-signature": "1.0.6",
-        "debug": "2.6.9",
-        "depd": "2.0.0",
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "etag": "~1.8.1",
-        "finalhandler": "1.3.1",
-        "fresh": "0.5.2",
-        "http-errors": "2.0.0",
-        "merge-descriptors": "1.0.3",
-        "methods": "~1.1.2",
-        "on-finished": "2.4.1",
-        "parseurl": "~1.3.3",
-        "path-to-regexp": "0.1.10",
-        "proxy-addr": "~2.0.7",
-        "qs": "6.13.0",
-        "range-parser": "~1.2.1",
-        "safe-buffer": "5.2.1",
-        "send": "0.19.0",
-        "serve-static": "1.16.2",
-        "setprototypeof": "1.2.0",
-        "statuses": "2.0.1",
-        "type-is": "~1.6.18",
-        "utils-merge": "1.0.1",
-        "vary": "~1.1.2"
+        "node": ">=18"
       },
-      "engines": {
-        "node": ">= 0.10.0"
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/express-promise-router": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/express-promise-router/-/express-promise-router-4.1.1.tgz",
-      "integrity": "sha512-Lkvcy/ZGrBhzkl3y7uYBHLMtLI4D6XQ2kiFg9dq7fbktBch5gjqJ0+KovX0cvCAvTJw92raWunRLM/OM+5l4fA==",
+    "node_modules/gopd": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+      "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
       "dev": true,
-      "dependencies": {
-        "is-promise": "^4.0.0",
-        "lodash.flattendeep": "^4.0.0",
-        "methods": "^1.0.0"
-      },
       "engines": {
-        "node": ">=10"
-      },
-      "peerDependencies": {
-        "@types/express": "^4.0.0",
-        "express": "^4.0.0"
+        "node": ">= 0.4"
       },
-      "peerDependenciesMeta": {
-        "@types/express": {
-          "optional": true
-        }
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/fast-deep-equal": {
-      "version": "3.1.3",
-      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
-      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+    "node_modules/graphemer": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
+      "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
       "dev": true
     },
-    "node_modules/fast-glob": {
-      "version": "3.3.2",
-      "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz",
-      "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==",
+    "node_modules/has-bigints": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
+      "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
       "dev": true,
-      "dependencies": {
-        "@nodelib/fs.stat": "^2.0.2",
-        "@nodelib/fs.walk": "^1.2.3",
-        "glob-parent": "^5.1.2",
-        "merge2": "^1.3.0",
-        "micromatch": "^4.0.4"
-      },
-      "engines": {
-        "node": ">=8.6.0"
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/fast-json-stable-stringify": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
-      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/fast-levenshtein": {
-      "version": "2.0.6",
-      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
-      "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+    "node_modules/has-flag": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
       "dev": true,
-      "peer": true
-    },
-    "node_modules/fast-uri": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz",
-      "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==",
-      "dev": true
+      "engines": {
+        "node": ">=8"
+      }
     },
-    "node_modules/fast-xml-parser": {
-      "version": "4.5.0",
-      "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz",
-      "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==",
+    "node_modules/has-property-descriptors": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
+      "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
       "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/NaturalIntelligence"
-        },
-        {
-          "type": "paypal",
-          "url": "https://paypal.me/naturalintelligence"
-        }
-      ],
       "dependencies": {
-        "strnum": "^1.0.5"
+        "es-define-property": "^1.0.0"
       },
-      "bin": {
-        "fxparser": "src/cli/cli.js"
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/fastq": {
-      "version": "1.17.1",
-      "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz",
-      "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==",
+    "node_modules/has-symbols": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+      "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
       "dev": true,
-      "dependencies": {
-        "reusify": "^1.0.4"
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/fecha": {
-      "version": "4.2.3",
-      "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz",
-      "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==",
-      "dev": true
-    },
-    "node_modules/fetch-blob": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
-      "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+    "node_modules/has-tostringtag": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
+      "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
       "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/jimmywarting"
-        },
-        {
-          "type": "paypal",
-          "url": "https://paypal.me/jimmywarting"
-        }
-      ],
       "dependencies": {
-        "node-domexception": "^1.0.0",
-        "web-streams-polyfill": "^3.0.3"
+        "has-symbols": "^1.0.3"
       },
       "engines": {
-        "node": "^12.20 || >= 14.13"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/file-entry-cache": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
-      "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
+    "node_modules/hasown": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
+      "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "flat-cache": "^4.0.0"
+        "function-bind": "^1.1.2"
       },
       "engines": {
-        "node": ">=16.0.0"
+        "node": ">= 0.4"
       }
     },
-    "node_modules/fill-range": {
-      "version": "7.1.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
-      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
+    "node_modules/html-escaper": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
+      "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
+      "dev": true
+    },
+    "node_modules/http-errors": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
+      "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
       "dev": true,
       "dependencies": {
-        "to-regex-range": "^5.0.1"
+        "depd": "2.0.0",
+        "inherits": "2.0.4",
+        "setprototypeof": "1.2.0",
+        "statuses": "2.0.1",
+        "toidentifier": "1.0.1"
       },
       "engines": {
-        "node": ">=8"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/finalhandler": {
-      "version": "1.3.1",
-      "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",
-      "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
+    "node_modules/http-proxy-agent": {
+      "version": "7.0.2",
+      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
       "dev": true,
       "dependencies": {
-        "debug": "2.6.9",
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "on-finished": "2.4.1",
-        "parseurl": "~1.3.3",
-        "statuses": "2.0.1",
-        "unpipe": "~1.0.0"
+        "agent-base": "^7.1.0",
+        "debug": "^4.3.4"
       },
       "engines": {
-        "node": ">= 0.8"
+        "node": ">= 14"
       }
     },
-    "node_modules/find-up": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
-      "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+    "node_modules/http-proxy-agent/node_modules/debug": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
-        "locate-path": "^6.0.0",
-        "path-exists": "^4.0.0"
+        "ms": "^2.1.3"
       },
       "engines": {
-        "node": ">=10"
+        "node": ">=6.0"
       },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
       }
     },
-    "node_modules/flat-cache": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
-      "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
+    "node_modules/http-proxy-agent/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true
+    },
+    "node_modules/https-proxy-agent": {
+      "version": "7.0.6",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+      "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "flatted": "^3.2.9",
-        "keyv": "^4.5.4"
+        "agent-base": "^7.1.2",
+        "debug": "4"
       },
       "engines": {
-        "node": ">=16"
+        "node": ">= 14"
       }
     },
-    "node_modules/flatted": {
-      "version": "3.3.1",
-      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz",
-      "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/fn.name": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz",
-      "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==",
-      "dev": true
-    },
-    "node_modules/follow-redirects": {
-      "version": "1.15.9",
-      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz",
-      "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
+    "node_modules/https-proxy-agent/node_modules/debug": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
-      "funding": [
-        {
-          "type": "individual",
-          "url": "https://github.com/sponsors/RubenVerborgh"
-        }
-      ],
+      "dependencies": {
+        "ms": "^2.1.3"
+      },
       "engines": {
-        "node": ">=4.0"
+        "node": ">=6.0"
       },
       "peerDependenciesMeta": {
-        "debug": {
+        "supports-color": {
           "optional": true
         }
       }
     },
-    "node_modules/for-each": {
-      "version": "0.3.3",
-      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
-      "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
+    "node_modules/https-proxy-agent/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.4.24",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+      "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
       "dev": true,
       "dependencies": {
-        "is-callable": "^1.1.3"
+        "safer-buffer": ">= 2.1.2 < 3"
+      },
+      "engines": {
+        "node": ">=0.10.0"
       }
     },
-    "node_modules/foreground-child": {
+    "node_modules/ignore": {
+      "version": "5.3.2",
+      "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
+      "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+      "dev": true,
+      "engines": {
+        "node": ">= 4"
+      }
+    },
+    "node_modules/import-fresh": {
       "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz",
-      "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==",
+      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+      "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "cross-spawn": "^7.0.0",
-        "signal-exit": "^4.0.1"
+        "parent-module": "^1.0.0",
+        "resolve-from": "^4.0.0"
       },
       "engines": {
-        "node": ">=14"
+        "node": ">=6"
       },
       "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/form-data": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.2.tgz",
-      "integrity": "sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ==",
+    "node_modules/imurmurhash": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+      "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
       "dev": true,
-      "dependencies": {
-        "asynckit": "^0.4.0",
-        "combined-stream": "^1.0.8",
-        "mime-types": "^2.1.12"
-      },
+      "peer": true,
       "engines": {
-        "node": ">= 6"
+        "node": ">=0.8.19"
       }
     },
-    "node_modules/formdata-polyfill": {
-      "version": "4.0.10",
-      "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
-      "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
+    "node_modules/inherits": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+      "dev": true
+    },
+    "node_modules/internal-slot": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz",
+      "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==",
       "dev": true,
       "dependencies": {
-        "fetch-blob": "^3.1.2"
+        "es-errors": "^1.3.0",
+        "hasown": "^2.0.0",
+        "side-channel": "^1.0.4"
       },
       "engines": {
-        "node": ">=12.20.0"
+        "node": ">= 0.4"
       }
     },
-    "node_modules/forwarded": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
-      "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+    "node_modules/ipaddr.js": {
+      "version": "1.9.1",
+      "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+      "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
       "dev": true,
       "engines": {
-        "node": ">= 0.6"
+        "node": ">= 0.10"
       }
     },
-    "node_modules/fresh": {
-      "version": "0.5.2",
-      "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
-      "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+    "node_modules/is-arguments": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
+      "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
       "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
+      },
       "engines": {
-        "node": ">= 0.6"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/fsevents": {
-      "version": "2.3.3",
-      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
-      "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
-      "hasInstallScript": true,
-      "optional": true,
-      "os": [
-        "darwin"
-      ],
+    "node_modules/is-array-buffer": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz",
+      "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.2.1"
+      },
       "engines": {
-        "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/function-bind": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
-      "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+    "node_modules/is-arrayish": {
+      "version": "0.3.2",
+      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
+      "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
+      "dev": true
+    },
+    "node_modules/is-bigint": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz",
+      "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==",
       "dev": true,
+      "dependencies": {
+        "has-bigints": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/functions-have-names": {
-      "version": "1.2.3",
-      "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
-      "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+    "node_modules/is-boolean-object": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.0.tgz",
+      "integrity": "sha512-kR5g0+dXf/+kXnqI+lu0URKYPKgICtHGGNCDSB10AaUFj3o/HkB3u7WfpRBJGFopxxY0oH3ux7ZsDjLtK7xqvw==",
       "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "has-tostringtag": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/get-caller-file": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
-      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+    "node_modules/is-callable": {
+      "version": "1.2.7",
+      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
+      "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
       "dev": true,
       "engines": {
-        "node": "6.* || 8.* || >= 10.*"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/get-intrinsic": {
-      "version": "1.2.4",
-      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz",
-      "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==",
+    "node_modules/is-date-object": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+      "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
       "dev": true,
       "dependencies": {
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2",
-        "has-proto": "^1.0.1",
-        "has-symbols": "^1.0.3",
-        "hasown": "^2.0.0"
+        "has-tostringtag": "^1.0.0"
       },
       "engines": {
         "node": ">= 0.4"
@@ -4255,138 +4270,177 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/get-tsconfig": {
-      "version": "4.8.1",
-      "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.8.1.tgz",
-      "integrity": "sha512-k9PN+cFBmaLWtVz29SkUoqU5O0slLuHJXt/2P+tMVFT+phsSGXGkp9t3rQIqdz0e+06EHNGs3oM6ZX1s2zHxRg==",
-      "dependencies": {
-        "resolve-pkg-maps": "^1.0.0"
+    "node_modules/is-docker": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
+      "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
+      "dev": true,
+      "bin": {
+        "is-docker": "cli.js"
+      },
+      "engines": {
+        "node": ">=8"
       },
       "funding": {
-        "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/glob": {
-      "version": "11.0.0",
-      "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz",
-      "integrity": "sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==",
+    "node_modules/is-extglob": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+      "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-fullwidth-code-point": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+      "dev": true,
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/is-glob": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
       "dev": true,
       "dependencies": {
-        "foreground-child": "^3.1.0",
-        "jackspeak": "^4.0.1",
-        "minimatch": "^10.0.0",
-        "minipass": "^7.1.2",
-        "package-json-from-dist": "^1.0.0",
-        "path-scurry": "^2.0.0"
-      },
-      "bin": {
-        "glob": "dist/esm/bin.mjs"
+        "is-extglob": "^2.1.1"
       },
       "engines": {
-        "node": "20 || >=22"
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-map": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz",
+      "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "url": "https://github.com/sponsors/ljharb"
       }
-    },
-    "node_modules/glob-parent": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
-      "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+    },
+    "node_modules/is-number": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+      "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
       "dev": true,
-      "dependencies": {
-        "is-glob": "^4.0.1"
-      },
       "engines": {
-        "node": ">= 6"
+        "node": ">=0.12.0"
       }
     },
-    "node_modules/globals": {
-      "version": "14.0.0",
-      "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz",
-      "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==",
+    "node_modules/is-number-object": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.0.tgz",
+      "integrity": "sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==",
       "dev": true,
-      "peer": true,
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "has-tostringtag": "^1.0.2"
+      },
       "engines": {
-        "node": ">=18"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/globby": {
-      "version": "14.0.2",
-      "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz",
-      "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==",
+    "node_modules/is-promise": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+      "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+      "dev": true
+    },
+    "node_modules/is-regex": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz",
+      "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==",
       "dev": true,
       "dependencies": {
-        "@sindresorhus/merge-streams": "^2.1.0",
-        "fast-glob": "^3.3.2",
-        "ignore": "^5.2.4",
-        "path-type": "^5.0.0",
-        "slash": "^5.1.0",
-        "unicorn-magic": "^0.1.0"
+        "call-bound": "^1.0.2",
+        "gopd": "^1.2.0",
+        "has-tostringtag": "^1.0.2",
+        "hasown": "^2.0.2"
       },
       "engines": {
-        "node": ">=18"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/gopd": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
-      "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+    "node_modules/is-set": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz",
+      "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==",
       "dev": true,
-      "dependencies": {
-        "get-intrinsic": "^1.1.3"
+      "engines": {
+        "node": ">= 0.4"
       },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/graphemer": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
-      "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",
-      "dev": true
-    },
-    "node_modules/has-bigints": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
-      "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
+    "node_modules/is-shared-array-buffer": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz",
+      "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==",
       "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.7"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/has-flag": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
-      "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+    "node_modules/is-stream": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+      "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
       "dev": true,
       "engines": {
         "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/has-property-descriptors": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz",
-      "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==",
+    "node_modules/is-string": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.0.tgz",
+      "integrity": "sha512-PlfzajuF9vSo5wErv3MJAKD/nqf9ngAs1NFQYm16nUYFO2IzxJ2hcm+IOCg+EEopdykNNUhVq5cz35cAUxU8+g==",
       "dev": true,
       "dependencies": {
-        "es-define-property": "^1.0.0"
+        "call-bind": "^1.0.7",
+        "has-tostringtag": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
       },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/has-proto": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz",
-      "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==",
+    "node_modules/is-symbol": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.0.tgz",
+      "integrity": "sha512-qS8KkNNXUZ/I+nX6QT8ZS1/Yx0A444yhzdTKxCzKkNjQ9sHErBxJnJAgh+f5YhusYECEcjo4XcyH87hn6+ks0A==",
       "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.7",
+        "has-symbols": "^1.0.3",
+        "safe-regex-test": "^1.0.3"
+      },
       "engines": {
         "node": ">= 0.4"
       },
@@ -4394,10 +4448,10 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/has-symbols": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
-      "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+    "node_modules/is-weakmap": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz",
+      "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==",
       "dev": true,
       "engines": {
         "node": ">= 0.4"
@@ -4406,13 +4460,14 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/has-tostringtag": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
-      "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
+    "node_modules/is-weakset": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz",
+      "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==",
       "dev": true,
       "dependencies": {
-        "has-symbols": "^1.0.3"
+        "call-bind": "^1.0.7",
+        "get-intrinsic": "^1.2.4"
       },
       "engines": {
         "node": ">= 0.4"
@@ -4421,947 +4476,840 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/hasown": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
-      "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+    "node_modules/is-wsl": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
+      "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
       "dev": true,
       "dependencies": {
-        "function-bind": "^1.1.2"
+        "is-docker": "^2.0.0"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=8"
       }
     },
-    "node_modules/html-escaper": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
-      "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
+    "node_modules/isarray": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+      "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
       "dev": true
     },
-    "node_modules/http-errors": {
+    "node_modules/isexe": {
       "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
-      "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+      "dev": true
+    },
+    "node_modules/istanbul-lib-coverage": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
+      "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
+      "dev": true,
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/istanbul-lib-report": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
+      "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
       "dev": true,
       "dependencies": {
-        "depd": "2.0.0",
-        "inherits": "2.0.4",
-        "setprototypeof": "1.2.0",
-        "statuses": "2.0.1",
-        "toidentifier": "1.0.1"
+        "istanbul-lib-coverage": "^3.0.0",
+        "make-dir": "^4.0.0",
+        "supports-color": "^7.1.0"
       },
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=10"
       }
     },
-    "node_modules/http-proxy-agent": {
-      "version": "7.0.2",
-      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
-      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
+    "node_modules/istanbul-reports": {
+      "version": "3.1.7",
+      "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz",
+      "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==",
       "dev": true,
       "dependencies": {
-        "agent-base": "^7.1.0",
-        "debug": "^4.3.4"
+        "html-escaper": "^2.0.0",
+        "istanbul-lib-report": "^3.0.0"
       },
       "engines": {
-        "node": ">= 14"
+        "node": ">=8"
       }
     },
-    "node_modules/http-proxy-agent/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+    "node_modules/jackspeak": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz",
+      "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==",
       "dev": true,
       "dependencies": {
-        "ms": "^2.1.3"
+        "@isaacs/cliui": "^8.0.2"
+      },
+      "engines": {
+        "node": "20 || >=22"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
+      },
+      "optionalDependencies": {
+        "@pkgjs/parseargs": "^0.11.0"
+      }
+    },
+    "node_modules/js-tokens": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+      "dev": true
+    },
+    "node_modules/js-yaml": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+      "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+      "dependencies": {
+        "argparse": "^2.0.1"
+      },
+      "bin": {
+        "js-yaml": "bin/js-yaml.js"
+      }
+    },
+    "node_modules/json-buffer": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
+      "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/json-schema-traverse": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+      "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+      "dev": true
+    },
+    "node_modules/json-stable-stringify-without-jsonify": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+      "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+      "dev": true,
+      "peer": true
+    },
+    "node_modules/jsonwebtoken": {
+      "version": "9.0.2",
+      "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz",
+      "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==",
+      "dev": true,
+      "dependencies": {
+        "jws": "^3.2.2",
+        "lodash.includes": "^4.3.0",
+        "lodash.isboolean": "^3.0.3",
+        "lodash.isinteger": "^4.0.4",
+        "lodash.isnumber": "^3.0.3",
+        "lodash.isplainobject": "^4.0.6",
+        "lodash.isstring": "^4.0.1",
+        "lodash.once": "^4.0.0",
+        "ms": "^2.1.1",
+        "semver": "^7.5.4"
       },
       "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
+        "node": ">=12",
+        "npm": ">=6"
       }
     },
-    "node_modules/http-proxy-agent/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "dev": true
-    },
-    "node_modules/https-proxy-agent": {
-      "version": "7.0.5",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
-      "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
+    "node_modules/jsonwebtoken/node_modules/jwa": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
+      "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
       "dev": true,
       "dependencies": {
-        "agent-base": "^7.0.2",
-        "debug": "4"
-      },
-      "engines": {
-        "node": ">= 14"
+        "buffer-equal-constant-time": "1.0.1",
+        "ecdsa-sig-formatter": "1.0.11",
+        "safe-buffer": "^5.0.1"
       }
     },
-    "node_modules/https-proxy-agent/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+    "node_modules/jsonwebtoken/node_modules/jws": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
+      "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
       "dev": true,
       "dependencies": {
-        "ms": "^2.1.3"
-      },
-      "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
+        "jwa": "^1.4.1",
+        "safe-buffer": "^5.0.1"
       }
     },
-    "node_modules/https-proxy-agent/node_modules/ms": {
+    "node_modules/jsonwebtoken/node_modules/ms": {
       "version": "2.1.3",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
       "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
       "dev": true
     },
-    "node_modules/iconv-lite": {
-      "version": "0.4.24",
-      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
-      "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+    "node_modules/jwa": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
+      "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
       "dev": true,
       "dependencies": {
-        "safer-buffer": ">= 2.1.2 < 3"
-      },
-      "engines": {
-        "node": ">=0.10.0"
+        "buffer-equal-constant-time": "1.0.1",
+        "ecdsa-sig-formatter": "1.0.11",
+        "safe-buffer": "^5.0.1"
       }
     },
-    "node_modules/ieee754": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
-      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ]
-    },
-    "node_modules/ignore": {
-      "version": "5.3.2",
-      "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
-      "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
+    "node_modules/jws": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
+      "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
       "dev": true,
-      "engines": {
-        "node": ">= 4"
+      "dependencies": {
+        "jwa": "^2.0.0",
+        "safe-buffer": "^5.0.1"
       }
     },
-    "node_modules/import-fresh": {
-      "version": "3.3.0",
-      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
-      "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+    "node_modules/keyv": {
+      "version": "4.5.4",
+      "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
+      "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
       "dev": true,
       "peer": true,
       "dependencies": {
-        "parent-module": "^1.0.0",
-        "resolve-from": "^4.0.0"
-      },
-      "engines": {
-        "node": ">=6"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "json-buffer": "3.0.1"
       }
     },
-    "node_modules/imurmurhash": {
-      "version": "0.1.4",
-      "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
-      "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+    "node_modules/kleur": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+      "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
       "dev": true,
-      "peer": true,
       "engines": {
-        "node": ">=0.8.19"
+        "node": ">=6"
       }
     },
-    "node_modules/inherits": {
-      "version": "2.0.4",
-      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
-      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+    "node_modules/kuler": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
+      "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==",
       "dev": true
     },
-    "node_modules/internal-slot": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz",
-      "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==",
-      "dev": true,
-      "dependencies": {
-        "es-errors": "^1.3.0",
-        "hasown": "^2.0.0",
-        "side-channel": "^1.0.4"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      }
-    },
-    "node_modules/ipaddr.js": {
-      "version": "1.9.1",
-      "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
-      "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.10"
-      }
-    },
-    "node_modules/is-arguments": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
-      "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
+    "node_modules/levn": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
+      "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "call-bind": "^1.0.2",
-        "has-tostringtag": "^1.0.0"
+        "prelude-ls": "^1.2.1",
+        "type-check": "~0.4.0"
       },
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/is-array-buffer": {
-      "version": "3.0.4",
-      "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz",
-      "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==",
+    "node_modules/locate-path": {
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+      "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
       "dev": true,
       "dependencies": {
-        "call-bind": "^1.0.2",
-        "get-intrinsic": "^1.2.1"
+        "p-locate": "^5.0.0"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=10"
       },
       "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/is-arrayish": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
-      "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==",
+    "node_modules/lodash.flattendeep": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
+      "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==",
       "dev": true
     },
-    "node_modules/is-bigint": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
-      "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
-      "dev": true,
-      "dependencies": {
-        "has-bigints": "^1.0.1"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
+    "node_modules/lodash.includes": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
+      "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==",
+      "dev": true
     },
-    "node_modules/is-boolean-object": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
-      "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
-      "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.2",
-        "has-tostringtag": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
+    "node_modules/lodash.isboolean": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
+      "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==",
+      "dev": true
     },
-    "node_modules/is-callable": {
-      "version": "1.2.7",
-      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
-      "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
+    "node_modules/lodash.isinteger": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
+      "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==",
+      "dev": true
     },
-    "node_modules/is-date-object": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
-      "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
-      "dev": true,
-      "dependencies": {
-        "has-tostringtag": "^1.0.0"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
+    "node_modules/lodash.isnumber": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
+      "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==",
+      "dev": true
     },
-    "node_modules/is-docker": {
-      "version": "2.2.1",
-      "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
-      "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
-      "dev": true,
-      "bin": {
-        "is-docker": "cli.js"
-      },
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
+    "node_modules/lodash.isplainobject": {
+      "version": "4.0.6",
+      "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
+      "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
+      "dev": true
     },
-    "node_modules/is-extglob": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
-      "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
-      "dev": true,
-      "engines": {
-        "node": ">=0.10.0"
-      }
+    "node_modules/lodash.isstring": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
+      "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==",
+      "dev": true
     },
-    "node_modules/is-fullwidth-code-point": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
-      "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+    "node_modules/lodash.merge": {
+      "version": "4.6.2",
+      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
+      "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
       "dev": true,
-      "engines": {
-        "node": ">=8"
-      }
+      "peer": true
     },
-    "node_modules/is-glob": {
-      "version": "4.0.3",
-      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
-      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+    "node_modules/lodash.once": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
+      "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
+      "dev": true
+    },
+    "node_modules/logform": {
+      "version": "2.7.0",
+      "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz",
+      "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==",
       "dev": true,
       "dependencies": {
-        "is-extglob": "^2.1.1"
+        "@colors/colors": "1.6.0",
+        "@types/triple-beam": "^1.3.2",
+        "fecha": "^4.2.0",
+        "ms": "^2.1.1",
+        "safe-stable-stringify": "^2.3.1",
+        "triple-beam": "^1.3.0"
       },
       "engines": {
-        "node": ">=0.10.0"
+        "node": ">= 12.0.0"
       }
     },
-    "node_modules/is-map": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz",
-      "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==",
+    "node_modules/logform/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true
+    },
+    "node_modules/loupe": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz",
+      "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==",
+      "dev": true
+    },
+    "node_modules/lru-cache": {
+      "version": "11.0.2",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz",
+      "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==",
       "dev": true,
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": "20 || >=22"
       }
     },
-    "node_modules/is-number": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
-      "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+    "node_modules/magic-string": {
+      "version": "0.30.15",
+      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.15.tgz",
+      "integrity": "sha512-zXeaYRgZ6ldS1RJJUrMrYgNJ4fdwnyI6tVqoiIhyCyv5IVTK9BU8Ic2l253GGETQHxI4HNUwhJ3fjDhKqEoaAw==",
       "dev": true,
-      "engines": {
-        "node": ">=0.12.0"
+      "dependencies": {
+        "@jridgewell/sourcemap-codec": "^1.5.0"
       }
     },
-    "node_modules/is-number-object": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz",
-      "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==",
+    "node_modules/make-dir": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
+      "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
       "dev": true,
       "dependencies": {
-        "has-tostringtag": "^1.0.0"
+        "semver": "^7.5.3"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=10"
       },
       "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/is-promise": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
-      "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
-      "dev": true
-    },
-    "node_modules/is-regex": {
-      "version": "1.1.4",
-      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
-      "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
+    "node_modules/math-intrinsics": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.0.0.tgz",
+      "integrity": "sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA==",
       "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.2",
-        "has-tostringtag": "^1.0.0"
-      },
       "engines": {
         "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/is-set": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz",
-      "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==",
+    "node_modules/media-typer": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
+      "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
       "dev": true,
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/is-shared-array-buffer": {
+    "node_modules/merge-descriptors": {
       "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz",
-      "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==",
+      "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+      "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
       "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.7"
-      },
-      "engines": {
-        "node": ">= 0.4"
-      },
       "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/is-stream": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
-      "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
+    "node_modules/merge2": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
+      "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
       "dev": true,
       "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "node": ">= 8"
       }
     },
-    "node_modules/is-string": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
-      "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+    "node_modules/methods": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+      "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
       "dev": true,
-      "dependencies": {
-        "has-tostringtag": "^1.0.0"
-      },
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/is-symbol": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
-      "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
+    "node_modules/micromatch": {
+      "version": "4.0.8",
+      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+      "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
       "dev": true,
       "dependencies": {
-        "has-symbols": "^1.0.2"
+        "braces": "^3.0.3",
+        "picomatch": "^2.3.1"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=8.6"
+      }
+    },
+    "node_modules/mime": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+      "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+      "dev": true,
+      "bin": {
+        "mime": "cli.js"
       },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+      "engines": {
+        "node": ">=4"
       }
     },
-    "node_modules/is-weakmap": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz",
-      "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==",
+    "node_modules/mime-db": {
+      "version": "1.52.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
       "dev": true,
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/is-weakset": {
-      "version": "2.0.3",
-      "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz",
-      "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==",
+    "node_modules/mime-types": {
+      "version": "2.1.35",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
       "dev": true,
       "dependencies": {
-        "call-bind": "^1.0.7",
-        "get-intrinsic": "^1.2.4"
+        "mime-db": "1.52.0"
       },
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/is-wsl": {
-      "version": "2.2.0",
-      "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
-      "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
+    "node_modules/minimatch": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "is-docker": "^2.0.0"
+        "brace-expansion": "^1.1.7"
       },
       "engines": {
-        "node": ">=8"
+        "node": "*"
       }
     },
-    "node_modules/isarray": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
-      "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
-      "dev": true
-    },
-    "node_modules/isexe": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
-      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
-      "dev": true
-    },
-    "node_modules/istanbul-lib-coverage": {
-      "version": "3.2.2",
-      "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz",
-      "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==",
+    "node_modules/minimist": {
+      "version": "1.2.8",
+      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+      "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
       "dev": true,
-      "engines": {
-        "node": ">=8"
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/istanbul-lib-report": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
-      "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
+    "node_modules/minipass": {
+      "version": "7.1.2",
+      "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
+      "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
       "dev": true,
-      "dependencies": {
-        "istanbul-lib-coverage": "^3.0.0",
-        "make-dir": "^4.0.0",
-        "supports-color": "^7.1.0"
-      },
       "engines": {
-        "node": ">=10"
+        "node": ">=16 || 14 >=14.17"
       }
     },
-    "node_modules/istanbul-reports": {
-      "version": "3.1.7",
-      "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz",
-      "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==",
+    "node_modules/mkdirp": {
+      "version": "0.5.6",
+      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
+      "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
       "dev": true,
       "dependencies": {
-        "html-escaper": "^2.0.0",
-        "istanbul-lib-report": "^3.0.0"
+        "minimist": "^1.2.6"
       },
-      "engines": {
-        "node": ">=8"
+      "bin": {
+        "mkdirp": "bin/cmd.js"
       }
     },
-    "node_modules/jackspeak": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz",
-      "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==",
+    "node_modules/morgan": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
+      "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==",
       "dev": true,
       "dependencies": {
-        "@isaacs/cliui": "^8.0.2"
+        "basic-auth": "~2.0.1",
+        "debug": "2.6.9",
+        "depd": "~2.0.0",
+        "on-finished": "~2.3.0",
+        "on-headers": "~1.0.2"
       },
       "engines": {
-        "node": "20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
-      },
-      "optionalDependencies": {
-        "@pkgjs/parseargs": "^0.11.0"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/js-tokens": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
-      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
-      "dev": true
-    },
-    "node_modules/js-yaml": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
-      "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+    "node_modules/morgan/node_modules/on-finished": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
+      "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
+      "dev": true,
       "dependencies": {
-        "argparse": "^2.0.1"
+        "ee-first": "1.1.1"
       },
-      "bin": {
-        "js-yaml": "bin/js-yaml.js"
+      "engines": {
+        "node": ">= 0.8"
       }
     },
-    "node_modules/json-buffer": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
-      "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/json-schema-traverse": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
-      "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+    "node_modules/ms": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+      "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
       "dev": true
     },
-    "node_modules/json-stable-stringify-without-jsonify": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
-      "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/jsonwebtoken": {
-      "version": "9.0.2",
-      "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz",
-      "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==",
+    "node_modules/multer": {
+      "version": "1.4.5-lts.1",
+      "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz",
+      "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==",
       "dev": true,
       "dependencies": {
-        "jws": "^3.2.2",
-        "lodash.includes": "^4.3.0",
-        "lodash.isboolean": "^3.0.3",
-        "lodash.isinteger": "^4.0.4",
-        "lodash.isnumber": "^3.0.3",
-        "lodash.isplainobject": "^4.0.6",
-        "lodash.isstring": "^4.0.1",
-        "lodash.once": "^4.0.0",
-        "ms": "^2.1.1",
-        "semver": "^7.5.4"
+        "append-field": "^1.0.0",
+        "busboy": "^1.0.0",
+        "concat-stream": "^1.5.2",
+        "mkdirp": "^0.5.4",
+        "object-assign": "^4.1.1",
+        "type-is": "^1.6.4",
+        "xtend": "^4.0.0"
       },
       "engines": {
-        "node": ">=12",
-        "npm": ">=6"
+        "node": ">= 6.0.0"
       }
     },
-    "node_modules/jsonwebtoken/node_modules/jwa": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz",
-      "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==",
+    "node_modules/mustache": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
+      "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
       "dev": true,
-      "dependencies": {
-        "buffer-equal-constant-time": "1.0.1",
-        "ecdsa-sig-formatter": "1.0.11",
-        "safe-buffer": "^5.0.1"
+      "bin": {
+        "mustache": "bin/mustache"
       }
     },
-    "node_modules/jsonwebtoken/node_modules/jws": {
-      "version": "3.2.2",
-      "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz",
-      "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==",
+    "node_modules/nanoid": {
+      "version": "3.3.8",
+      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
+      "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==",
       "dev": true,
-      "dependencies": {
-        "jwa": "^1.4.1",
-        "safe-buffer": "^5.0.1"
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ],
+      "bin": {
+        "nanoid": "bin/nanoid.cjs"
+      },
+      "engines": {
+        "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
       }
     },
-    "node_modules/jsonwebtoken/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+    "node_modules/natural-compare": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+      "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
       "dev": true
     },
-    "node_modules/jwa": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz",
-      "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==",
+    "node_modules/negotiator": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
+      "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
       "dev": true,
-      "dependencies": {
-        "buffer-equal-constant-time": "1.0.1",
-        "ecdsa-sig-formatter": "1.0.11",
-        "safe-buffer": "^5.0.1"
+      "engines": {
+        "node": ">= 0.6"
       }
     },
-    "node_modules/jws": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
-      "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
+    "node_modules/node-domexception": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+      "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
       "dev": true,
-      "dependencies": {
-        "jwa": "^2.0.0",
-        "safe-buffer": "^5.0.1"
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/jimmywarting"
+        },
+        {
+          "type": "github",
+          "url": "https://paypal.me/jimmywarting"
+        }
+      ],
+      "engines": {
+        "node": ">=10.5.0"
       }
     },
-    "node_modules/keyv": {
-      "version": "4.5.4",
-      "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
-      "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
+    "node_modules/node-fetch": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+      "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "json-buffer": "3.0.1"
+        "data-uri-to-buffer": "^4.0.0",
+        "fetch-blob": "^3.1.4",
+        "formdata-polyfill": "^4.0.10"
+      },
+      "engines": {
+        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/node-fetch"
       }
     },
-    "node_modules/kleur": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
-      "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+    "node_modules/object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
       "dev": true,
       "engines": {
-        "node": ">=6"
+        "node": ">=0.10.0"
       }
     },
-    "node_modules/kuler": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz",
-      "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==",
-      "dev": true
+    "node_modules/object-inspect": {
+      "version": "1.13.3",
+      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz",
+      "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
     },
-    "node_modules/levn": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
-      "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
+    "node_modules/object-is": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz",
+      "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==",
       "dev": true,
-      "peer": true,
       "dependencies": {
-        "prelude-ls": "^1.2.1",
-        "type-check": "~0.4.0"
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1"
       },
       "engines": {
-        "node": ">= 0.8.0"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/locate-path": {
-      "version": "6.0.0",
-      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
-      "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+    "node_modules/object-keys": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/object.assign": {
+      "version": "4.1.5",
+      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
+      "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==",
       "dev": true,
       "dependencies": {
-        "p-locate": "^5.0.0"
+        "call-bind": "^1.0.5",
+        "define-properties": "^1.2.1",
+        "has-symbols": "^1.0.3",
+        "object-keys": "^1.1.1"
       },
       "engines": {
-        "node": ">=10"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/lodash.flattendeep": {
-      "version": "4.4.0",
-      "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz",
-      "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==",
-      "dev": true
-    },
-    "node_modules/lodash.includes": {
-      "version": "4.3.0",
-      "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz",
-      "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==",
-      "dev": true
-    },
-    "node_modules/lodash.isboolean": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz",
-      "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==",
-      "dev": true
-    },
-    "node_modules/lodash.isinteger": {
-      "version": "4.0.4",
-      "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz",
-      "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==",
-      "dev": true
-    },
-    "node_modules/lodash.isnumber": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz",
-      "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==",
-      "dev": true
-    },
-    "node_modules/lodash.isplainobject": {
-      "version": "4.0.6",
-      "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz",
-      "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==",
-      "dev": true
-    },
-    "node_modules/lodash.isstring": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz",
-      "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==",
-      "dev": true
-    },
-    "node_modules/lodash.merge": {
-      "version": "4.6.2",
-      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
-      "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/lodash.once": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz",
-      "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==",
-      "dev": true
-    },
-    "node_modules/logform": {
-      "version": "2.6.1",
-      "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.1.tgz",
-      "integrity": "sha512-CdaO738xRapbKIMVn2m4F6KTj4j7ooJ8POVnebSgKo3KBz5axNXRAL7ZdRjIV6NOr2Uf4vjtRkxrFETOioCqSA==",
+    "node_modules/on-finished": {
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+      "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
       "dev": true,
       "dependencies": {
-        "@colors/colors": "1.6.0",
-        "@types/triple-beam": "^1.3.2",
-        "fecha": "^4.2.0",
-        "ms": "^2.1.1",
-        "safe-stable-stringify": "^2.3.1",
-        "triple-beam": "^1.3.0"
+        "ee-first": "1.1.1"
       },
       "engines": {
-        "node": ">= 12.0.0"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/logform/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "dev": true
-    },
-    "node_modules/loupe": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz",
-      "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==",
-      "dev": true
-    },
-    "node_modules/lru-cache": {
-      "version": "11.0.1",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.1.tgz",
-      "integrity": "sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==",
+    "node_modules/on-headers": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
+      "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
       "dev": true,
       "engines": {
-        "node": "20 || >=22"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/magic-string": {
-      "version": "0.30.12",
-      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz",
-      "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==",
+    "node_modules/one-time": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
+      "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
       "dev": true,
       "dependencies": {
-        "@jridgewell/sourcemap-codec": "^1.5.0"
+        "fn.name": "1.x.x"
       }
     },
-    "node_modules/make-dir": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
-      "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
+    "node_modules/open": {
+      "version": "8.4.2",
+      "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
+      "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
       "dev": true,
       "dependencies": {
-        "semver": "^7.5.3"
+        "define-lazy-prop": "^2.0.0",
+        "is-docker": "^2.1.1",
+        "is-wsl": "^2.2.0"
       },
       "engines": {
-        "node": ">=10"
+        "node": ">=12"
       },
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/media-typer": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
-      "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+    "node_modules/optionator": {
+      "version": "0.9.4",
+      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
+      "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
       "dev": true,
+      "peer": true,
+      "dependencies": {
+        "deep-is": "^0.1.3",
+        "fast-levenshtein": "^2.0.6",
+        "levn": "^0.4.1",
+        "prelude-ls": "^1.2.1",
+        "type-check": "^0.4.0",
+        "word-wrap": "^1.2.5"
+      },
       "engines": {
-        "node": ">= 0.6"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/merge-descriptors": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
-      "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+    "node_modules/p-limit": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+      "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
       "dev": true,
+      "dependencies": {
+        "yocto-queue": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=10"
+      },
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/merge2": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
-      "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
+    "node_modules/p-locate": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+      "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
       "dev": true,
+      "dependencies": {
+        "p-limit": "^3.0.2"
+      },
       "engines": {
-        "node": ">= 8"
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/methods": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
-      "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
-      "dev": true,
-      "engines": {
-        "node": ">= 0.6"
-      }
+    "node_modules/package-json-from-dist": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
+      "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
+      "dev": true
     },
-    "node_modules/micromatch": {
-      "version": "4.0.8",
-      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
-      "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
+    "node_modules/parent-module": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+      "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "braces": "^3.0.3",
-        "picomatch": "^2.3.1"
+        "callsites": "^3.0.0"
       },
       "engines": {
-        "node": ">=8.6"
+        "node": ">=6"
       }
     },
-    "node_modules/mime": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
-      "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+    "node_modules/parseurl": {
+      "version": "1.3.3",
+      "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+      "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
       "dev": true,
-      "bin": {
-        "mime": "cli.js"
-      },
       "engines": {
-        "node": ">=4"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/mime-db": {
-      "version": "1.52.0",
-      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
-      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+    "node_modules/path-exists": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
       "dev": true,
       "engines": {
-        "node": ">= 0.6"
+        "node": ">=8"
       }
-    },
-    "node_modules/mime-types": {
-      "version": "2.1.35",
-      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
-      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+    },
+    "node_modules/path-key": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
+      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
       "dev": true,
-      "dependencies": {
-        "mime-db": "1.52.0"
-      },
       "engines": {
-        "node": ">= 0.6"
+        "node": ">=8"
       }
     },
-    "node_modules/minimatch": {
-      "version": "10.0.1",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz",
-      "integrity": "sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==",
+    "node_modules/path-scurry": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
+      "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
       "dev": true,
       "dependencies": {
-        "brace-expansion": "^2.0.1"
+        "lru-cache": "^11.0.0",
+        "minipass": "^7.1.2"
       },
       "engines": {
         "node": "20 || >=22"
@@ -5370,1729 +5318,1764 @@
         "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/minimist": {
-      "version": "1.2.8",
-      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
-      "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
-      "dev": true,
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
-      }
+    "node_modules/path-to-regexp": {
+      "version": "0.1.12",
+      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
+      "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
+      "dev": true
     },
-    "node_modules/minipass": {
-      "version": "7.1.2",
-      "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
-      "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
+    "node_modules/path-type": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
+      "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
       "dev": true,
       "engines": {
-        "node": ">=16 || 14 >=14.17"
-      }
-    },
-    "node_modules/mkdirp": {
-      "version": "0.5.6",
-      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
-      "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
-      "dev": true,
-      "dependencies": {
-        "minimist": "^1.2.6"
+        "node": ">=12"
       },
-      "bin": {
-        "mkdirp": "bin/cmd.js"
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/morgan": {
-      "version": "1.10.0",
-      "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz",
-      "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==",
-      "dev": true,
-      "dependencies": {
-        "basic-auth": "~2.0.1",
-        "debug": "2.6.9",
-        "depd": "~2.0.0",
-        "on-finished": "~2.3.0",
-        "on-headers": "~1.0.2"
-      },
-      "engines": {
-        "node": ">= 0.8.0"
-      }
+    "node_modules/pathe": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
+      "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+      "dev": true
     },
-    "node_modules/morgan/node_modules/on-finished": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
-      "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==",
+    "node_modules/pathval": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz",
+      "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==",
       "dev": true,
-      "dependencies": {
-        "ee-first": "1.1.1"
-      },
       "engines": {
-        "node": ">= 0.8"
+        "node": ">= 14.16"
       }
     },
-    "node_modules/ms": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
-      "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+    "node_modules/picocolors": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
+      "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
       "dev": true
     },
-    "node_modules/multer": {
-      "version": "1.4.5-lts.1",
-      "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz",
-      "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==",
+    "node_modules/picomatch": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+      "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
       "dev": true,
-      "dependencies": {
-        "append-field": "^1.0.0",
-        "busboy": "^1.0.0",
-        "concat-stream": "^1.5.2",
-        "mkdirp": "^0.5.4",
-        "object-assign": "^4.1.1",
-        "type-is": "^1.6.4",
-        "xtend": "^4.0.0"
+      "engines": {
+        "node": ">=8.6"
       },
+      "funding": {
+        "url": "https://github.com/sponsors/jonschlinkert"
+      }
+    },
+    "node_modules/pluralize": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
+      "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",
+      "dev": true,
       "engines": {
-        "node": ">= 6.0.0"
+        "node": ">=4"
       }
     },
-    "node_modules/mustache": {
-      "version": "4.2.0",
-      "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
-      "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
+    "node_modules/possible-typed-array-names": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
+      "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==",
       "dev": true,
-      "bin": {
-        "mustache": "bin/mustache"
+      "engines": {
+        "node": ">= 0.4"
       }
     },
-    "node_modules/nanoid": {
-      "version": "3.3.7",
-      "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
-      "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+    "node_modules/postcss": {
+      "version": "8.4.49",
+      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz",
+      "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==",
       "dev": true,
       "funding": [
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/postcss/"
+        },
+        {
+          "type": "tidelift",
+          "url": "https://tidelift.com/funding/github/npm/postcss"
+        },
         {
           "type": "github",
           "url": "https://github.com/sponsors/ai"
         }
       ],
-      "bin": {
-        "nanoid": "bin/nanoid.cjs"
+      "dependencies": {
+        "nanoid": "^3.3.7",
+        "picocolors": "^1.1.1",
+        "source-map-js": "^1.2.1"
       },
       "engines": {
-        "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+        "node": "^10 || ^12 || >=14"
       }
     },
-    "node_modules/natural-compare": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
-      "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
-      "dev": true
-    },
-    "node_modules/negotiator": {
-      "version": "0.6.3",
-      "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
-      "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+    "node_modules/prelude-ls": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
+      "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
       "dev": true,
+      "peer": true,
       "engines": {
-        "node": ">= 0.6"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/node-domexception": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
-      "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+    "node_modules/prettier": {
+      "version": "3.3.3",
+      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
+      "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
       "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/jimmywarting"
-        },
-        {
-          "type": "github",
-          "url": "https://paypal.me/jimmywarting"
-        }
-      ],
+      "bin": {
+        "prettier": "bin/prettier.cjs"
+      },
       "engines": {
-        "node": ">=10.5.0"
+        "node": ">=14"
+      },
+      "funding": {
+        "url": "https://github.com/prettier/prettier?sponsor=1"
       }
     },
-    "node_modules/node-fetch": {
-      "version": "3.3.2",
-      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
-      "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
+    "node_modules/process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+      "dev": true
+    },
+    "node_modules/prompts": {
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+      "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
       "dev": true,
       "dependencies": {
-        "data-uri-to-buffer": "^4.0.0",
-        "fetch-blob": "^3.1.4",
-        "formdata-polyfill": "^4.0.10"
+        "kleur": "^3.0.3",
+        "sisteransi": "^1.0.5"
       },
       "engines": {
-        "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/node-fetch"
+        "node": ">= 6"
       }
     },
-    "node_modules/object-assign": {
-      "version": "4.1.1",
-      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+    "node_modules/proxy-addr": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+      "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
       "dev": true,
+      "dependencies": {
+        "forwarded": "0.2.0",
+        "ipaddr.js": "1.9.1"
+      },
       "engines": {
-        "node": ">=0.10.0"
+        "node": ">= 0.10"
       }
     },
-    "node_modules/object-inspect": {
-      "version": "1.13.2",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz",
-      "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==",
+    "node_modules/proxy-from-env": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
+      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
+      "dev": true
+    },
+    "node_modules/punycode": {
+      "version": "2.3.1",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
+      "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
       "dev": true,
+      "peer": true,
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">=6"
       }
     },
-    "node_modules/object-is": {
-      "version": "1.1.6",
-      "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz",
-      "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==",
+    "node_modules/qs": {
+      "version": "6.13.0",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
+      "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
       "dev": true,
       "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1"
+        "side-channel": "^1.0.6"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=0.6"
       },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/object-keys": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
-      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+    "node_modules/queue-microtask": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
+      "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
       "dev": true,
-      "engines": {
-        "node": ">= 0.4"
-      }
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
     },
-    "node_modules/object.assign": {
-      "version": "4.1.5",
-      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz",
-      "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==",
+    "node_modules/range-parser": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
+      "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
       "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.5",
-        "define-properties": "^1.2.1",
-        "has-symbols": "^1.0.3",
-        "object-keys": "^1.1.1"
-      },
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/on-finished": {
-      "version": "2.4.1",
-      "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
-      "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+    "node_modules/raw-body": {
+      "version": "2.5.2",
+      "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
+      "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
       "dev": true,
       "dependencies": {
-        "ee-first": "1.1.1"
+        "bytes": "3.1.2",
+        "http-errors": "2.0.0",
+        "iconv-lite": "0.4.24",
+        "unpipe": "1.0.0"
       },
       "engines": {
         "node": ">= 0.8"
       }
     },
-    "node_modules/on-headers": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
-      "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==",
+    "node_modules/readable-stream": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+      "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
       "dev": true,
-      "engines": {
-        "node": ">= 0.8"
+      "dependencies": {
+        "core-util-is": "~1.0.0",
+        "inherits": "~2.0.3",
+        "isarray": "~1.0.0",
+        "process-nextick-args": "~2.0.0",
+        "safe-buffer": "~5.1.1",
+        "string_decoder": "~1.1.1",
+        "util-deprecate": "~1.0.1"
       }
     },
-    "node_modules/one-time": {
+    "node_modules/readable-stream/node_modules/isarray": {
       "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz",
-      "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==",
-      "dev": true,
-      "dependencies": {
-        "fn.name": "1.x.x"
-      }
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
+      "dev": true
     },
-    "node_modules/open": {
-      "version": "8.4.2",
-      "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz",
-      "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==",
+    "node_modules/readable-stream/node_modules/safe-buffer": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+      "dev": true
+    },
+    "node_modules/regexp.prototype.flags": {
+      "version": "1.5.3",
+      "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz",
+      "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==",
       "dev": true,
       "dependencies": {
-        "define-lazy-prop": "^2.0.0",
-        "is-docker": "^2.1.1",
-        "is-wsl": "^2.2.0"
+        "call-bind": "^1.0.7",
+        "define-properties": "^1.2.1",
+        "es-errors": "^1.3.0",
+        "set-function-name": "^2.0.2"
       },
       "engines": {
-        "node": ">=12"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/optionator": {
-      "version": "0.9.4",
-      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
-      "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
+    "node_modules/require-directory": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
       "dev": true,
-      "peer": true,
-      "dependencies": {
-        "deep-is": "^0.1.3",
-        "fast-levenshtein": "^2.0.6",
-        "levn": "^0.4.1",
-        "prelude-ls": "^1.2.1",
-        "type-check": "^0.4.0",
-        "word-wrap": "^1.2.5"
-      },
       "engines": {
-        "node": ">= 0.8.0"
+        "node": ">=0.10.0"
       }
     },
-    "node_modules/p-limit": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
-      "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+    "node_modules/require-from-string": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+      "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
       "dev": true,
-      "dependencies": {
-        "yocto-queue": "^0.1.0"
-      },
       "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "node": ">=0.10.0"
       }
     },
-    "node_modules/p-locate": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
-      "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+    "node_modules/resolve-from": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+      "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
       "dev": true,
-      "dependencies": {
-        "p-limit": "^3.0.2"
-      },
+      "peer": true,
       "engines": {
-        "node": ">=10"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "node": ">=4"
       }
     },
-    "node_modules/package-json-from-dist": {
+    "node_modules/resolve-pkg-maps": {
       "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz",
-      "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==",
-      "dev": true
+      "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
+      "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
+      "funding": {
+        "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
+      }
     },
-    "node_modules/parent-module": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
-      "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+    "node_modules/reusify": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
+      "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
       "dev": true,
-      "peer": true,
-      "dependencies": {
-        "callsites": "^3.0.0"
-      },
       "engines": {
-        "node": ">=6"
+        "iojs": ">=1.0.0",
+        "node": ">=0.10.0"
       }
     },
-    "node_modules/parseurl": {
-      "version": "1.3.3",
-      "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
-      "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+    "node_modules/rimraf": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz",
+      "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==",
       "dev": true,
+      "dependencies": {
+        "glob": "^11.0.0",
+        "package-json-from-dist": "^1.0.0"
+      },
+      "bin": {
+        "rimraf": "dist/esm/bin.mjs"
+      },
       "engines": {
-        "node": ">= 0.8"
+        "node": "20 || >=22"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/path-exists": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
-      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+    "node_modules/rollup": {
+      "version": "4.28.1",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz",
+      "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==",
       "dev": true,
+      "dependencies": {
+        "@types/estree": "1.0.6"
+      },
+      "bin": {
+        "rollup": "dist/bin/rollup"
+      },
       "engines": {
-        "node": ">=8"
+        "node": ">=18.0.0",
+        "npm": ">=8.0.0"
+      },
+      "optionalDependencies": {
+        "@rollup/rollup-android-arm-eabi": "4.28.1",
+        "@rollup/rollup-android-arm64": "4.28.1",
+        "@rollup/rollup-darwin-arm64": "4.28.1",
+        "@rollup/rollup-darwin-x64": "4.28.1",
+        "@rollup/rollup-freebsd-arm64": "4.28.1",
+        "@rollup/rollup-freebsd-x64": "4.28.1",
+        "@rollup/rollup-linux-arm-gnueabihf": "4.28.1",
+        "@rollup/rollup-linux-arm-musleabihf": "4.28.1",
+        "@rollup/rollup-linux-arm64-gnu": "4.28.1",
+        "@rollup/rollup-linux-arm64-musl": "4.28.1",
+        "@rollup/rollup-linux-loongarch64-gnu": "4.28.1",
+        "@rollup/rollup-linux-powerpc64le-gnu": "4.28.1",
+        "@rollup/rollup-linux-riscv64-gnu": "4.28.1",
+        "@rollup/rollup-linux-s390x-gnu": "4.28.1",
+        "@rollup/rollup-linux-x64-gnu": "4.28.1",
+        "@rollup/rollup-linux-x64-musl": "4.28.1",
+        "@rollup/rollup-win32-arm64-msvc": "4.28.1",
+        "@rollup/rollup-win32-ia32-msvc": "4.28.1",
+        "@rollup/rollup-win32-x64-msvc": "4.28.1",
+        "fsevents": "~2.3.2"
       }
     },
-    "node_modules/path-key": {
-      "version": "3.1.1",
-      "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
-      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
+    "node_modules/run-parallel": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
+      "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
       "dev": true,
-      "engines": {
-        "node": ">=8"
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ],
+      "dependencies": {
+        "queue-microtask": "^1.2.2"
       }
     },
-    "node_modules/path-scurry": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz",
-      "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==",
+    "node_modules/safe-buffer": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
+    },
+    "node_modules/safe-regex-test": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz",
+      "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==",
       "dev": true,
       "dependencies": {
-        "lru-cache": "^11.0.0",
-        "minipass": "^7.1.2"
+        "call-bind": "^1.0.6",
+        "es-errors": "^1.3.0",
+        "is-regex": "^1.1.4"
       },
       "engines": {
-        "node": "20 || >=22"
+        "node": ">= 0.4"
       },
       "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/path-to-regexp": {
-      "version": "0.1.10",
-      "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz",
-      "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==",
-      "dev": true
-    },
-    "node_modules/path-type": {
-      "version": "5.0.0",
-      "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz",
-      "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==",
+    "node_modules/safe-stable-stringify": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
+      "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
       "dev": true,
       "engines": {
-        "node": ">=12"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "node": ">=10"
       }
     },
-    "node_modules/pathe": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz",
-      "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==",
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
       "dev": true
     },
-    "node_modules/pathval": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz",
-      "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==",
-      "dev": true,
-      "engines": {
-        "node": ">= 14.16"
-      }
-    },
-    "node_modules/picocolors": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz",
-      "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==",
+    "node_modules/sax": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
+      "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
       "dev": true
     },
-    "node_modules/picomatch": {
-      "version": "2.3.1",
-      "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
-      "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
-      "dev": true,
-      "engines": {
-        "node": ">=8.6"
+    "node_modules/semver": {
+      "version": "7.6.3",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
+      "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
+      "bin": {
+        "semver": "bin/semver.js"
       },
-      "funding": {
-        "url": "https://github.com/sponsors/jonschlinkert"
+      "engines": {
+        "node": ">=10"
       }
     },
-    "node_modules/pluralize": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz",
-      "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==",
+    "node_modules/send": {
+      "version": "0.19.0",
+      "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
+      "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
       "dev": true,
+      "dependencies": {
+        "debug": "2.6.9",
+        "depd": "2.0.0",
+        "destroy": "1.2.0",
+        "encodeurl": "~1.0.2",
+        "escape-html": "~1.0.3",
+        "etag": "~1.8.1",
+        "fresh": "0.5.2",
+        "http-errors": "2.0.0",
+        "mime": "1.6.0",
+        "ms": "2.1.3",
+        "on-finished": "2.4.1",
+        "range-parser": "~1.2.1",
+        "statuses": "2.0.1"
+      },
       "engines": {
-        "node": ">=4"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/possible-typed-array-names": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz",
-      "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==",
+    "node_modules/send/node_modules/encodeurl": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
+      "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
       "dev": true,
       "engines": {
-        "node": ">= 0.4"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/postcss": {
-      "version": "8.4.47",
-      "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz",
-      "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
+    "node_modules/send/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+      "dev": true
+    },
+    "node_modules/serve-static": {
+      "version": "1.16.2",
+      "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
+      "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
       "dev": true,
-      "funding": [
-        {
-          "type": "opencollective",
-          "url": "https://opencollective.com/postcss/"
-        },
-        {
-          "type": "tidelift",
-          "url": "https://tidelift.com/funding/github/npm/postcss"
-        },
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/ai"
-        }
-      ],
       "dependencies": {
-        "nanoid": "^3.3.7",
-        "picocolors": "^1.1.0",
-        "source-map-js": "^1.2.1"
+        "encodeurl": "~2.0.0",
+        "escape-html": "~1.0.3",
+        "parseurl": "~1.3.3",
+        "send": "0.19.0"
       },
-      "engines": {
-        "node": "^10 || ^12 || >=14"
-      }
-    },
-    "node_modules/prelude-ls": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
-      "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
-      "dev": true,
-      "peer": true,
       "engines": {
         "node": ">= 0.8.0"
       }
     },
-    "node_modules/prettier": {
-      "version": "3.3.3",
-      "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
-      "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
+    "node_modules/set-function-length": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
+      "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
       "dev": true,
-      "bin": {
-        "prettier": "bin/prettier.cjs"
+      "dependencies": {
+        "define-data-property": "^1.1.4",
+        "es-errors": "^1.3.0",
+        "function-bind": "^1.1.2",
+        "get-intrinsic": "^1.2.4",
+        "gopd": "^1.0.1",
+        "has-property-descriptors": "^1.0.2"
       },
       "engines": {
-        "node": ">=14"
-      },
-      "funding": {
-        "url": "https://github.com/prettier/prettier?sponsor=1"
+        "node": ">= 0.4"
       }
     },
-    "node_modules/process": {
-      "version": "0.11.10",
-      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
-      "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
+    "node_modules/set-function-name": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
+      "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
       "dev": true,
+      "dependencies": {
+        "define-data-property": "^1.1.4",
+        "es-errors": "^1.3.0",
+        "functions-have-names": "^1.2.3",
+        "has-property-descriptors": "^1.0.2"
+      },
       "engines": {
-        "node": ">= 0.6.0"
+        "node": ">= 0.4"
       }
     },
-    "node_modules/process-nextick-args": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
-      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+    "node_modules/setprototypeof": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+      "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
       "dev": true
     },
-    "node_modules/prompts": {
-      "version": "2.4.2",
-      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
-      "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+    "node_modules/shebang-command": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
+      "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
       "dev": true,
       "dependencies": {
-        "kleur": "^3.0.3",
-        "sisteransi": "^1.0.5"
+        "shebang-regex": "^3.0.0"
       },
       "engines": {
-        "node": ">= 6"
+        "node": ">=8"
       }
     },
-    "node_modules/proxy-addr": {
-      "version": "2.0.7",
-      "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
-      "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+    "node_modules/shebang-regex": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
+      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
       "dev": true,
-      "dependencies": {
-        "forwarded": "0.2.0",
-        "ipaddr.js": "1.9.1"
-      },
       "engines": {
-        "node": ">= 0.10"
+        "node": ">=8"
       }
     },
-    "node_modules/proxy-from-env": {
+    "node_modules/side-channel": {
       "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
-      "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
-      "dev": true
+      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
+      "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+      "dev": true,
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "object-inspect": "^1.13.3",
+        "side-channel-list": "^1.0.0",
+        "side-channel-map": "^1.0.1",
+        "side-channel-weakmap": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
     },
-    "node_modules/punycode": {
-      "version": "2.3.1",
-      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
-      "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
+    "node_modules/side-channel-list": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
+      "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
       "dev": true,
-      "peer": true,
+      "dependencies": {
+        "es-errors": "^1.3.0",
+        "object-inspect": "^1.13.3"
+      },
       "engines": {
-        "node": ">=6"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/qs": {
-      "version": "6.13.0",
-      "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz",
-      "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
+    "node_modules/side-channel-map": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+      "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
       "dev": true,
       "dependencies": {
-        "side-channel": "^1.0.6"
+        "call-bound": "^1.0.2",
+        "es-errors": "^1.3.0",
+        "get-intrinsic": "^1.2.5",
+        "object-inspect": "^1.13.3"
       },
       "engines": {
-        "node": ">=0.6"
+        "node": ">= 0.4"
       },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/queue-microtask": {
-      "version": "1.2.3",
-      "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
-      "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ]
-    },
-    "node_modules/range-parser": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
-      "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+    "node_modules/side-channel-weakmap": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+      "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
       "dev": true,
+      "dependencies": {
+        "call-bound": "^1.0.2",
+        "es-errors": "^1.3.0",
+        "get-intrinsic": "^1.2.5",
+        "object-inspect": "^1.13.3",
+        "side-channel-map": "^1.0.1"
+      },
       "engines": {
-        "node": ">= 0.6"
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
       }
     },
-    "node_modules/raw-body": {
-      "version": "2.5.2",
-      "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz",
-      "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
+    "node_modules/siginfo": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
+      "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+      "dev": true
+    },
+    "node_modules/signal-exit": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+      "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
       "dev": true,
-      "dependencies": {
-        "bytes": "3.1.2",
-        "http-errors": "2.0.0",
-        "iconv-lite": "0.4.24",
-        "unpipe": "1.0.0"
-      },
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=14"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/readable-stream": {
-      "version": "2.3.8",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
-      "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+    "node_modules/simple-swizzle": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
+      "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
       "dev": true,
       "dependencies": {
-        "core-util-is": "~1.0.0",
-        "inherits": "~2.0.3",
-        "isarray": "~1.0.0",
-        "process-nextick-args": "~2.0.0",
-        "safe-buffer": "~5.1.1",
-        "string_decoder": "~1.1.1",
-        "util-deprecate": "~1.0.1"
+        "is-arrayish": "^0.3.1"
       }
     },
-    "node_modules/readable-stream/node_modules/isarray": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
-      "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
-      "dev": true
-    },
-    "node_modules/readable-stream/node_modules/safe-buffer": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
-      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+    "node_modules/sisteransi": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+      "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
       "dev": true
     },
-    "node_modules/regexp.prototype.flags": {
-      "version": "1.5.3",
-      "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz",
-      "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==",
+    "node_modules/slash": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
+      "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
       "dev": true,
-      "dependencies": {
-        "call-bind": "^1.0.7",
-        "define-properties": "^1.2.1",
-        "es-errors": "^1.3.0",
-        "set-function-name": "^2.0.2"
-      },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=14.16"
       },
       "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/require-directory": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
-      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+    "node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
       "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
     },
-    "node_modules/require-from-string": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
-      "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+    "node_modules/source-map-js": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
+      "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
       "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
     },
-    "node_modules/resolve-from": {
-      "version": "4.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
-      "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+    "node_modules/source-map-support": {
+      "version": "0.5.21",
+      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
       "dev": true,
-      "peer": true,
-      "engines": {
-        "node": ">=4"
-      }
-    },
-    "node_modules/resolve-pkg-maps": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
-      "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
-      "funding": {
-        "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
       }
     },
-    "node_modules/reusify": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz",
-      "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==",
+    "node_modules/stack-trace": {
+      "version": "0.0.10",
+      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
+      "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
       "dev": true,
       "engines": {
-        "iojs": ">=1.0.0",
-        "node": ">=0.10.0"
+        "node": "*"
       }
     },
-    "node_modules/rimraf": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-6.0.1.tgz",
-      "integrity": "sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==",
+    "node_modules/stackback": {
+      "version": "0.0.2",
+      "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
+      "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
+      "dev": true
+    },
+    "node_modules/statuses": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
+      "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
       "dev": true,
-      "dependencies": {
-        "glob": "^11.0.0",
-        "package-json-from-dist": "^1.0.0"
-      },
-      "bin": {
-        "rimraf": "dist/esm/bin.mjs"
-      },
       "engines": {
-        "node": "20 || >=22"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/rollup": {
-      "version": "4.24.4",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.4.tgz",
-      "integrity": "sha512-vGorVWIsWfX3xbcyAS+I047kFKapHYivmkaT63Smj77XwvLSJos6M1xGqZnBPFQFBRZDOcG1QnYEIxAvTr/HjA==",
+    "node_modules/std-env": {
+      "version": "3.8.0",
+      "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz",
+      "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==",
+      "dev": true
+    },
+    "node_modules/stop-iteration-iterator": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
+      "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==",
       "dev": true,
       "dependencies": {
-        "@types/estree": "1.0.6"
-      },
-      "bin": {
-        "rollup": "dist/bin/rollup"
+        "internal-slot": "^1.0.4"
       },
       "engines": {
-        "node": ">=18.0.0",
-        "npm": ">=8.0.0"
-      },
-      "optionalDependencies": {
-        "@rollup/rollup-android-arm-eabi": "4.24.4",
-        "@rollup/rollup-android-arm64": "4.24.4",
-        "@rollup/rollup-darwin-arm64": "4.24.4",
-        "@rollup/rollup-darwin-x64": "4.24.4",
-        "@rollup/rollup-freebsd-arm64": "4.24.4",
-        "@rollup/rollup-freebsd-x64": "4.24.4",
-        "@rollup/rollup-linux-arm-gnueabihf": "4.24.4",
-        "@rollup/rollup-linux-arm-musleabihf": "4.24.4",
-        "@rollup/rollup-linux-arm64-gnu": "4.24.4",
-        "@rollup/rollup-linux-arm64-musl": "4.24.4",
-        "@rollup/rollup-linux-powerpc64le-gnu": "4.24.4",
-        "@rollup/rollup-linux-riscv64-gnu": "4.24.4",
-        "@rollup/rollup-linux-s390x-gnu": "4.24.4",
-        "@rollup/rollup-linux-x64-gnu": "4.24.4",
-        "@rollup/rollup-linux-x64-musl": "4.24.4",
-        "@rollup/rollup-win32-arm64-msvc": "4.24.4",
-        "@rollup/rollup-win32-ia32-msvc": "4.24.4",
-        "@rollup/rollup-win32-x64-msvc": "4.24.4",
-        "fsevents": "~2.3.2"
-      }
-    },
-    "node_modules/run-parallel": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
-      "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ],
-      "dependencies": {
-        "queue-microtask": "^1.2.2"
+        "node": ">= 0.4"
       }
     },
-    "node_modules/safe-buffer": {
-      "version": "5.2.1",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
-      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
-      "dev": true,
-      "funding": [
-        {
-          "type": "github",
-          "url": "https://github.com/sponsors/feross"
-        },
-        {
-          "type": "patreon",
-          "url": "https://www.patreon.com/feross"
-        },
-        {
-          "type": "consulting",
-          "url": "https://feross.org/support"
-        }
-      ]
+    "node_modules/stoppable": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
+      "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4",
+        "npm": ">=6"
+      }
     },
-    "node_modules/safe-stable-stringify": {
-      "version": "2.5.0",
-      "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz",
-      "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==",
+    "node_modules/streamsearch": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
+      "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
       "dev": true,
       "engines": {
-        "node": ">=10"
+        "node": ">=10.0.0"
       }
     },
-    "node_modules/safer-buffer": {
-      "version": "2.1.2",
-      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
-      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
-      "dev": true
+    "node_modules/string_decoder": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+      "dev": true,
+      "dependencies": {
+        "safe-buffer": "~5.1.0"
+      }
     },
-    "node_modules/sax": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz",
-      "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==",
+    "node_modules/string_decoder/node_modules/safe-buffer": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
       "dev": true
     },
-    "node_modules/semver": {
-      "version": "7.6.3",
-      "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz",
-      "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==",
-      "bin": {
-        "semver": "bin/semver.js"
+    "node_modules/string-width": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
+      "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
+      "dev": true,
+      "dependencies": {
+        "eastasianwidth": "^0.2.0",
+        "emoji-regex": "^9.2.2",
+        "strip-ansi": "^7.0.1"
       },
       "engines": {
-        "node": ">=10"
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/send": {
-      "version": "0.19.0",
-      "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",
-      "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
+    "node_modules/string-width-cjs": {
+      "name": "string-width",
+      "version": "4.2.3",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
       "dev": true,
       "dependencies": {
-        "debug": "2.6.9",
-        "depd": "2.0.0",
-        "destroy": "1.2.0",
-        "encodeurl": "~1.0.2",
-        "escape-html": "~1.0.3",
-        "etag": "~1.8.1",
-        "fresh": "0.5.2",
-        "http-errors": "2.0.0",
-        "mime": "1.6.0",
-        "ms": "2.1.3",
-        "on-finished": "2.4.1",
-        "range-parser": "~1.2.1",
-        "statuses": "2.0.1"
+        "emoji-regex": "^8.0.0",
+        "is-fullwidth-code-point": "^3.0.0",
+        "strip-ansi": "^6.0.1"
       },
       "engines": {
-        "node": ">= 0.8.0"
+        "node": ">=8"
       }
     },
-    "node_modules/send/node_modules/encodeurl": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
-      "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+    "node_modules/string-width-cjs/node_modules/ansi-regex": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
       "dev": true,
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=8"
       }
     },
-    "node_modules/send/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+    "node_modules/string-width-cjs/node_modules/emoji-regex": {
+      "version": "8.0.0",
+      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
       "dev": true
     },
-    "node_modules/serve-static": {
-      "version": "1.16.2",
-      "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz",
-      "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
+    "node_modules/string-width-cjs/node_modules/strip-ansi": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
       "dev": true,
       "dependencies": {
-        "encodeurl": "~2.0.0",
-        "escape-html": "~1.0.3",
-        "parseurl": "~1.3.3",
-        "send": "0.19.0"
+        "ansi-regex": "^5.0.1"
       },
       "engines": {
-        "node": ">= 0.8.0"
+        "node": ">=8"
       }
     },
-    "node_modules/set-function-length": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz",
-      "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==",
+    "node_modules/strip-ansi": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+      "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
       "dev": true,
       "dependencies": {
-        "define-data-property": "^1.1.4",
-        "es-errors": "^1.3.0",
-        "function-bind": "^1.1.2",
-        "get-intrinsic": "^1.2.4",
-        "gopd": "^1.0.1",
-        "has-property-descriptors": "^1.0.2"
+        "ansi-regex": "^6.0.1"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
       }
     },
-    "node_modules/set-function-name": {
-      "version": "2.0.2",
-      "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz",
-      "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
+    "node_modules/strip-ansi-cjs": {
+      "name": "strip-ansi",
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
       "dev": true,
       "dependencies": {
-        "define-data-property": "^1.1.4",
-        "es-errors": "^1.3.0",
-        "functions-have-names": "^1.2.3",
-        "has-property-descriptors": "^1.0.2"
+        "ansi-regex": "^5.0.1"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=8"
       }
     },
-    "node_modules/setprototypeof": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
-      "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
-      "dev": true
-    },
-    "node_modules/shebang-command": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
-      "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
+    "node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
       "dev": true,
-      "dependencies": {
-        "shebang-regex": "^3.0.0"
-      },
       "engines": {
         "node": ">=8"
       }
     },
-    "node_modules/shebang-regex": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
-      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
+    "node_modules/strip-json-comments": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+      "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
       "dev": true,
+      "peer": true,
       "engines": {
         "node": ">=8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/side-channel": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz",
-      "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==",
+    "node_modules/strnum": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
+      "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==",
+      "dev": true
+    },
+    "node_modules/supports-color": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
       "dev": true,
       "dependencies": {
-        "call-bind": "^1.0.7",
-        "es-errors": "^1.3.0",
-        "get-intrinsic": "^1.2.4",
-        "object-inspect": "^1.13.1"
+        "has-flag": "^4.0.0"
       },
       "engines": {
-        "node": ">= 0.4"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/ljharb"
+        "node": ">=8"
       }
     },
-    "node_modules/siginfo": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
-      "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
+    "node_modules/temporal-polyfill": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz",
+      "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==",
+      "dev": true,
+      "dependencies": {
+        "temporal-spec": "^0.2.4"
+      }
+    },
+    "node_modules/temporal-spec": {
+      "version": "0.2.4",
+      "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz",
+      "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==",
       "dev": true
     },
-    "node_modules/signal-exit": {
-      "version": "4.1.0",
-      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
-      "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+    "node_modules/test-exclude": {
+      "version": "7.0.1",
+      "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz",
+      "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==",
       "dev": true,
+      "dependencies": {
+        "@istanbuljs/schema": "^0.1.2",
+        "glob": "^10.4.1",
+        "minimatch": "^9.0.4"
+      },
       "engines": {
-        "node": ">=14"
+        "node": ">=18"
+      }
+    },
+    "node_modules/test-exclude/node_modules/brace-expansion": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+      "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+      "dev": true,
+      "dependencies": {
+        "balanced-match": "^1.0.0"
+      }
+    },
+    "node_modules/test-exclude/node_modules/glob": {
+      "version": "10.4.5",
+      "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
+      "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
+      "dev": true,
+      "dependencies": {
+        "foreground-child": "^3.1.0",
+        "jackspeak": "^3.1.2",
+        "minimatch": "^9.0.4",
+        "minipass": "^7.1.2",
+        "package-json-from-dist": "^1.0.0",
+        "path-scurry": "^1.11.1"
+      },
+      "bin": {
+        "glob": "dist/esm/bin.mjs"
       },
       "funding": {
         "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/simple-swizzle": {
-      "version": "0.2.2",
-      "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
-      "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
+    "node_modules/test-exclude/node_modules/jackspeak": {
+      "version": "3.4.3",
+      "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
+      "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
       "dev": true,
       "dependencies": {
-        "is-arrayish": "^0.3.1"
+        "@isaacs/cliui": "^8.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
+      },
+      "optionalDependencies": {
+        "@pkgjs/parseargs": "^0.11.0"
       }
     },
-    "node_modules/sisteransi": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
-      "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+    "node_modules/test-exclude/node_modules/lru-cache": {
+      "version": "10.4.3",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
+      "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
       "dev": true
     },
-    "node_modules/slash": {
-      "version": "5.1.0",
-      "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz",
-      "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==",
+    "node_modules/test-exclude/node_modules/minimatch": {
+      "version": "9.0.5",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
+      "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
       "dev": true,
+      "dependencies": {
+        "brace-expansion": "^2.0.1"
+      },
       "engines": {
-        "node": ">=14.16"
+        "node": ">=16 || 14 >=14.17"
       },
       "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/source-map": {
-      "version": "0.6.1",
-      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
-      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+    "node_modules/test-exclude/node_modules/path-scurry": {
+      "version": "1.11.1",
+      "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
+      "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
       "dev": true,
+      "dependencies": {
+        "lru-cache": "^10.2.0",
+        "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+      },
       "engines": {
-        "node": ">=0.10.0"
+        "node": ">=16 || 14 >=14.18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
       }
     },
-    "node_modules/source-map-js": {
-      "version": "1.2.1",
-      "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
-      "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
-      "dev": true,
-      "engines": {
-        "node": ">=0.10.0"
-      }
+    "node_modules/text-hex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
+      "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==",
+      "dev": true
     },
-    "node_modules/source-map-support": {
-      "version": "0.5.21",
-      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
-      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+    "node_modules/tinybench": {
+      "version": "2.9.0",
+      "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
+      "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
+      "dev": true
+    },
+    "node_modules/tinyexec": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz",
+      "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==",
+      "dev": true
+    },
+    "node_modules/tinypool": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.2.tgz",
+      "integrity": "sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==",
       "dev": true,
-      "dependencies": {
-        "buffer-from": "^1.0.0",
-        "source-map": "^0.6.0"
+      "engines": {
+        "node": "^18.0.0 || >=20.0.0"
       }
     },
-    "node_modules/stack-trace": {
-      "version": "0.0.10",
-      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
-      "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==",
+    "node_modules/tinyrainbow": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz",
+      "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==",
       "dev": true,
       "engines": {
-        "node": "*"
+        "node": ">=14.0.0"
       }
     },
-    "node_modules/stackback": {
-      "version": "0.0.2",
-      "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
-      "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==",
-      "dev": true
-    },
-    "node_modules/statuses": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
-      "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
+    "node_modules/tinyspy": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz",
+      "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==",
       "dev": true,
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=14.0.0"
       }
     },
-    "node_modules/std-env": {
-      "version": "3.7.0",
-      "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz",
-      "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==",
-      "dev": true
-    },
-    "node_modules/stop-iteration-iterator": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz",
-      "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==",
+    "node_modules/to-regex-range": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+      "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
       "dev": true,
       "dependencies": {
-        "internal-slot": "^1.0.4"
+        "is-number": "^7.0.0"
       },
       "engines": {
-        "node": ">= 0.4"
+        "node": ">=8.0"
       }
     },
-    "node_modules/stoppable": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz",
-      "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==",
+    "node_modules/toidentifier": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+      "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
       "dev": true,
       "engines": {
-        "node": ">=4",
-        "npm": ">=6"
+        "node": ">=0.6"
       }
     },
-    "node_modules/streamsearch": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
-      "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
+    "node_modules/triple-beam": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
+      "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
       "dev": true,
       "engines": {
-        "node": ">=10.0.0"
+        "node": ">= 14.0.0"
       }
     },
-    "node_modules/string_decoder": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+    "node_modules/ts-api-utils": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz",
+      "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==",
       "dev": true,
-      "dependencies": {
-        "safe-buffer": "~5.1.0"
+      "engines": {
+        "node": ">=16"
+      },
+      "peerDependencies": {
+        "typescript": ">=4.2.0"
       }
     },
-    "node_modules/string_decoder/node_modules/safe-buffer": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
-      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+    "node_modules/tslib": {
+      "version": "2.8.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
+      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
       "dev": true
     },
-    "node_modules/string-width": {
-      "version": "5.1.2",
-      "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
-      "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
-      "dev": true,
+    "node_modules/tsx": {
+      "version": "4.19.2",
+      "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz",
+      "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==",
       "dependencies": {
-        "eastasianwidth": "^0.2.0",
-        "emoji-regex": "^9.2.2",
-        "strip-ansi": "^7.0.1"
+        "esbuild": "~0.23.0",
+        "get-tsconfig": "^4.7.5"
+      },
+      "bin": {
+        "tsx": "dist/cli.mjs"
       },
       "engines": {
-        "node": ">=12"
+        "node": ">=18.0.0"
       },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+      "optionalDependencies": {
+        "fsevents": "~2.3.3"
       }
     },
-    "node_modules/string-width-cjs": {
-      "name": "string-width",
-      "version": "4.2.3",
-      "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
-      "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+    "node_modules/type-check": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
+      "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
       "dev": true,
+      "peer": true,
       "dependencies": {
-        "emoji-regex": "^8.0.0",
-        "is-fullwidth-code-point": "^3.0.0",
-        "strip-ansi": "^6.0.1"
+        "prelude-ls": "^1.2.1"
       },
       "engines": {
-        "node": ">=8"
+        "node": ">= 0.8.0"
       }
     },
-    "node_modules/string-width-cjs/node_modules/ansi-regex": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
-      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+    "node_modules/type-is": {
+      "version": "1.6.18",
+      "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
+      "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
       "dev": true,
+      "dependencies": {
+        "media-typer": "0.3.0",
+        "mime-types": "~2.1.24"
+      },
       "engines": {
-        "node": ">=8"
+        "node": ">= 0.6"
       }
     },
-    "node_modules/string-width-cjs/node_modules/emoji-regex": {
-      "version": "8.0.0",
-      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
-      "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+    "node_modules/typedarray": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+      "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
       "dev": true
     },
-    "node_modules/string-width-cjs/node_modules/strip-ansi": {
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
-      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+    "node_modules/typescript": {
+      "version": "5.6.3",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
+      "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
       "dev": true,
-      "dependencies": {
-        "ansi-regex": "^5.0.1"
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
       },
       "engines": {
-        "node": ">=8"
+        "node": ">=14.17"
       }
     },
-    "node_modules/strip-ansi": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
-      "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+    "node_modules/typescript-eslint": {
+      "version": "8.18.0",
+      "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.18.0.tgz",
+      "integrity": "sha512-Xq2rRjn6tzVpAyHr3+nmSg1/9k9aIHnJ2iZeOH7cfGOWqTkXTm3kwpQglEuLGdNrYvPF+2gtAs+/KF5rjVo+WQ==",
       "dev": true,
       "dependencies": {
-        "ansi-regex": "^6.0.1"
+        "@typescript-eslint/eslint-plugin": "8.18.0",
+        "@typescript-eslint/parser": "8.18.0",
+        "@typescript-eslint/utils": "8.18.0"
       },
       "engines": {
-        "node": ">=12"
+        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
       },
       "funding": {
-        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+        "type": "opencollective",
+        "url": "https://opencollective.com/typescript-eslint"
+      },
+      "peerDependencies": {
+        "eslint": "^8.57.0 || ^9.0.0",
+        "typescript": ">=4.8.4 <5.8.0"
       }
     },
-    "node_modules/strip-ansi-cjs": {
-      "name": "strip-ansi",
-      "version": "6.0.1",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
-      "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+    "node_modules/undici-types": {
+      "version": "6.19.8",
+      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
+      "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
+      "dev": true
+    },
+    "node_modules/unicorn-magic": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz",
+      "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==",
       "dev": true,
-      "dependencies": {
-        "ansi-regex": "^5.0.1"
-      },
       "engines": {
-        "node": ">=8"
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
       }
     },
-    "node_modules/strip-ansi-cjs/node_modules/ansi-regex": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
-      "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+    "node_modules/unpipe": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+      "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
       "dev": true,
       "engines": {
-        "node": ">=8"
+        "node": ">= 0.8"
       }
     },
-    "node_modules/strip-json-comments": {
-      "version": "3.1.1",
-      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
-      "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+    "node_modules/uri-js": {
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
       "dev": true,
       "peer": true,
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+      "dependencies": {
+        "punycode": "^2.1.0"
       }
     },
-    "node_modules/strnum": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz",
-      "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==",
+    "node_modules/util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
       "dev": true
     },
-    "node_modules/supports-color": {
-      "version": "7.2.0",
-      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
-      "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+    "node_modules/utils-merge": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
+      "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
       "dev": true,
-      "dependencies": {
-        "has-flag": "^4.0.0"
-      },
       "engines": {
-        "node": ">=8"
+        "node": ">= 0.4.0"
       }
     },
-    "node_modules/temporal-polyfill": {
-      "version": "0.2.5",
-      "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz",
-      "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==",
+    "node_modules/uuid": {
+      "version": "8.3.2",
+      "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
+      "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
       "dev": true,
-      "dependencies": {
-        "temporal-spec": "^0.2.4"
+      "bin": {
+        "uuid": "dist/bin/uuid"
       }
     },
-    "node_modules/temporal-spec": {
-      "version": "0.2.4",
-      "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz",
-      "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==",
-      "dev": true
-    },
-    "node_modules/test-exclude": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz",
-      "integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==",
+    "node_modules/v8-to-istanbul": {
+      "version": "9.3.0",
+      "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
+      "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",
       "dev": true,
       "dependencies": {
-        "@istanbuljs/schema": "^0.1.2",
-        "glob": "^10.4.1",
-        "minimatch": "^9.0.4"
+        "@jridgewell/trace-mapping": "^0.3.12",
+        "@types/istanbul-lib-coverage": "^2.0.1",
+        "convert-source-map": "^2.0.0"
       },
       "engines": {
-        "node": ">=18"
+        "node": ">=10.12.0"
       }
     },
-    "node_modules/test-exclude/node_modules/glob": {
-      "version": "10.4.5",
-      "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
-      "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
+    "node_modules/vary": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+      "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
       "dev": true,
-      "dependencies": {
-        "foreground-child": "^3.1.0",
-        "jackspeak": "^3.1.2",
-        "minimatch": "^9.0.4",
-        "minipass": "^7.1.2",
-        "package-json-from-dist": "^1.0.0",
-        "path-scurry": "^1.11.1"
-      },
-      "bin": {
-        "glob": "dist/esm/bin.mjs"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+      "engines": {
+        "node": ">= 0.8"
       }
     },
-    "node_modules/test-exclude/node_modules/jackspeak": {
-      "version": "3.4.3",
-      "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
-      "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
+    "node_modules/vite": {
+      "version": "5.4.11",
+      "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz",
+      "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==",
       "dev": true,
       "dependencies": {
-        "@isaacs/cliui": "^8.0.2"
+        "esbuild": "^0.21.3",
+        "postcss": "^8.4.43",
+        "rollup": "^4.20.0"
+      },
+      "bin": {
+        "vite": "bin/vite.js"
+      },
+      "engines": {
+        "node": "^18.0.0 || >=20.0.0"
       },
       "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "url": "https://github.com/vitejs/vite?sponsor=1"
       },
       "optionalDependencies": {
-        "@pkgjs/parseargs": "^0.11.0"
+        "fsevents": "~2.3.3"
+      },
+      "peerDependencies": {
+        "@types/node": "^18.0.0 || >=20.0.0",
+        "less": "*",
+        "lightningcss": "^1.21.0",
+        "sass": "*",
+        "sass-embedded": "*",
+        "stylus": "*",
+        "sugarss": "*",
+        "terser": "^5.4.0"
+      },
+      "peerDependenciesMeta": {
+        "@types/node": {
+          "optional": true
+        },
+        "less": {
+          "optional": true
+        },
+        "lightningcss": {
+          "optional": true
+        },
+        "sass": {
+          "optional": true
+        },
+        "sass-embedded": {
+          "optional": true
+        },
+        "stylus": {
+          "optional": true
+        },
+        "sugarss": {
+          "optional": true
+        },
+        "terser": {
+          "optional": true
+        }
       }
     },
-    "node_modules/test-exclude/node_modules/lru-cache": {
-      "version": "10.4.3",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
-      "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
-      "dev": true
-    },
-    "node_modules/test-exclude/node_modules/minimatch": {
-      "version": "9.0.5",
-      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
-      "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
+    "node_modules/vite-node": {
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.8.tgz",
+      "integrity": "sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==",
       "dev": true,
       "dependencies": {
-        "brace-expansion": "^2.0.1"
+        "cac": "^6.7.14",
+        "debug": "^4.3.7",
+        "es-module-lexer": "^1.5.4",
+        "pathe": "^1.1.2",
+        "vite": "^5.0.0"
+      },
+      "bin": {
+        "vite-node": "vite-node.mjs"
       },
       "engines": {
-        "node": ">=16 || 14 >=14.17"
+        "node": "^18.0.0 || >=20.0.0"
       },
       "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+        "url": "https://opencollective.com/vitest"
       }
     },
-    "node_modules/test-exclude/node_modules/path-scurry": {
-      "version": "1.11.1",
-      "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
-      "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
+    "node_modules/vite-node/node_modules/debug": {
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
-        "lru-cache": "^10.2.0",
-        "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
+        "ms": "^2.1.3"
       },
       "engines": {
-        "node": ">=16 || 14 >=14.18"
+        "node": ">=6.0"
       },
-      "funding": {
-        "url": "https://github.com/sponsors/isaacs"
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
       }
-    },
-    "node_modules/text-hex": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz",
-      "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==",
-      "dev": true
-    },
-    "node_modules/text-table": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
-      "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
-      "dev": true,
-      "peer": true
-    },
-    "node_modules/tinybench": {
-      "version": "2.9.0",
-      "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
-      "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==",
-      "dev": true
-    },
-    "node_modules/tinyexec": {
-      "version": "0.3.1",
-      "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.1.tgz",
-      "integrity": "sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==",
+    },
+    "node_modules/vite-node/node_modules/ms": {
+      "version": "2.1.3",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
       "dev": true
     },
-    "node_modules/tinypool": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.0.1.tgz",
-      "integrity": "sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==",
+    "node_modules/vite/node_modules/@esbuild/aix-ppc64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz",
+      "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==",
+      "cpu": [
+        "ppc64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "aix"
+      ],
       "engines": {
-        "node": "^18.0.0 || >=20.0.0"
+        "node": ">=12"
       }
     },
-    "node_modules/tinyrainbow": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz",
-      "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==",
+    "node_modules/vite/node_modules/@esbuild/android-arm": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz",
+      "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==",
+      "cpu": [
+        "arm"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "android"
+      ],
       "engines": {
-        "node": ">=14.0.0"
+        "node": ">=12"
       }
     },
-    "node_modules/tinyspy": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz",
-      "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==",
+    "node_modules/vite/node_modules/@esbuild/android-arm64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz",
+      "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "android"
+      ],
       "engines": {
-        "node": ">=14.0.0"
+        "node": ">=12"
       }
     },
-    "node_modules/to-regex-range": {
-      "version": "5.0.1",
-      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
-      "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+    "node_modules/vite/node_modules/@esbuild/android-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz",
+      "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
-      "dependencies": {
-        "is-number": "^7.0.0"
-      },
+      "optional": true,
+      "os": [
+        "android"
+      ],
       "engines": {
-        "node": ">=8.0"
+        "node": ">=12"
       }
     },
-    "node_modules/toidentifier": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
-      "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+    "node_modules/vite/node_modules/@esbuild/darwin-arm64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz",
+      "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
       "engines": {
-        "node": ">=0.6"
+        "node": ">=12"
       }
     },
-    "node_modules/triple-beam": {
-      "version": "1.4.1",
-      "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz",
-      "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==",
+    "node_modules/vite/node_modules/@esbuild/darwin-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
+      "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
       "engines": {
-        "node": ">= 14.0.0"
+        "node": ">=12"
       }
     },
-    "node_modules/ts-api-utils": {
-      "version": "1.4.0",
-      "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.0.tgz",
-      "integrity": "sha512-032cPxaEKwM+GT3vA5JXNzIaizx388rhsSW79vGRNGXfRRAdEAn2mvk36PvK5HnOchyWZ7afLEXqYCvPCrzuzQ==",
+    "node_modules/vite/node_modules/@esbuild/freebsd-arm64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz",
+      "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "freebsd"
+      ],
       "engines": {
-        "node": ">=16"
-      },
-      "peerDependencies": {
-        "typescript": ">=4.2.0"
+        "node": ">=12"
       }
     },
-    "node_modules/tslib": {
-      "version": "2.8.1",
-      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
-      "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
-      "dev": true
-    },
-    "node_modules/tsx": {
-      "version": "4.19.2",
-      "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.19.2.tgz",
-      "integrity": "sha512-pOUl6Vo2LUq/bSa8S5q7b91cgNSjctn9ugq/+Mvow99qW6x/UZYwzxy/3NmqoT66eHYfCVvFvACC58UBPFf28g==",
-      "dependencies": {
-        "esbuild": "~0.23.0",
-        "get-tsconfig": "^4.7.5"
-      },
-      "bin": {
-        "tsx": "dist/cli.mjs"
-      },
+    "node_modules/vite/node_modules/@esbuild/freebsd-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz",
+      "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==",
+      "cpu": [
+        "x64"
+      ],
+      "dev": true,
+      "optional": true,
+      "os": [
+        "freebsd"
+      ],
       "engines": {
-        "node": ">=18.0.0"
-      },
-      "optionalDependencies": {
-        "fsevents": "~2.3.3"
+        "node": ">=12"
       }
     },
-    "node_modules/type-check": {
-      "version": "0.4.0",
-      "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
-      "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
+    "node_modules/vite/node_modules/@esbuild/linux-arm": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz",
+      "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==",
+      "cpu": [
+        "arm"
+      ],
       "dev": true,
-      "peer": true,
-      "dependencies": {
-        "prelude-ls": "^1.2.1"
-      },
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">= 0.8.0"
+        "node": ">=12"
       }
     },
-    "node_modules/type-is": {
-      "version": "1.6.18",
-      "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
-      "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+    "node_modules/vite/node_modules/@esbuild/linux-arm64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz",
+      "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
-      "dependencies": {
-        "media-typer": "0.3.0",
-        "mime-types": "~2.1.24"
-      },
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">= 0.6"
+        "node": ">=12"
       }
     },
-    "node_modules/typedarray": {
-      "version": "0.0.6",
-      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
-      "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
-      "dev": true
-    },
-    "node_modules/typescript": {
-      "version": "5.6.3",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz",
-      "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==",
+    "node_modules/vite/node_modules/@esbuild/linux-ia32": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz",
+      "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==",
+      "cpu": [
+        "ia32"
+      ],
       "dev": true,
-      "bin": {
-        "tsc": "bin/tsc",
-        "tsserver": "bin/tsserver"
-      },
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">=14.17"
+        "node": ">=12"
       }
     },
-    "node_modules/typescript-eslint": {
-      "version": "8.13.0",
-      "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.13.0.tgz",
-      "integrity": "sha512-vIMpDRJrQd70au2G8w34mPps0ezFSPMEX4pXkTzUkrNbRX+36ais2ksGWN0esZL+ZMaFJEneOBHzCgSqle7DHw==",
+    "node_modules/vite/node_modules/@esbuild/linux-loong64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz",
+      "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==",
+      "cpu": [
+        "loong64"
+      ],
       "dev": true,
-      "dependencies": {
-        "@typescript-eslint/eslint-plugin": "8.13.0",
-        "@typescript-eslint/parser": "8.13.0",
-        "@typescript-eslint/utils": "8.13.0"
-      },
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
-      },
-      "funding": {
-        "type": "opencollective",
-        "url": "https://opencollective.com/typescript-eslint"
-      },
-      "peerDependenciesMeta": {
-        "typescript": {
-          "optional": true
-        }
+        "node": ">=12"
       }
     },
-    "node_modules/undici-types": {
-      "version": "6.19.8",
-      "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
-      "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
-      "dev": true
-    },
-    "node_modules/unicorn-magic": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz",
-      "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==",
+    "node_modules/vite/node_modules/@esbuild/linux-mips64el": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz",
+      "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==",
+      "cpu": [
+        "mips64el"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">=18"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
+        "node": ">=12"
       }
     },
-    "node_modules/unpipe": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
-      "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+    "node_modules/vite/node_modules/@esbuild/linux-ppc64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz",
+      "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==",
+      "cpu": [
+        "ppc64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=12"
       }
     },
-    "node_modules/uri-js": {
-      "version": "4.4.1",
-      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
-      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+    "node_modules/vite/node_modules/@esbuild/linux-riscv64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz",
+      "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==",
+      "cpu": [
+        "riscv64"
+      ],
       "dev": true,
-      "peer": true,
-      "dependencies": {
-        "punycode": "^2.1.0"
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">=12"
       }
     },
-    "node_modules/util-deprecate": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
-      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
-      "dev": true
-    },
-    "node_modules/utils-merge": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
-      "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+    "node_modules/vite/node_modules/@esbuild/linux-s390x": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz",
+      "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==",
+      "cpu": [
+        "s390x"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "linux"
+      ],
       "engines": {
-        "node": ">= 0.4.0"
+        "node": ">=12"
       }
     },
-    "node_modules/uuid": {
-      "version": "8.3.2",
-      "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
-      "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
+    "node_modules/vite/node_modules/@esbuild/linux-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz",
+      "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
-      "bin": {
-        "uuid": "dist/bin/uuid"
+      "optional": true,
+      "os": [
+        "linux"
+      ],
+      "engines": {
+        "node": ">=12"
       }
     },
-    "node_modules/v8-to-istanbul": {
-      "version": "9.3.0",
-      "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
-      "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",
+    "node_modules/vite/node_modules/@esbuild/netbsd-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz",
+      "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
-      "dependencies": {
-        "@jridgewell/trace-mapping": "^0.3.12",
-        "@types/istanbul-lib-coverage": "^2.0.1",
-        "convert-source-map": "^2.0.0"
-      },
+      "optional": true,
+      "os": [
+        "netbsd"
+      ],
       "engines": {
-        "node": ">=10.12.0"
+        "node": ">=12"
       }
     },
-    "node_modules/vary": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
-      "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+    "node_modules/vite/node_modules/@esbuild/openbsd-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz",
+      "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
+      "optional": true,
+      "os": [
+        "openbsd"
+      ],
       "engines": {
-        "node": ">= 0.8"
+        "node": ">=12"
       }
     },
-    "node_modules/vite": {
-      "version": "5.4.10",
-      "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz",
-      "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==",
+    "node_modules/vite/node_modules/@esbuild/sunos-x64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz",
+      "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==",
+      "cpu": [
+        "x64"
+      ],
       "dev": true,
-      "dependencies": {
-        "esbuild": "^0.21.3",
-        "postcss": "^8.4.43",
-        "rollup": "^4.20.0"
-      },
-      "bin": {
-        "vite": "bin/vite.js"
-      },
+      "optional": true,
+      "os": [
+        "sunos"
+      ],
       "engines": {
-        "node": "^18.0.0 || >=20.0.0"
-      },
-      "funding": {
-        "url": "https://github.com/vitejs/vite?sponsor=1"
-      },
-      "optionalDependencies": {
-        "fsevents": "~2.3.3"
-      },
-      "peerDependencies": {
-        "@types/node": "^18.0.0 || >=20.0.0",
-        "less": "*",
-        "lightningcss": "^1.21.0",
-        "sass": "*",
-        "sass-embedded": "*",
-        "stylus": "*",
-        "sugarss": "*",
-        "terser": "^5.4.0"
-      },
-      "peerDependenciesMeta": {
-        "@types/node": {
-          "optional": true
-        },
-        "less": {
-          "optional": true
-        },
-        "lightningcss": {
-          "optional": true
-        },
-        "sass": {
-          "optional": true
-        },
-        "sass-embedded": {
-          "optional": true
-        },
-        "stylus": {
-          "optional": true
-        },
-        "sugarss": {
-          "optional": true
-        },
-        "terser": {
-          "optional": true
-        }
+        "node": ">=12"
       }
     },
-    "node_modules/vite-node": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.4.tgz",
-      "integrity": "sha512-kqa9v+oi4HwkG6g8ufRnb5AeplcRw8jUF6/7/Qz1qRQOXHImG8YnLbB+LLszENwFnoBl9xIf9nVdCFzNd7GQEg==",
+    "node_modules/vite/node_modules/@esbuild/win32-arm64": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz",
+      "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==",
+      "cpu": [
+        "arm64"
+      ],
       "dev": true,
-      "dependencies": {
-        "cac": "^6.7.14",
-        "debug": "^4.3.7",
-        "pathe": "^1.1.2",
-        "vite": "^5.0.0"
-      },
-      "bin": {
-        "vite-node": "vite-node.mjs"
-      },
+      "optional": true,
+      "os": [
+        "win32"
+      ],
       "engines": {
-        "node": "^18.0.0 || >=20.0.0"
-      },
-      "funding": {
-        "url": "https://opencollective.com/vitest"
+        "node": ">=12"
       }
     },
-    "node_modules/vite-node/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+    "node_modules/vite/node_modules/@esbuild/win32-ia32": {
+      "version": "0.21.5",
+      "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz",
+      "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==",
+      "cpu": [
+        "ia32"
+      ],
       "dev": true,
-      "dependencies": {
-        "ms": "^2.1.3"
-      },
+      "optional": true,
+      "os": [
+        "win32"
+      ],
       "engines": {
-        "node": ">=6.0"
-      },
-      "peerDependenciesMeta": {
-        "supports-color": {
-          "optional": true
-        }
+        "node": ">=12"
       }
     },
-    "node_modules/vite-node/node_modules/ms": {
-      "version": "2.1.3",
-      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
-      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
-      "dev": true
-    },
     "node_modules/vite/node_modules/@esbuild/win32-x64": {
       "version": "0.21.5",
       "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz",
@@ -7148,30 +7131,30 @@
       }
     },
     "node_modules/vitest": {
-      "version": "2.1.4",
-      "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.4.tgz",
-      "integrity": "sha512-eDjxbVAJw1UJJCHr5xr/xM86Zx+YxIEXGAR+bmnEID7z9qWfoxpHw0zdobz+TQAFOLT+nEXz3+gx6nUJ7RgmlQ==",
-      "dev": true,
-      "dependencies": {
-        "@vitest/expect": "2.1.4",
-        "@vitest/mocker": "2.1.4",
-        "@vitest/pretty-format": "^2.1.4",
-        "@vitest/runner": "2.1.4",
-        "@vitest/snapshot": "2.1.4",
-        "@vitest/spy": "2.1.4",
-        "@vitest/utils": "2.1.4",
+      "version": "2.1.8",
+      "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.8.tgz",
+      "integrity": "sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==",
+      "dev": true,
+      "dependencies": {
+        "@vitest/expect": "2.1.8",
+        "@vitest/mocker": "2.1.8",
+        "@vitest/pretty-format": "^2.1.8",
+        "@vitest/runner": "2.1.8",
+        "@vitest/snapshot": "2.1.8",
+        "@vitest/spy": "2.1.8",
+        "@vitest/utils": "2.1.8",
         "chai": "^5.1.2",
         "debug": "^4.3.7",
         "expect-type": "^1.1.0",
         "magic-string": "^0.30.12",
         "pathe": "^1.1.2",
-        "std-env": "^3.7.0",
+        "std-env": "^3.8.0",
         "tinybench": "^2.9.0",
         "tinyexec": "^0.3.1",
         "tinypool": "^1.0.1",
         "tinyrainbow": "^1.2.0",
         "vite": "^5.0.0",
-        "vite-node": "2.1.4",
+        "vite-node": "2.1.8",
         "why-is-node-running": "^2.3.0"
       },
       "bin": {
@@ -7186,8 +7169,8 @@
       "peerDependencies": {
         "@edge-runtime/vm": "*",
         "@types/node": "^18.0.0 || >=20.0.0",
-        "@vitest/browser": "2.1.4",
-        "@vitest/ui": "2.1.4",
+        "@vitest/browser": "2.1.8",
+        "@vitest/ui": "2.1.8",
         "happy-dom": "*",
         "jsdom": "*"
       },
@@ -7213,9 +7196,9 @@
       }
     },
     "node_modules/vitest/node_modules/debug": {
-      "version": "4.3.7",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz",
-      "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==",
+      "version": "4.4.0",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
+      "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
       "dev": true,
       "dependencies": {
         "ms": "^2.1.3"
@@ -7303,16 +7286,19 @@
       }
     },
     "node_modules/which-boxed-primitive": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
-      "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.0.tgz",
+      "integrity": "sha512-Ei7Miu/AXe2JJ4iNF5j/UphAgRoma4trE6PtisM09bPygb3egMH3YLW/befsWb1A1AxvNSFidOFTB18XtnIIng==",
       "dev": true,
       "dependencies": {
-        "is-bigint": "^1.0.1",
-        "is-boolean-object": "^1.1.0",
-        "is-number-object": "^1.0.4",
-        "is-string": "^1.0.5",
-        "is-symbol": "^1.0.3"
+        "is-bigint": "^1.1.0",
+        "is-boolean-object": "^1.2.0",
+        "is-number-object": "^1.1.0",
+        "is-string": "^1.1.0",
+        "is-symbol": "^1.1.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
       },
       "funding": {
         "url": "https://github.com/sponsors/ljharb"
@@ -7337,9 +7323,9 @@
       }
     },
     "node_modules/which-typed-array": {
-      "version": "1.1.15",
-      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz",
-      "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==",
+      "version": "1.1.16",
+      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.16.tgz",
+      "integrity": "sha512-g+N+GAWiRj66DngFwHvISJd+ITsyphZvD1vChfVg6cEdnzy53GzB3oy0fUNlvhz7H7+MiqhYr26qxQShCpKTTQ==",
       "dev": true,
       "dependencies": {
         "available-typed-arrays": "^1.0.7",
@@ -7372,35 +7358,35 @@
       }
     },
     "node_modules/winston": {
-      "version": "3.16.0",
-      "resolved": "https://registry.npmjs.org/winston/-/winston-3.16.0.tgz",
-      "integrity": "sha512-xz7+cyGN5M+4CmmD4Npq1/4T+UZaz7HaeTlAruFUTjk79CNMq+P6H30vlE4z0qfqJ01VHYQwd7OZo03nYm/+lg==",
+      "version": "3.17.0",
+      "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz",
+      "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==",
       "dev": true,
       "dependencies": {
         "@colors/colors": "^1.6.0",
         "@dabh/diagnostics": "^2.0.2",
         "async": "^3.2.3",
         "is-stream": "^2.0.0",
-        "logform": "^2.6.0",
+        "logform": "^2.7.0",
         "one-time": "^1.0.0",
         "readable-stream": "^3.4.0",
         "safe-stable-stringify": "^2.3.1",
         "stack-trace": "0.0.x",
         "triple-beam": "^1.3.0",
-        "winston-transport": "^4.7.0"
+        "winston-transport": "^4.9.0"
       },
       "engines": {
         "node": ">= 12.0.0"
       }
     },
     "node_modules/winston-transport": {
-      "version": "4.8.0",
-      "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.8.0.tgz",
-      "integrity": "sha512-qxSTKswC6llEMZKgCQdaWgDuMJQnhuvF5f2Nk3SNXc4byfQ+voo2mX1Px9dkNOuR8p0KAjfPG29PuYUSIb+vSA==",
+      "version": "4.9.0",
+      "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz",
+      "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==",
       "dev": true,
       "dependencies": {
-        "logform": "^2.6.1",
-        "readable-stream": "^4.5.2",
+        "logform": "^2.7.0",
+        "readable-stream": "^3.6.2",
         "triple-beam": "^1.3.0"
       },
       "engines": {
@@ -7408,28 +7394,17 @@
       }
     },
     "node_modules/winston-transport/node_modules/readable-stream": {
-      "version": "4.5.2",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
-      "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+      "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
       "dev": true,
       "dependencies": {
-        "abort-controller": "^3.0.0",
-        "buffer": "^6.0.3",
-        "events": "^3.3.0",
-        "process": "^0.11.10",
-        "string_decoder": "^1.3.0"
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
       },
       "engines": {
-        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
-      }
-    },
-    "node_modules/winston-transport/node_modules/string_decoder": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
-      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
-      "dev": true,
-      "dependencies": {
-        "safe-buffer": "~5.2.0"
+        "node": ">= 6"
       }
     },
     "node_modules/winston/node_modules/readable-stream": {
diff --git a/packages/http-client-python/package.json b/packages/http-client-python/package.json
index a0aa6378bf..fe2a0768b9 100644
--- a/packages/http-client-python/package.json
+++ b/packages/http-client-python/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@typespec/http-client-python",
-  "version": "0.4.2",
+  "version": "0.4.3",
   "author": "Microsoft Corporation",
   "description": "TypeSpec emitter for Python SDKs",
   "homepage": "https://typespec.io",
@@ -51,16 +51,16 @@
     "emitter"
   ],
   "peerDependencies": {
-    "@typespec/compiler": ">=0.62.0 <1.0.0",
-    "@typespec/http": ">=0.62.0 <1.0.0",
-    "@typespec/rest": ">=0.62.0 <1.0.0",
-    "@typespec/versioning": ">=0.62.0 <1.0.0",
-    "@typespec/openapi": ">=0.62.0 <1.0.0",
-    "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
-    "@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0",
-    "@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
-    "@azure-tools/typespec-azure-rulesets": ">=0.48.0 <3.0.0",
-    "@azure-tools/typespec-client-generator-core": ">=0.48.5 <1.0.0"
+    "@typespec/compiler": ">=0.63.0 <1.0.0",
+    "@typespec/http": ">=0.63.0 <1.0.0",
+    "@typespec/rest": ">=0.63.0 <1.0.0",
+    "@typespec/versioning": ">=0.63.0 <1.0.0",
+    "@typespec/openapi": ">=0.63.0 <1.0.0",
+    "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
+    "@azure-tools/typespec-azure-resource-manager": ">=0.49.0 <1.0.0",
+    "@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
+    "@azure-tools/typespec-azure-rulesets": ">=0.49.0 <3.0.0",
+    "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0"
   },
   "dependencies": {
     "js-yaml": "~4.1.0",
@@ -68,18 +68,19 @@
     "tsx": "~4.19.1"
   },
   "devDependencies": {
-    "@typespec/compiler": "~0.62.0",
-    "@typespec/versioning": "~0.62.0",
-    "@typespec/openapi": "~0.62.0",
-    "@typespec/http": "~0.62.0",
-    "@typespec/rest": "~0.62.0",
-    "@azure-tools/typespec-autorest": "~0.48.0",
-    "@azure-tools/typespec-azure-core": "~0.48.0",
-    "@azure-tools/typespec-azure-rulesets": "~0.48.0",
-    "@azure-tools/typespec-azure-resource-manager": "~0.48.0",
-    "@azure-tools/typespec-client-generator-core": "~0.48.5",
-    "@azure-tools/cadl-ranch-specs": "~0.39.1",
-    "@azure-tools/cadl-ranch-expect": "~0.15.6",
+    "@typespec/compiler": "~0.63.0",
+    "@typespec/versioning": "~0.63.0",
+    "@typespec/openapi": "~0.63.0",
+    "@typespec/http": "~0.63.0",
+    "@typespec/rest": "~0.63.0",
+    "@azure-tools/typespec-autorest": "~0.49.0",
+    "@azure-tools/typespec-azure-core": "~0.49.0",
+    "@azure-tools/typespec-azure-rulesets": "~0.49.0",
+    "@azure-tools/typespec-azure-resource-manager": "~0.49.0",
+    "@azure-tools/typespec-client-generator-core": "~0.49.0",
+    "@azure-tools/cadl-ranch-specs": "~0.39.6",
+    "@azure-tools/cadl-ranch-expect": "~0.15.7",
+    "@azure-tools/cadl-ranch": "~0.16.2",
     "@types/js-yaml": "~4.0.5",
     "@types/node": "~22.5.4",
     "@types/semver": "7.5.8",

From b1476de1fdd0326c90a06b50b05ef1a41e7a652c Mon Sep 17 00:00:00 2001
From: Weidong Xu 
Date: Fri, 13 Dec 2024 17:08:03 +0800
Subject: [PATCH 62/71] http-client-java, migrate to http-specs (#5215)

as before, currently code is actually generated in azure mode (still
waiting for the release of Java clientcore for unbranded)

report upload is temporarily disabled `EnableCadlRanchReport: false`
will re-enable after https://github.com/Azure/autorest.java/issues/2986

test release (on test branch) is good
---
 .../http-client-java/eng/pipeline/publish.yml |    1 +
 .../eng/scripts/Test-Packages.ps1             |   17 +-
 .../http-client-generator-test/Generate.ps1   |   17 +-
 ...{CadlRanch-Tests.ps1 => Spector-Tests.ps1} |   12 +-
 .../http-client-generator-test/package.json   |    9 +-
 .../RelativeModelInOperationAsyncClient.java  |    4 +-
 .../RelativeModelInOperationClient.java       |    4 +-
 .../RelativeModelInOperationsImpl.java        |    4 +-
 .../payload/pageable/PageableAsyncClient.java |  104 +
 .../payload/pageable/PageableClient.java      |   88 +
 .../pageable/PageableClientBuilder.java       |  287 ++
 .../implementation/PageableClientImpl.java    |  427 +++
 .../pageable/implementation/package-info.java |   11 +
 .../payload/pageable/models/User.java         |    2 +-
 .../payload/pageable/models/package-info.java |   11 +
 .../azure/payload/pageable/package-info.java  |   11 +
 .../OperationTemplatesManager.java            |  275 ++
 .../fluent/LroesClient.java                   |  193 ++
 .../fluent/OperationTemplatesClient.java      |   55 +
 .../fluent/models/ExportResultInner.java      |   90 +
 .../fluent/models/OrderInner.java             |  192 ++
 .../fluent/models/package-info.java           |    9 +
 .../fluent/package-info.java                  |    9 +
 .../implementation/ExportResultImpl.java      |   32 +
 .../implementation/LroesClientImpl.java       |  761 +++++
 .../implementation/LroesImpl.java             |   93 +
 .../OperationTemplatesClientBuilder.java      |  138 +
 .../OperationTemplatesClientImpl.java         |  288 ++
 .../implementation/OrderImpl.java             |  134 +
 .../implementation/ResourceManagerUtils.java  |  195 ++
 .../implementation/package-info.java          |    9 +
 .../models/ExportRequest.java                 |  101 +
 .../models/ExportResult.java                  |   26 +
 .../operationtemplates/models/Lroes.java      |   91 +
 .../operationtemplates/models/Order.java      |  208 ++
 .../models/OrderProperties.java               |  145 +
 .../models/package-info.java                  |    9 +
 .../operationtemplates/package-info.java      |    9 +
 .../payload/pageable/PageableAsyncClient.java |   71 +-
 .../java/payload/pageable/PageableClient.java |   52 +-
 .../pageable/PageableClientBuilder.java       |    4 +-
 .../implementation/PageableClientImpl.java    |  350 +-
 .../ServerDrivenPaginationsImpl.java          |  151 +
 .../pageable/implementation/package-info.java |    2 +-
 .../java/payload/pageable/models/Pet.java     |  105 +
 .../payload/pageable/models/package-info.java |    2 +-
 .../java/payload/pageable/package-info.java   |    2 +-
 .../models/LinkResponse.java                  |  107 +
 .../models/LinkResponseLinks.java             |  137 +
 .../models/package-info.java                  |   11 +
 .../versioning/removed/models/Versions.java   |    4 +-
 ...zure-example-basic_apiview_properties.json |   14 +-
 ...e-payload-pageable_apiview_properties.json |   11 +
 .../proxy-config.json                         |    1 +
 .../reflect-config.json                       |    1 +
 .../payload-pageable_apiview_properties.json  |   14 +-
 .../azure-payload-pageable.properties         |    2 +
 .../example/basic/generated/BasicAction.java  |   42 -
 .../_specs_/azure/core/lro/rpc/RpcTests.java  |    6 +-
 .../azure/core/model/ModelClientTests.java    |    2 +-
 .../azure/core/scalar/ScalarTests.java        |    6 +-
 .../payload/pageable/PageableTests.java       |    4 +-
 .../generated/PageableClientTestBase.java     |    6 +-
 .../src/test/java/org/utils/FileUtils.java    |    4 +-
 .../tsp/subclient.tsp                         |    4 +-
 packages/http-client-java/package-lock.json   | 2838 +----------------
 packages/http-client-java/package.json        |    3 +-
 67 files changed, 4713 insertions(+), 3314 deletions(-)
 rename packages/http-client-java/generator/http-client-generator-test/{CadlRanch-Tests.ps1 => Spector-Tests.ps1} (50%)
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableAsyncClient.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClient.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClientBuilder.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/PageableClientImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/package-info.java
 rename packages/http-client-java/generator/http-client-generator-test/src/main/java/{ => azure}/payload/pageable/models/User.java (98%)
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/OperationTemplatesManager.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/OperationTemplatesClient.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/ExportResultInner.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/OrderInner.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ExportResultImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientBuilder.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OrderImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ResourceManagerUtils.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportRequest.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportResult.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/OrderProperties.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/ServerDrivenPaginationsImpl.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/Pet.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponse.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponseLinks.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/package-info.java
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-payload-pageable_apiview_properties.json
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/proxy-config.json
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/reflect-config.json
 create mode 100644 packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-payload-pageable.properties
 delete mode 100644 packages/http-client-java/generator/http-client-generator-test/src/samples/java/azure/example/basic/generated/BasicAction.java
 rename packages/http-client-java/generator/http-client-generator-test/src/test/java/{ => azure}/payload/pageable/PageableTests.java (92%)
 rename packages/http-client-java/generator/http-client-generator-test/src/test/java/{ => azure}/payload/pageable/generated/PageableClientTestBase.java (90%)

diff --git a/packages/http-client-java/eng/pipeline/publish.yml b/packages/http-client-java/eng/pipeline/publish.yml
index ef49a193bb..2a02c45d83 100644
--- a/packages/http-client-java/eng/pipeline/publish.yml
+++ b/packages/http-client-java/eng/pipeline/publish.yml
@@ -30,3 +30,4 @@ extends:
           LanguageShortName: "java"
           HasNugetPackages: false
           CadlRanchName: "@typespec/http-client-java"
+          EnableCadlRanchReport: false
diff --git a/packages/http-client-java/eng/scripts/Test-Packages.ps1 b/packages/http-client-java/eng/scripts/Test-Packages.ps1
index 157fcde780..a343502aa8 100644
--- a/packages/http-client-java/eng/scripts/Test-Packages.ps1
+++ b/packages/http-client-java/eng/scripts/Test-Packages.ps1
@@ -29,31 +29,31 @@ try {
 
         Write-Host "Updated PATH: $env:PATH"
         
-        # cadl-ranch tests (unit tests included in java/typescript package build)
+        # Run Spector tests (unit tests included in java/typescript package build)
         try {
             $generatorTestDir = Join-Path $packageRoot 'generator/http-client-generator-test'
             Push-Location $generatorTestDir
             try {
                 & ./Setup.ps1
-                & ./CadlRanch-Tests.ps1
+                & ./Spector-Tests.ps1
                 Set-Location $packageRoot
-                Write-Host 'Cadl ranch tests passed'
+                Write-Host "Spector tests passed"
             }
             finally {
                 Pop-Location
             }
         } 
         catch {
-            Write-Error "Cadl ranch tests failed:  $_"
+            Write-Error "Spector tests failed: $_"
         }
-        # copy coverage report to artifacts dir
+        # Copy coverage report to artifacts directory
         try {
             $coverageReportDir = Join-Path $packageRoot 'generator/artifacts/coverage'
             if (!(Test-Path $coverageReportDir)) {
                 New-Item -ItemType Directory -Path $coverageReportDir
 
-                $sourceFile = Join-Path $packageRoot 'generator/http-client-generator-test/cadl-ranch-coverage-java-standard.json'
-                $targetFile = Join-Path $coverageReportDir 'cadl-ranch-coverage-java-standard.json'
+                $sourceFile = Join-Path $packageRoot 'generator/http-client-generator-test/tsp-spector-coverage-java-standard.json'
+                $targetFile = Join-Path $coverageReportDir 'tsp-spector-coverage-java-standard.json'
                 Copy-Item $sourceFile -Destination $targetFile
             }
         } catch {
@@ -62,11 +62,12 @@ try {
     }
     if ($GenerationChecks) {
         Set-StrictMode -Version 1
-        # run E2E Test for TypeSpec emitter
+        # Generate code for Spector tests
         Write-Host "Generating test projects ..."
         & "$packageRoot/eng/scripts/Generate.ps1"
         Write-Host 'Code generation is completed.'
 
+        # Check difference between code in branch, and code just generated
         try {
             Write-Host 'Checking for differences in generated code...'
             & "$packageRoot/eng/scripts/Check-GitChanges.ps1"
diff --git a/packages/http-client-java/generator/http-client-generator-test/Generate.ps1 b/packages/http-client-java/generator/http-client-generator-test/Generate.ps1
index 235422fe37..89585acfdb 100644
--- a/packages/http-client-java/generator/http-client-generator-test/Generate.ps1
+++ b/packages/http-client-java/generator/http-client-generator-test/Generate.ps1
@@ -89,7 +89,7 @@ $generateScript = {
   }
 
   $tspTrace = "--trace import-resolution --trace projection --trace http-client-java"
-  $tspCommand = "npx tsp compile $tspFile $tspOptions $tspTrace"
+  $tspCommand = "npx --no-install tsp compile $tspFile $tspOptions $tspTrace"
 
   $timer = [Diagnostics.Stopwatch]::StartNew()
   $generateOutput = Invoke-Expression $tspCommand
@@ -137,28 +137,29 @@ if (Test-Path ./tsp-output) {
   Remove-Item ./tsp-output -Recurse -Force
 }
 
-# run other local tests except partial update
+# generate for other local test sources except partial update
 $job = Get-Item ./tsp/* -Filter "*.tsp" -Exclude "*partialupdate*" | ForEach-Object -Parallel $generateScript -ThrottleLimit $Parallelization -AsJob
 
 $job | Wait-Job -Timeout 600
 $job | Receive-Job
 
 # partial update test
-npx tsp compile ./tsp/partialupdate.tsp --option="@typespec/http-client-java.emitter-output-dir={project-root}/existingcode"
+npx --no-install tsp compile ./tsp/partialupdate.tsp --option="@typespec/http-client-java.emitter-output-dir={project-root}/existingcode"
 Copy-Item -Path ./existingcode/src/main/java/tsptest/partialupdate -Destination ./src/main/java/tsptest/partialupdate -Recurse -Force
 Remove-Item ./existingcode -Recurse -Force
 
-# run cadl ranch tests sources
-Copy-Item -Path node_modules/@azure-tools/cadl-ranch-specs/http -Destination ./ -Recurse -Force
+# generate for http-specs/azure-http-specs test sources
+Copy-Item -Path node_modules/@typespec/http-specs/specs -Destination ./ -Recurse -Force
+Copy-Item -Path node_modules/@azure-tools/azure-http-specs/specs -Destination ./ -Recurse -Force
 # remove xml tests, emitter has not supported xml model
-Remove-Item ./http/payload/xml -Recurse -Force
+Remove-Item ./specs/payload/xml -Recurse -Force
 
-$job = (Get-ChildItem ./http -Include "main.tsp","old.tsp" -File -Recurse) | ForEach-Object -Parallel $generateScript -ThrottleLimit $Parallelization -AsJob
+$job = (Get-ChildItem ./specs -Include "main.tsp","old.tsp" -File -Recurse) | ForEach-Object -Parallel $generateScript -ThrottleLimit $Parallelization -AsJob
 
 $job | Wait-Job -Timeout 1200
 $job | Receive-Job
 
-Remove-Item ./http -Recurse -Force
+Remove-Item ./specs -Recurse -Force
 
 Copy-Item -Path ./tsp-output/*/src -Destination ./ -Recurse -Force -Exclude @("ReadmeSamples.java", "module-info.java")
 
diff --git a/packages/http-client-java/generator/http-client-generator-test/CadlRanch-Tests.ps1 b/packages/http-client-java/generator/http-client-generator-test/Spector-Tests.ps1
similarity index 50%
rename from packages/http-client-java/generator/http-client-generator-test/CadlRanch-Tests.ps1
rename to packages/http-client-java/generator/http-client-generator-test/Spector-Tests.ps1
index 871331de0a..2fce786d8c 100644
--- a/packages/http-client-java/generator/http-client-generator-test/CadlRanch-Tests.ps1
+++ b/packages/http-client-java/generator/http-client-generator-test/Spector-Tests.ps1
@@ -3,16 +3,16 @@
 $ErrorActionPreference = 'Stop'
 Set-StrictMode -Version 3.0
 
-Write-Host "Running cadl ranch tests"
+Write-Host "Running Spector tests"
 
-Write-Host "Starting the test server"
-npm run testserver-start
+Write-Host "Starting the Spector server"
+npm run spector-start
 Write-Host "Compile and run the tests"
 mvn clean test --no-transfer-progress -T 1C
 if ($LASTEXITCODE -ne 0) {
   exit $LASTEXITCODE
 }
-Write-Host "Stopping the test server"
-npm run testserver-stop
+Write-Host "Stopping the Spector server"
+npm run spector-stop
 
-Write-Host "Finished running the cadl ranch tests"
+Write-Host "Finished running the Spector tests"
diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json
index 132966467b..65332739e6 100644
--- a/packages/http-client-java/generator/http-client-generator-test/package.json
+++ b/packages/http-client-java/generator/http-client-generator-test/package.json
@@ -7,12 +7,13 @@
     "format": "npm run -s prettier -- --write",
     "check-format": "npm run prettier -- --check",
     "prettier": "prettier --config ./.prettierrc.yaml **/*.tsp",
-    "testserver-run": "cadl-ranch serve ./node_modules/@azure-tools/cadl-ranch-specs/http --coverageFile ./cadl-ranch-coverage-java-standard.json",
-    "testserver-start": "cadl-ranch server start ./node_modules/@azure-tools/cadl-ranch-specs/http --coverageFile ./cadl-ranch-coverage-java-standard.json",
-    "testserver-stop": "cadl-ranch server stop"
+    "spector-serve": "tsp-spector serve ./node_modules/@typespec/http-specs/specs ./node_modules/@azure-tools/azure-http-specs/specs --coverageFile ./tsp-spector-coverage-java-standard.json",
+    "spector-start": "tsp-spector server start ./node_modules/@typespec/http-specs/specs ./node_modules/@azure-tools/azure-http-specs/specs --coverageFile ./tsp-spector-coverage-java-standard.json",
+    "spector-stop": "tsp-spector server stop"
   },
   "dependencies": {
-    "@azure-tools/cadl-ranch-specs": "0.39.5",
+    "@typespec/http-specs": "0.1.0-alpha.5",
+    "@azure-tools/azure-http-specs": "0.1.0-alpha.4",
     "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.4.tgz",
     "@typespec/http-client-java-tests": "file:"
   },
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationAsyncClient.java
index 605bf84b10..56b9f268c3 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationAsyncClient.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationAsyncClient.java
@@ -80,7 +80,7 @@ Mono> operationWithResponse(String name, RequestOptions req
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
@@ -147,7 +147,7 @@ Mono operation(String name) {
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationClient.java
index 23db1d465b..e7c7ef912e 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationClient.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/RelativeModelInOperationClient.java
@@ -77,7 +77,7 @@ Response operationWithResponse(String name, RequestOptions requestOp
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
@@ -141,7 +141,7 @@ OuterModel operation(String name) {
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java
index 465147f3ac..b82198ff39 100644
--- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/_specs_/azure/clientgenerator/core/access/implementation/RelativeModelInOperationsImpl.java
@@ -177,7 +177,7 @@ public Response operationWithResponse(String name, RequestOptions re
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
@@ -213,7 +213,7 @@ public Mono> discriminatorWithResponseAsync(String kind, Re
     }
 
     /**
-     * Expected query parameter: kind= "real"
+     * Expected query parameter: kind="real"
      * Expected response body:
      * ```json
      * {
diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableAsyncClient.java
new file mode 100644
index 0000000000..83a35a3319
--- /dev/null
+++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableAsyncClient.java
@@ -0,0 +1,104 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) TypeSpec Code Generator.
+
+package azure.payload.pageable;
+
+import azure.payload.pageable.implementation.PageableClientImpl;
+import azure.payload.pageable.models.User;
+import com.azure.core.annotation.Generated;
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceClient;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.ClientAuthenticationException;
+import com.azure.core.exception.HttpResponseException;
+import com.azure.core.exception.ResourceModifiedException;
+import com.azure.core.exception.ResourceNotFoundException;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
+import com.azure.core.http.rest.RequestOptions;
+import com.azure.core.util.BinaryData;
+import java.util.stream.Collectors;
+import reactor.core.publisher.Flux;
+
+/**
+ * Initializes a new instance of the asynchronous PageableClient type.
+ */
+@ServiceClient(builder = PageableClientBuilder.class, isAsync = true)
+public final class PageableAsyncClient {
+    @Generated
+    private final PageableClientImpl serviceClient;
+
+    /**
+     * Initializes an instance of PageableAsyncClient class.
+     * 
+     * @param serviceClient the service client implementation.
+     */
+    @Generated
+    PageableAsyncClient(PageableClientImpl serviceClient) {
+        this.serviceClient = serviceClient;
+    }
+
+    /**
+     * List users.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list(RequestOptions requestOptions) { + return this.serviceClient.listAsync(requestOptions); + } + + /** + * List users. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of User items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux list() { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = list(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(User.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClient.java new file mode 100644 index 0000000000..68c3882885 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.payload.pageable; + +import azure.payload.pageable.implementation.PageableClientImpl; +import azure.payload.pageable.models.User; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; + +/** + * Initializes a new instance of the synchronous PageableClient type. + */ +@ServiceClient(builder = PageableClientBuilder.class) +public final class PageableClient { + @Generated + private final PageableClientImpl serviceClient; + + /** + * Initializes an instance of PageableClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + PageableClient(PageableClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * List users. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + return this.serviceClient.list(requestOptions); + } + + /** + * List users. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of User items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + // Generated convenience method for list + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.list(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(User.class)); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClientBuilder.java new file mode 100644 index 0000000000..9be4c17710 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/PageableClientBuilder.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.payload.pageable; + +import azure.payload.pageable.implementation.PageableClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the PageableClient type. + */ +@ServiceClientBuilder(serviceClients = { PageableClient.class, PageableAsyncClient.class }) +public final class PageableClientBuilder implements HttpTrait, + ConfigurationTrait, EndpointTrait { + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final Map PROPERTIES = CoreUtils.getProperties("azure-payload-pageable.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the PageableClientBuilder. + */ + @Generated + public PageableClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public PageableClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the PageableClientBuilder. + */ + @Generated + public PageableClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of PageableClientImpl with the provided parameters. + * + * @return an instance of PageableClientImpl. + */ + @Generated + private PageableClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + String localEndpoint = (endpoint != null) ? endpoint : "http://localhost:3000"; + PageableClientImpl client + = new PageableClientImpl(localPipeline, JacksonAdapter.createDefaultSerializerAdapter(), localEndpoint); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of PageableAsyncClient class. + * + * @return an instance of PageableAsyncClient. + */ + @Generated + public PageableAsyncClient buildAsyncClient() { + return new PageableAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of PageableClient class. + * + * @return an instance of PageableClient. + */ + @Generated + public PageableClient buildClient() { + return new PageableClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(PageableClientBuilder.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/PageableClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/PageableClientImpl.java new file mode 100644 index 0000000000..70002c4a3e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/PageableClientImpl.java @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.payload.pageable.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.UrlBuilder; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the PageableClient type. + */ +public final class PageableClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final PageableClientService service; + + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of PageableClient client. + * + * @param endpoint Service host. + */ + public PageableClientImpl(String endpoint) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of PageableClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Service host. + */ + public PageableClientImpl(HttpPipeline httpPipeline, String endpoint) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint); + } + + /** + * Initializes an instance of PageableClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Service host. + */ + public PageableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.service = RestProxy.create(PageableClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for PageableClient to be used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PageableClient") + public interface PageableClientService { + @Get("/azure/payload/pageable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> list(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/azure/payload/pageable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + } + + /** + * List users. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List users. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSinglePageAsync(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listNextSinglePageAsync(nextLink, requestOptionsLocal); + }); + } + + /** + * List users. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listSync(this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List users. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>((pageSize) -> { + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listSinglePage(requestOptionsLocal); + }, (nextLink, pageSize) -> { + RequestOptions requestOptionsLocal = new RequestOptions(); + requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); + if (pageSize != null) { + requestOptionsLocal.addRequestCallback(requestLocal -> { + UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); + urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); + requestLocal.setUrl(urlBuilder.toString()); + }); + } + return listNextSinglePage(nextLink, requestOptionsLocal); + }); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of User items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/package-info.java new file mode 100644 index 0000000000..e03f730af7 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/implementation/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the implementations for Pageable. + * Test describing pageable. + * + */ +package azure.payload.pageable.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/User.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/User.java similarity index 98% rename from packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/User.java rename to packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/User.java index 920bae6b63..b21b986ab8 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/User.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/User.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package payload.pageable.models; +package azure.payload.pageable.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/package-info.java new file mode 100644 index 0000000000..ea5290238a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Pageable. + * Test describing pageable. + * + */ +package azure.payload.pageable.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/package-info.java new file mode 100644 index 0000000000..da31e5e394 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/payload/pageable/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the classes for Pageable. + * Test describing pageable. + * + */ +package azure.payload.pageable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/OperationTemplatesManager.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/OperationTemplatesManager.java new file mode 100644 index 0000000000..ac8c0311ec --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/OperationTemplatesManager.java @@ -0,0 +1,275 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates; + +import azure.resourcemanager.operationtemplates.fluent.OperationTemplatesClient; +import azure.resourcemanager.operationtemplates.implementation.LroesImpl; +import azure.resourcemanager.operationtemplates.implementation.OperationTemplatesClientBuilder; +import azure.resourcemanager.operationtemplates.models.Lroes; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * Entry point to OperationTemplatesManager. + * Arm Resource Provider management API. + */ +public final class OperationTemplatesManager { + private Lroes lroes; + + private final OperationTemplatesClient clientObject; + + private OperationTemplatesManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = new OperationTemplatesClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of OperationTemplates service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the OperationTemplates service API instance. + */ + public static OperationTemplatesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Creates an instance of OperationTemplates service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the OperationTemplates service API instance. + */ + public static OperationTemplatesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new OperationTemplatesManager(httpPipeline, profile, null); + } + + /** + * Gets a Configurable instance that can be used to create OperationTemplatesManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new OperationTemplatesManager.Configurable(); + } + + /** + * The Configurable allowing configurations to be set. + */ + public static final class Configurable { + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private RetryOptions retryOptions; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the retry options for the HTTP pipeline retry policy. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of OperationTemplates service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the OperationTemplates service API instance. + */ + public OperationTemplatesManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("azure.resourcemanager.operationtemplates") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); + policies.add(new RequestIdPolicy()); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new OperationTemplatesManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** + * Gets the resource collection API of Lroes. It manages Order. + * + * @return Resource collection API of Lroes. + */ + public Lroes lroes() { + if (this.lroes == null) { + this.lroes = new LroesImpl(clientObject.getLroes(), this); + } + return lroes; + } + + /** + * Gets wrapped service client OperationTemplatesClient providing direct access to the underlying auto-generated API + * implementation, based on Azure REST API. + * + * @return Wrapped service client OperationTemplatesClient. + */ + public OperationTemplatesClient serviceClient() { + return this.clientObject; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java new file mode 100644 index 0000000000..a3b6d81429 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/LroesClient.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.fluent; + +import azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner; +import azure.resourcemanager.operationtemplates.fluent.models.OrderInner; +import azure.resourcemanager.operationtemplates.models.ExportRequest; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; + +/** + * An instance of this class provides access to all the operations defined in LroesClient. + */ +public interface LroesClient { + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderInner> beginCreateOrReplace(String resourceGroupName, String orderName, + OrderInner resource); + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OrderInner> beginCreateOrReplace(String resourceGroupName, String orderName, + OrderInner resource, Context context); + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderInner createOrReplace(String resourceGroupName, String orderName, OrderInner resource); + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OrderInner createOrReplace(String resourceGroupName, String orderName, OrderInner resource, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportResultInner> beginExport(String resourceGroupName, String orderName, + ExportRequest body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ExportResultInner> beginExport(String resourceGroupName, String orderName, + ExportRequest body, Context context); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportResultInner export(String resourceGroupName, String orderName, ExportRequest body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ExportResultInner export(String resourceGroupName, String orderName, ExportRequest body, Context context); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String orderName); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String orderName, Context context); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String orderName); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String orderName, Context context); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/OperationTemplatesClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/OperationTemplatesClient.java new file mode 100644 index 0000000000..523746cba2 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/OperationTemplatesClient.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** + * The interface for OperationTemplatesClient class. + */ +public interface OperationTemplatesClient { + /** + * Gets Service host. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the LroesClient object to access its operations. + * + * @return the LroesClient object. + */ + LroesClient getLroes(); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/ExportResultInner.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/ExportResultInner.java new file mode 100644 index 0000000000..ee5caa3a21 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/ExportResultInner.java @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ExportResult model. + */ +@Immutable +public final class ExportResultInner implements JsonSerializable { + /* + * Content of the exported order. + */ + private String content; + + /** + * Creates an instance of ExportResultInner class. + */ + private ExportResultInner() { + } + + /** + * Get the content property: Content of the exported order. + * + * @return the content value. + */ + public String content() { + return this.content; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (content() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property content in model ExportResultInner")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("content", this.content); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportResultInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExportResultInner. + */ + public static ExportResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportResultInner deserializedExportResultInner = new ExportResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("content".equals(fieldName)) { + deserializedExportResultInner.content = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExportResultInner; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/OrderInner.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/OrderInner.java new file mode 100644 index 0000000000..db538b0a12 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/OrderInner.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.fluent.models; + +import azure.resourcemanager.operationtemplates.models.OrderProperties; +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Concrete tracked resource types can be created by aliasing this type using a specific property type. + */ +@Fluent +public final class OrderInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private OrderProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of OrderInner class. + */ + public OrderInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public OrderProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the OrderInner object itself. + */ + public OrderInner withProperties(OrderProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public OrderInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public OrderInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrderInner. + */ + public static OrderInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderInner deserializedOrderInner = new OrderInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedOrderInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOrderInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedOrderInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedOrderInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedOrderInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedOrderInner.properties = OrderProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedOrderInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOrderInner; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/package-info.java new file mode 100644 index 0000000000..15ba9bbc45 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the inner data models for OperationTemplates. + * Arm Resource Provider management API. + */ +package azure.resourcemanager.operationtemplates.fluent.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/package-info.java new file mode 100644 index 0000000000..c750d61510 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/fluent/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the service clients for OperationTemplates. + * Arm Resource Provider management API. + */ +package azure.resourcemanager.operationtemplates.fluent; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ExportResultImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ExportResultImpl.java new file mode 100644 index 0000000000..3170b71ca1 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ExportResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner; +import azure.resourcemanager.operationtemplates.models.ExportResult; + +public final class ExportResultImpl implements ExportResult { + private ExportResultInner innerObject; + + private final azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager; + + ExportResultImpl(ExportResultInner innerObject, + azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String content() { + return this.innerModel().content(); + } + + public ExportResultInner innerModel() { + return this.innerObject; + } + + private azure.resourcemanager.operationtemplates.OperationTemplatesManager manager() { + return this.serviceManager; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java new file mode 100644 index 0000000000..10a213645d --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesClientImpl.java @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import azure.resourcemanager.operationtemplates.fluent.LroesClient; +import azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner; +import azure.resourcemanager.operationtemplates.fluent.models.OrderInner; +import azure.resourcemanager.operationtemplates.models.ExportRequest; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in LroesClient. + */ +public final class LroesClientImpl implements LroesClient { + /** + * The proxy service used to perform REST calls. + */ + private final LroesService service; + + /** + * The service client containing this operation class. + */ + private final OperationTemplatesClientImpl client; + + /** + * Initializes an instance of LroesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + LroesClientImpl(OperationTemplatesClientImpl client) { + this.service = RestProxy.create(LroesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for OperationTemplatesClientLroes to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "OperationTemplatesCl") + public interface LroesService { + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.OperationTemplates/orders/{orderName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrReplace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderName") String orderName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") OrderInner resource, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.OperationTemplates/orders/{orderName}/export") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> export(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderName") String orderName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExportRequest body, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Azure.ResourceManager.OperationTemplates/orders/{orderName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("orderName") String orderName, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, + String orderName, OrderInner resource) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderName, contentType, accept, resource, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type along + * with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrReplaceWithResponseAsync(String resourceGroupName, + String orderName, OrderInner resource, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrReplace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderName, contentType, accept, resource, context); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderInner> beginCreateOrReplaceAsync(String resourceGroupName, + String orderName, OrderInner resource) { + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, orderName, resource); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), OrderInner.class, + OrderInner.class, this.client.getContext()); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OrderInner> beginCreateOrReplaceAsync(String resourceGroupName, + String orderName, OrderInner resource, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrReplaceWithResponseAsync(resourceGroupName, orderName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), OrderInner.class, + OrderInner.class, context); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderInner> beginCreateOrReplace(String resourceGroupName, + String orderName, OrderInner resource) { + return this.beginCreateOrReplaceAsync(resourceGroupName, orderName, resource).getSyncPoller(); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of concrete tracked resource types can be created by aliasing this + * type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OrderInner> beginCreateOrReplace(String resourceGroupName, + String orderName, OrderInner resource, Context context) { + return this.beginCreateOrReplaceAsync(resourceGroupName, orderName, resource, context).getSyncPoller(); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String orderName, OrderInner resource) { + return beginCreateOrReplaceAsync(resourceGroupName, orderName, resource).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrReplaceAsync(String resourceGroupName, String orderName, OrderInner resource, + Context context) { + return beginCreateOrReplaceAsync(resourceGroupName, orderName, resource, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner createOrReplace(String resourceGroupName, String orderName, OrderInner resource) { + return createOrReplaceAsync(resourceGroupName, orderName, resource).block(); + } + + /** + * Create a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param resource Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return concrete tracked resource types can be created by aliasing this type using a specific property type. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OrderInner createOrReplace(String resourceGroupName, String orderName, OrderInner resource, + Context context) { + return createOrReplaceAsync(resourceGroupName, orderName, resource, context).block(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportWithResponseAsync(String resourceGroupName, String orderName, + ExportRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.export(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> exportWithResponseAsync(String resourceGroupName, String orderName, + ExportRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.export(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, orderName, contentType, accept, body, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportResultInner> beginExportAsync(String resourceGroupName, + String orderName, ExportRequest body) { + Mono>> mono = exportWithResponseAsync(resourceGroupName, orderName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExportResultInner.class, ExportResultInner.class, this.client.getContext()); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ExportResultInner> beginExportAsync(String resourceGroupName, + String orderName, ExportRequest body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = exportWithResponseAsync(resourceGroupName, orderName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ExportResultInner.class, ExportResultInner.class, context); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportResultInner> beginExport(String resourceGroupName, + String orderName, ExportRequest body) { + return this.beginExportAsync(resourceGroupName, orderName, body).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ExportResultInner> beginExport(String resourceGroupName, + String orderName, ExportRequest body, Context context) { + return this.beginExportAsync(resourceGroupName, orderName, body, context).getSyncPoller(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync(String resourceGroupName, String orderName, ExportRequest body) { + return beginExportAsync(resourceGroupName, orderName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono exportAsync(String resourceGroupName, String orderName, ExportRequest body, + Context context) { + return beginExportAsync(resourceGroupName, orderName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportResultInner export(String resourceGroupName, String orderName, ExportRequest body) { + return exportAsync(resourceGroupName, orderName, body).block(); + } + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ExportResultInner export(String resourceGroupName, String orderName, ExportRequest body, Context context) { + return exportAsync(resourceGroupName, orderName, body, context).block(); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String orderName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, orderName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String orderName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (orderName == null) { + return Mono.error(new IllegalArgumentException("Parameter orderName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, orderName, accept, context); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String orderName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, orderName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String orderName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, orderName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String orderName) { + return this.beginDeleteAsync(resourceGroupName, orderName).getSyncPoller(); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String orderName, Context context) { + return this.beginDeleteAsync(resourceGroupName, orderName, context).getSyncPoller(); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String orderName) { + return beginDeleteAsync(resourceGroupName, orderName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String orderName, Context context) { + return beginDeleteAsync(resourceGroupName, orderName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String orderName) { + deleteAsync(resourceGroupName, orderName).block(); + } + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String orderName, Context context) { + deleteAsync(resourceGroupName, orderName, context).block(); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesImpl.java new file mode 100644 index 0000000000..b528a78346 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/LroesImpl.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import azure.resourcemanager.operationtemplates.fluent.LroesClient; +import azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner; +import azure.resourcemanager.operationtemplates.models.ExportRequest; +import azure.resourcemanager.operationtemplates.models.ExportResult; +import azure.resourcemanager.operationtemplates.models.Lroes; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; + +public final class LroesImpl implements Lroes { + private static final ClientLogger LOGGER = new ClientLogger(LroesImpl.class); + + private final LroesClient innerClient; + + private final azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager; + + public LroesImpl(LroesClient innerClient, + azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ExportResult export(String resourceGroupName, String orderName, ExportRequest body) { + ExportResultInner inner = this.serviceClient().export(resourceGroupName, orderName, body); + if (inner != null) { + return new ExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public ExportResult export(String resourceGroupName, String orderName, ExportRequest body, Context context) { + ExportResultInner inner = this.serviceClient().export(resourceGroupName, orderName, body, context); + if (inner != null) { + return new ExportResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String orderName) { + this.serviceClient().delete(resourceGroupName, orderName); + } + + public void delete(String resourceGroupName, String orderName, Context context) { + this.serviceClient().delete(resourceGroupName, orderName, context); + } + + public void deleteById(String id) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderName = ResourceManagerUtils.getValueFromIdByName(id, "orders"); + if (orderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orders'.", id))); + } + this.delete(resourceGroupName, orderName, Context.NONE); + } + + public void deleteByIdWithResponse(String id, Context context) { + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); + if (resourceGroupName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + } + String orderName = ResourceManagerUtils.getValueFromIdByName(id, "orders"); + if (orderName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'orders'.", id))); + } + this.delete(resourceGroupName, orderName, context); + } + + private LroesClient serviceClient() { + return this.innerClient; + } + + private azure.resourcemanager.operationtemplates.OperationTemplatesManager manager() { + return this.serviceManager; + } + + public OrderImpl define(String name) { + return new OrderImpl(name, this.manager()); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientBuilder.java new file mode 100644 index 0000000000..bc9c3f5d43 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the OperationTemplatesClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { OperationTemplatesClientImpl.class }) +public final class OperationTemplatesClientBuilder { + /* + * Service host + */ + private String endpoint; + + /** + * Sets Service host. + * + * @param endpoint the endpoint value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The ID of the target subscription. The value must be an UUID. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. The value must be an UUID. + * + * @param subscriptionId the subscriptionId value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the OperationTemplatesClientBuilder. + */ + public OperationTemplatesClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of OperationTemplatesClientImpl with the provided parameters. + * + * @return an instance of OperationTemplatesClientImpl. + */ + public OperationTemplatesClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + OperationTemplatesClientImpl client = new OperationTemplatesClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); + return client; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientImpl.java new file mode 100644 index 0000000000..aa23fb9452 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OperationTemplatesClientImpl.java @@ -0,0 +1,288 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import azure.resourcemanager.operationtemplates.fluent.LroesClient; +import azure.resourcemanager.operationtemplates.fluent.OperationTemplatesClient; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the OperationTemplatesClientImpl type. + */ +@ServiceClient(builder = OperationTemplatesClientBuilder.class) +public final class OperationTemplatesClientImpl implements OperationTemplatesClient { + /** + * Service host. + */ + private final String endpoint; + + /** + * Gets Service host. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Version parameter. + */ + private final String apiVersion; + + /** + * Gets Version parameter. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The LroesClient object to access its operations. + */ + private final LroesClient lroes; + + /** + * Gets the LroesClient object to access its operations. + * + * @return the LroesClient object. + */ + public LroesClient getLroes() { + return this.lroes; + } + + /** + * Initializes an instance of OperationTemplatesClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. + */ + OperationTemplatesClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.endpoint = endpoint; + this.subscriptionId = subscriptionId; + this.apiVersion = "2023-12-01-preview"; + this.lroes = new LroesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + return CoreUtils.mergeContexts(this.getContext(), context); + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + LOGGER.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(HttpHeaderName.fromString(s)); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationTemplatesClientImpl.class); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OrderImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OrderImpl.java new file mode 100644 index 0000000000..ff8fba0c5a --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/OrderImpl.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import azure.resourcemanager.operationtemplates.fluent.models.OrderInner; +import azure.resourcemanager.operationtemplates.models.ExportRequest; +import azure.resourcemanager.operationtemplates.models.ExportResult; +import azure.resourcemanager.operationtemplates.models.Order; +import azure.resourcemanager.operationtemplates.models.OrderProperties; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import java.util.Collections; +import java.util.Map; + +public final class OrderImpl implements Order, Order.Definition { + private OrderInner innerObject; + + private final azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager; + + OrderImpl(OrderInner innerObject, + azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public String location() { + return this.innerModel().location(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + + public OrderProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public OrderInner innerModel() { + return this.innerObject; + } + + private azure.resourcemanager.operationtemplates.OperationTemplatesManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String orderName; + + public OrderImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public Order create() { + this.innerObject = serviceManager.serviceClient() + .getLroes() + .createOrReplace(resourceGroupName, orderName, this.innerModel(), Context.NONE); + return this; + } + + public Order create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getLroes() + .createOrReplace(resourceGroupName, orderName, this.innerModel(), context); + return this; + } + + OrderImpl(String name, azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager) { + this.innerObject = new OrderInner(); + this.serviceManager = serviceManager; + this.orderName = name; + } + + public ExportResult export(ExportRequest body) { + return serviceManager.lroes().export(resourceGroupName, orderName, body); + } + + public ExportResult export(ExportRequest body, Context context) { + return serviceManager.lroes().export(resourceGroupName, orderName, body, context); + } + + public OrderImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public OrderImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public OrderImpl withTags(Map tags) { + this.innerModel().withTags(tags); + return this; + } + + public OrderImpl withProperties(OrderProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ResourceManagerUtils.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ResourceManagerUtils.java new file mode 100644 index 0000000000..3cc05aedfd --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/ResourceManagerUtils.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (!segments.isEmpty() && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl<>(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl<>(iterable.iterator(), mapper); + } + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/package-info.java new file mode 100644 index 0000000000..fd1cf17805 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the implementations for OperationTemplates. + * Arm Resource Provider management API. + */ +package azure.resourcemanager.operationtemplates.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportRequest.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportRequest.java new file mode 100644 index 0000000000..4a6e9a623c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportRequest.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ExportRequest model. + */ +@Fluent +public final class ExportRequest implements JsonSerializable { + /* + * Format of the exported order. + */ + private String format; + + /** + * Creates an instance of ExportRequest class. + */ + public ExportRequest() { + } + + /** + * Get the format property: Format of the exported order. + * + * @return the format value. + */ + public String format() { + return this.format; + } + + /** + * Set the format property: Format of the exported order. + * + * @param format the format value to set. + * @return the ExportRequest object itself. + */ + public ExportRequest withFormat(String format) { + this.format = format; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (format() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property format in model ExportRequest")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ExportRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("format", this.format); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExportRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExportRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ExportRequest. + */ + public static ExportRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExportRequest deserializedExportRequest = new ExportRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("format".equals(fieldName)) { + deserializedExportRequest.format = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedExportRequest; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportResult.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportResult.java new file mode 100644 index 0000000000..7b1b795b87 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/ExportResult.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.models; + +import azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner; + +/** + * An immutable client-side representation of ExportResult. + */ +public interface ExportResult { + /** + * Gets the content property: Content of the exported order. + * + * @return the content value. + */ + String content(); + + /** + * Gets the inner azure.resourcemanager.operationtemplates.fluent.models.ExportResultInner object. + * + * @return the inner object. + */ + ExportResultInner innerModel(); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java new file mode 100644 index 0000000000..92398ca748 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Lroes.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.models; + +import com.azure.core.util.Context; + +/** + * Resource collection API of Lroes. + */ +public interface Lroes { + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportResult export(String resourceGroupName, String orderName, ExportRequest body); + + /** + * A long-running resource action. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportResult export(String resourceGroupName, String orderName, ExportRequest body, Context context); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByResourceGroup(String resourceGroupName, String orderName); + + /** + * Delete a Order. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param orderName The name of the Order. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void delete(String resourceGroupName, String orderName, Context context); + + /** + * Delete a Order. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteById(String id); + + /** + * Delete a Order. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new Order resource. + * + * @param name resource name. + * @return the first stage of the new Order definition. + */ + Order.DefinitionStages.Blank define(String name); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java new file mode 100644 index 0000000000..9155502b9e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/Order.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.models; + +import azure.resourcemanager.operationtemplates.fluent.models.OrderInner; +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import java.util.Map; + +/** + * An immutable client-side representation of Order. + */ +public interface Order { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + OrderProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner azure.resourcemanager.operationtemplates.fluent.models.OrderInner object. + * + * @return the inner object. + */ + OrderInner innerModel(); + + /** + * The entirety of the Order definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + } + + /** + * The Order definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the Order definition. + */ + interface Blank extends WithLocation { + } + + /** + * The stage of the Order definition allowing to specify location. + */ + interface WithLocation { + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(Region location); + + /** + * Specifies the region for the resource. + * + * @param location The geo-location where the resource lives. + * @return the next definition stage. + */ + WithResourceGroup withRegion(String location); + } + + /** + * The stage of the Order definition allowing to specify parent resource. + */ + interface WithResourceGroup { + /** + * Specifies resourceGroupName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @return the next definition stage. + */ + WithCreate withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the Order definition which contains all the minimum required properties for the resource to be + * created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + Order create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + Order create(Context context); + } + + /** + * The stage of the Order definition allowing to specify tags. + */ + interface WithTags { + /** + * Specifies the tags property: Resource tags.. + * + * @param tags Resource tags. + * @return the next definition stage. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the Order definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. + * @return the next definition stage. + */ + WithCreate withProperties(OrderProperties properties); + } + } + + /** + * A long-running resource action. + * + * @param body The content of the action request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportResult export(ExportRequest body); + + /** + * A long-running resource action. + * + * @param body The content of the action request. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + ExportResult export(ExportRequest body, Context context); +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/OrderProperties.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/OrderProperties.java new file mode 100644 index 0000000000..0719f2a717 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/OrderProperties.java @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package azure.resourcemanager.operationtemplates.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The OrderProperties model. + */ +@Fluent +public final class OrderProperties implements JsonSerializable { + /* + * The product ID of the order. + */ + private String productId; + + /* + * Amount of the product. + */ + private int amount; + + /* + * The provisioning state of the product. + */ + private String provisioningState; + + /** + * Creates an instance of OrderProperties class. + */ + public OrderProperties() { + } + + /** + * Get the productId property: The product ID of the order. + * + * @return the productId value. + */ + public String productId() { + return this.productId; + } + + /** + * Set the productId property: The product ID of the order. + * + * @param productId the productId value to set. + * @return the OrderProperties object itself. + */ + public OrderProperties withProductId(String productId) { + this.productId = productId; + return this; + } + + /** + * Get the amount property: Amount of the product. + * + * @return the amount value. + */ + public int amount() { + return this.amount; + } + + /** + * Set the amount property: Amount of the product. + * + * @param amount the amount value to set. + * @return the OrderProperties object itself. + */ + public OrderProperties withAmount(int amount) { + this.amount = amount; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the product. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (productId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property productId in model OrderProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OrderProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("productId", this.productId); + jsonWriter.writeIntField("amount", this.amount); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OrderProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OrderProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OrderProperties. + */ + public static OrderProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OrderProperties deserializedOrderProperties = new OrderProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("productId".equals(fieldName)) { + deserializedOrderProperties.productId = reader.getString(); + } else if ("amount".equals(fieldName)) { + deserializedOrderProperties.amount = reader.getInt(); + } else if ("provisioningState".equals(fieldName)) { + deserializedOrderProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOrderProperties; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/package-info.java new file mode 100644 index 0000000000..32a6c3f333 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the data models for OperationTemplates. + * Arm Resource Provider management API. + */ +package azure.resourcemanager.operationtemplates.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/package-info.java new file mode 100644 index 0000000000..77cea3ac70 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/azure/resourcemanager/operationtemplates/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * Package containing the classes for OperationTemplates. + * Arm Resource Provider management API. + */ +package azure.resourcemanager.operationtemplates; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableAsyncClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableAsyncClient.java index 1c3183437a..d1feec3d6e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableAsyncClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableAsyncClient.java @@ -12,15 +12,13 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import java.util.stream.Collectors; -import payload.pageable.implementation.PageableClientImpl; -import payload.pageable.models.User; -import reactor.core.publisher.Flux; +import com.azure.core.util.FluxUtil; +import payload.pageable.implementation.ServerDrivenPaginationsImpl; +import payload.pageable.serverdrivenpagination.models.LinkResponse; +import reactor.core.publisher.Mono; /** * Initializes a new instance of the asynchronous PageableClient type. @@ -28,7 +26,7 @@ @ServiceClient(builder = PageableClientBuilder.class, isAsync = true) public final class PageableAsyncClient { @Generated - private final PageableClientImpl serviceClient; + private final ServerDrivenPaginationsImpl serviceClient; /** * Initializes an instance of PageableAsyncClient class. @@ -36,25 +34,29 @@ public final class PageableAsyncClient { * @param serviceClient the service client implementation. */ @Generated - PageableAsyncClient(PageableClientImpl serviceClient) { + PageableAsyncClient(ServerDrivenPaginationsImpl serviceClient) { this.serviceClient = serviceClient; } /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * The link operation. *

Response Body Schema

* *
      * {@code
      * {
-     *     name: String (Required)
+     *     pets (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
+     *     links (Required): {
+     *         next: String (Optional)
+     *         prev: String (Optional)
+     *         first: String (Optional)
+     *         last: String (Optional)
+     *     }
      * }
      * }
      * 
@@ -64,41 +66,30 @@ public final class PageableAsyncClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items as paginated response with {@link PagedFlux}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list(RequestOptions requestOptions) { - return this.serviceClient.listAsync(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> linkWithResponse(RequestOptions requestOptions) { + return this.serviceClient.linkWithResponseAsync(requestOptions); } /** - * List users. + * The link operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of User items as paginated response with {@link PagedFlux}. + * @return the response body on successful completion of {@link Mono}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux list() { - // Generated convenience method for list + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono link() { + // Generated convenience method for linkWithResponse RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = list(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(User.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); + return linkWithResponse(requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(LinkResponse.class)); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClient.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClient.java index 22faa0127f..df73ffa91f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClient.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClient.java @@ -12,11 +12,11 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; -import payload.pageable.implementation.PageableClientImpl; -import payload.pageable.models.User; +import payload.pageable.implementation.ServerDrivenPaginationsImpl; +import payload.pageable.serverdrivenpagination.models.LinkResponse; /** * Initializes a new instance of the synchronous PageableClient type. @@ -24,7 +24,7 @@ @ServiceClient(builder = PageableClientBuilder.class) public final class PageableClient { @Generated - private final PageableClientImpl serviceClient; + private final ServerDrivenPaginationsImpl serviceClient; /** * Initializes an instance of PageableClient class. @@ -32,25 +32,29 @@ public final class PageableClient { * @param serviceClient the service client implementation. */ @Generated - PageableClient(PageableClientImpl serviceClient) { + PageableClient(ServerDrivenPaginationsImpl serviceClient) { this.serviceClient = serviceClient; } /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * The link operation. *

Response Body Schema

* *
      * {@code
      * {
-     *     name: String (Required)
+     *     pets (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
+     *     links (Required): {
+     *         next: String (Optional)
+     *         prev: String (Optional)
+     *         first: String (Optional)
+     *         last: String (Optional)
+     *     }
      * }
      * }
      * 
@@ -60,29 +64,29 @@ public final class PageableClient { * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items as paginated response with {@link PagedIterable}. + * @return the response body along with {@link Response}. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - return this.serviceClient.list(requestOptions); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response linkWithResponse(RequestOptions requestOptions) { + return this.serviceClient.linkWithResponse(requestOptions); } /** - * List users. + * The link operation. * * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return paged collection of User items as paginated response with {@link PagedIterable}. + * @return the response. */ @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - // Generated convenience method for list + @ServiceMethod(returns = ReturnType.SINGLE) + public LinkResponse link() { + // Generated convenience method for linkWithResponse RequestOptions requestOptions = new RequestOptions(); - return serviceClient.list(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(User.class)); + return linkWithResponse(requestOptions).getValue().toObject(LinkResponse.class); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClientBuilder.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClientBuilder.java index 56329b5d4f..923de32ffb 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClientBuilder.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/PageableClientBuilder.java @@ -270,7 +270,7 @@ private HttpPipeline createHttpPipeline() { */ @Generated public PageableAsyncClient buildAsyncClient() { - return new PageableAsyncClient(buildInnerClient()); + return new PageableAsyncClient(buildInnerClient().getServerDrivenPaginations()); } /** @@ -280,7 +280,7 @@ public PageableAsyncClient buildAsyncClient() { */ @Generated public PageableClient buildClient() { - return new PageableClient(buildInnerClient()); + return new PageableClient(buildInnerClient().getServerDrivenPaginations()); } private static final ClientLogger LOGGER = new ClientLogger(PageableClientBuilder.class); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/PageableClientImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/PageableClientImpl.java index a7e8f53a79..d540ad925e 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/PageableClientImpl.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/PageableClientImpl.java @@ -4,51 +4,17 @@ package payload.pageable.implementation; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.exception.ClientAuthenticationException; -import com.azure.core.exception.HttpResponseException; -import com.azure.core.exception.ResourceModifiedException; -import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.RequestOptions; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.util.BinaryData; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.core.util.UrlBuilder; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import reactor.core.publisher.Mono; /** * Initializes a new instance of the PageableClient type. */ public final class PageableClientImpl { - /** - * The proxy service used to perform REST calls. - */ - private final PageableClientService service; - /** * Service host. */ @@ -91,6 +57,20 @@ public SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } + /** + * The ServerDrivenPaginationsImpl object to access its operations. + */ + private final ServerDrivenPaginationsImpl serverDrivenPaginations; + + /** + * Gets the ServerDrivenPaginationsImpl object to access its operations. + * + * @return the ServerDrivenPaginationsImpl object. + */ + public ServerDrivenPaginationsImpl getServerDrivenPaginations() { + return this.serverDrivenPaginations; + } + /** * Initializes an instance of PageableClient client. * @@ -122,306 +102,6 @@ public PageableClientImpl(HttpPipeline httpPipeline, SerializerAdapter serialize this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.endpoint = endpoint; - this.service = RestProxy.create(PageableClientService.class, this.httpPipeline, this.getSerializerAdapter()); - } - - /** - * The interface defining all the services for PageableClient to be used by the proxy service to perform REST calls. - */ - @Host("{endpoint}") - @ServiceInterface(name = "PageableClient") - public interface PageableClientService { - @Get("/payload/pageable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> list(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("/payload/pageable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) - @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) - @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, - Context context); - } - - /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedFlux<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listSinglePageAsync(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listNextSinglePageAsync(nextLink, requestOptionsLocal); - }); - } - - /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(RequestOptions requestOptions) { - final String accept = "application/json"; - Response res = service.listSync(this.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - /** - * List users. - *

Query Parameters

- * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
maxpagesizeIntegerNoThe maximum number of result items per page.
- * You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(RequestOptions requestOptions) { - RequestOptions requestOptionsForNextPage = new RequestOptions(); - requestOptionsForNextPage.setContext( - requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); - return new PagedIterable<>((pageSize) -> { - RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listSinglePage(requestOptionsLocal); - }, (nextLink, pageSize) -> { - RequestOptions requestOptionsLocal = new RequestOptions(); - requestOptionsLocal.setContext(requestOptionsForNextPage.getContext()); - if (pageSize != null) { - requestOptionsLocal.addRequestCallback(requestLocal -> { - UrlBuilder urlBuilder = UrlBuilder.parse(requestLocal.getUrl()); - urlBuilder.setQueryParameter("maxpagesize", String.valueOf(pageSize)); - requestLocal.setUrl(urlBuilder.toString()); - }); - } - return listNextSinglePage(nextLink, requestOptionsLocal); - }); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); - } - - /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     * }
-     * }
-     * 
- * - * @param nextLink The URL to get the next list of items. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return paged collection of User items along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listNextSinglePage(String nextLink, RequestOptions requestOptions) { - final String accept = "application/json"; - Response res - = service.listNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); - } - - private List getValues(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - List values = (List) obj.get(path); - return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); - } catch (RuntimeException e) { - return null; - } - } - - private String getNextLink(BinaryData binaryData, String path) { - try { - Map obj = binaryData.toObject(Map.class); - return (String) obj.get(path); - } catch (RuntimeException e) { - return null; - } + this.serverDrivenPaginations = new ServerDrivenPaginationsImpl(this); } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/ServerDrivenPaginationsImpl.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/ServerDrivenPaginationsImpl.java new file mode 100644 index 0000000000..a02e2a572e --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/ServerDrivenPaginationsImpl.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.pageable.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ServerDrivenPaginations. + */ +public final class ServerDrivenPaginationsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ServerDrivenPaginationsService service; + + /** + * The service client containing this operation class. + */ + private final PageableClientImpl client; + + /** + * Initializes an instance of ServerDrivenPaginationsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ServerDrivenPaginationsImpl(PageableClientImpl client) { + this.service = RestProxy.create(ServerDrivenPaginationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PageableClientServerDrivenPaginations to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "PageableClientServer") + public interface ServerDrivenPaginationsService { + @Get("/payload/pageable/server-driven-pagination/link") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> link(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/payload/pageable/server-driven-pagination/link") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response linkSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * The link operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     pets (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
+     *     links (Required): {
+     *         next: String (Optional)
+     *         prev: String (Optional)
+     *         first: String (Optional)
+     *         last: String (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> linkWithResponseAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.link(this.client.getEndpoint(), accept, requestOptions, context)); + } + + /** + * The link operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     pets (Required): [
+     *          (Required){
+     *             id: String (Required)
+     *             name: String (Required)
+     *         }
+     *     ]
+     *     links (Required): {
+     *         next: String (Optional)
+     *         prev: String (Optional)
+     *         first: String (Optional)
+     *         last: String (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response linkWithResponse(RequestOptions requestOptions) { + final String accept = "application/json"; + return service.linkSync(this.client.getEndpoint(), accept, requestOptions, Context.NONE); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/package-info.java index af1a7908b1..21fdeab777 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/implementation/package-info.java @@ -5,7 +5,7 @@ /** * * Package containing the implementations for Pageable. - * Test describing pageable. + * Test for pageable payload. * */ package payload.pageable.implementation; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/Pet.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/Pet.java new file mode 100644 index 0000000000..eb1cd346b7 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/Pet.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.pageable.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Pet model. + */ +@Immutable +public final class Pet implements JsonSerializable { + /* + * The id property. + */ + @Generated + private final String id; + + /* + * The name property. + */ + @Generated + private final String name; + + /** + * Creates an instance of Pet class. + * + * @param id the id value to set. + * @param name the name value to set. + */ + @Generated + private Pet(String id, String name) { + this.id = id; + this.name = name; + } + + /** + * Get the id property: The id property. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The name property. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Pet from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Pet if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Pet. + */ + @Generated + public static Pet fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new Pet(id, name); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/package-info.java index cdd8bd0725..c8d9bde6ec 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/models/package-info.java @@ -5,7 +5,7 @@ /** * * Package containing the data models for Pageable. - * Test describing pageable. + * Test for pageable payload. * */ package payload.pageable.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/package-info.java index 18e1f23a24..7ca0948654 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/package-info.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/package-info.java @@ -5,7 +5,7 @@ /** * * Package containing the classes for Pageable. - * Test describing pageable. + * Test for pageable payload. * */ package payload.pageable; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponse.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponse.java new file mode 100644 index 0000000000..d2311b73ba --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponse.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.pageable.serverdrivenpagination.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import payload.pageable.models.Pet; + +/** + * The LinkResponse model. + */ +@Immutable +public final class LinkResponse implements JsonSerializable { + /* + * The pets property. + */ + @Generated + private final List pets; + + /* + * The links property. + */ + @Generated + private final LinkResponseLinks links; + + /** + * Creates an instance of LinkResponse class. + * + * @param pets the pets value to set. + * @param links the links value to set. + */ + @Generated + private LinkResponse(List pets, LinkResponseLinks links) { + this.pets = pets; + this.links = links; + } + + /** + * Get the pets property: The pets property. + * + * @return the pets value. + */ + @Generated + public List getPets() { + return this.pets; + } + + /** + * Get the links property: The links property. + * + * @return the links value. + */ + @Generated + public LinkResponseLinks getLinks() { + return this.links; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("pets", this.pets, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("links", this.links); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkResponse if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the LinkResponse. + */ + @Generated + public static LinkResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List pets = null; + LinkResponseLinks links = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("pets".equals(fieldName)) { + pets = reader.readArray(reader1 -> Pet.fromJson(reader1)); + } else if ("links".equals(fieldName)) { + links = LinkResponseLinks.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return new LinkResponse(pets, links); + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponseLinks.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponseLinks.java new file mode 100644 index 0000000000..e2b4673b81 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/LinkResponseLinks.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package payload.pageable.serverdrivenpagination.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The LinkResponseLinks model. + */ +@Immutable +public final class LinkResponseLinks implements JsonSerializable { + /* + * The next property. + */ + @Generated + private String next; + + /* + * The prev property. + */ + @Generated + private String prev; + + /* + * The first property. + */ + @Generated + private String first; + + /* + * The last property. + */ + @Generated + private String last; + + /** + * Creates an instance of LinkResponseLinks class. + */ + @Generated + private LinkResponseLinks() { + } + + /** + * Get the next property: The next property. + * + * @return the next value. + */ + @Generated + public String getNext() { + return this.next; + } + + /** + * Get the prev property: The prev property. + * + * @return the prev value. + */ + @Generated + public String getPrev() { + return this.prev; + } + + /** + * Get the first property: The first property. + * + * @return the first value. + */ + @Generated + public String getFirst() { + return this.first; + } + + /** + * Get the last property: The last property. + * + * @return the last value. + */ + @Generated + public String getLast() { + return this.last; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("next", this.next); + jsonWriter.writeStringField("prev", this.prev); + jsonWriter.writeStringField("first", this.first); + jsonWriter.writeStringField("last", this.last); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LinkResponseLinks from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LinkResponseLinks if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the LinkResponseLinks. + */ + @Generated + public static LinkResponseLinks fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LinkResponseLinks deserializedLinkResponseLinks = new LinkResponseLinks(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("next".equals(fieldName)) { + deserializedLinkResponseLinks.next = reader.getString(); + } else if ("prev".equals(fieldName)) { + deserializedLinkResponseLinks.prev = reader.getString(); + } else if ("first".equals(fieldName)) { + deserializedLinkResponseLinks.first = reader.getString(); + } else if ("last".equals(fieldName)) { + deserializedLinkResponseLinks.last = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedLinkResponseLinks; + }); + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/package-info.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/package-info.java new file mode 100644 index 0000000000..c88442bcae --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/payload/pageable/serverdrivenpagination/models/package-info.java @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +/** + * + * Package containing the data models for Pageable. + * Test for pageable payload. + * + */ +package payload.pageable.serverdrivenpagination.models; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/java/versioning/removed/models/Versions.java b/packages/http-client-java/generator/http-client-generator-test/src/main/java/versioning/removed/models/Versions.java index a7b05fb3ff..9c1ad1685f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/java/versioning/removed/models/Versions.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/java/versioning/removed/models/Versions.java @@ -9,7 +9,7 @@ */ public enum Versions { /** - * The original version v1. + * The version v1. */ V1("v1"), @@ -19,7 +19,7 @@ public enum Versions { V2PREVIEW("v2preview"), /** - * The latest version v2. + * The version v2. */ V2("v2"); diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-example-basic_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-example-basic_apiview_properties.json index 7f357179d6..bfdc0a71ff 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-example-basic_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-example-basic_apiview_properties.json @@ -1,13 +1,13 @@ { "flavor": "Azure", "CrossLanguageDefinitionId": { - "azure.example.basic.AzureExampleAsyncClient": "Client.AzureExampleClient", - "azure.example.basic.AzureExampleAsyncClient.basicAction": "Client.AzureExampleClient.basicAction", - "azure.example.basic.AzureExampleAsyncClient.basicActionWithResponse": "Client.AzureExampleClient.basicAction", - "azure.example.basic.AzureExampleClient": "Client.AzureExampleClient", - "azure.example.basic.AzureExampleClient.basicAction": "Client.AzureExampleClient.basicAction", - "azure.example.basic.AzureExampleClient.basicActionWithResponse": "Client.AzureExampleClient.basicAction", - "azure.example.basic.AzureExampleClientBuilder": "Client.AzureExampleClient", + "azure.example.basic.AzureExampleAsyncClient": "AzureExampleBasicClient.AzureExampleClient", + "azure.example.basic.AzureExampleAsyncClient.basicAction": "AzureExampleBasicClient.AzureExampleClient.basicAction", + "azure.example.basic.AzureExampleAsyncClient.basicActionWithResponse": "AzureExampleBasicClient.AzureExampleClient.basicAction", + "azure.example.basic.AzureExampleClient": "AzureExampleBasicClient.AzureExampleClient", + "azure.example.basic.AzureExampleClient.basicAction": "AzureExampleBasicClient.AzureExampleClient.basicAction", + "azure.example.basic.AzureExampleClient.basicActionWithResponse": "AzureExampleBasicClient.AzureExampleClient.basicAction", + "azure.example.basic.AzureExampleClientBuilder": "AzureExampleBasicClient.AzureExampleClient", "azure.example.basic.models.ActionRequest": "_Specs_.Azure.Example.Basic.ActionRequest", "azure.example.basic.models.ActionResponse": "_Specs_.Azure.Example.Basic.ActionResponse", "azure.example.basic.models.Enum": "_Specs_.Azure.Example.Basic.Enum", diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-payload-pageable_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-payload-pageable_apiview_properties.json new file mode 100644 index 0000000000..bd89a3061c --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/azure-payload-pageable_apiview_properties.json @@ -0,0 +1,11 @@ +{ + "flavor": "Azure", + "CrossLanguageDefinitionId": { + "azure.payload.pageable.PageableAsyncClient": "_Specs_.Azure.Payload.Pageable", + "azure.payload.pageable.PageableAsyncClient.list": "_Specs_.Azure.Payload.Pageable.list", + "azure.payload.pageable.PageableClient": "_Specs_.Azure.Payload.Pageable", + "azure.payload.pageable.PageableClient.list": "_Specs_.Azure.Payload.Pageable.list", + "azure.payload.pageable.PageableClientBuilder": "_Specs_.Azure.Payload.Pageable", + "azure.payload.pageable.models.User": "_Specs_.Azure.Payload.Pageable.User" + } +} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/proxy-config.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/proxy-config.json new file mode 100644 index 0000000000..862a50ed68 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/proxy-config.json @@ -0,0 +1 @@ +[["azure.resourcemanager.operationtemplates.implementation.LroesClientImpl$LroesService"]] \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/reflect-config.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/reflect-config.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-operationtemplates-generated/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-pageable_apiview_properties.json b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-pageable_apiview_properties.json index 27166da5e3..558c02a0ef 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-pageable_apiview_properties.json +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/META-INF/payload-pageable_apiview_properties.json @@ -1,11 +1,15 @@ { "flavor": "Azure", "CrossLanguageDefinitionId": { - "payload.pageable.PageableAsyncClient": "Payload.Pageable", - "payload.pageable.PageableAsyncClient.list": "Payload.Pageable.list", - "payload.pageable.PageableClient": "Payload.Pageable", - "payload.pageable.PageableClient.list": "Payload.Pageable.list", + "payload.pageable.PageableAsyncClient": "null", + "payload.pageable.PageableAsyncClient.link": "Payload.Pageable.ServerDrivenPagination.link", + "payload.pageable.PageableAsyncClient.linkWithResponse": "Payload.Pageable.ServerDrivenPagination.link", + "payload.pageable.PageableClient": "null", + "payload.pageable.PageableClient.link": "Payload.Pageable.ServerDrivenPagination.link", + "payload.pageable.PageableClient.linkWithResponse": "Payload.Pageable.ServerDrivenPagination.link", "payload.pageable.PageableClientBuilder": "Payload.Pageable", - "payload.pageable.models.User": "Payload.Pageable.User" + "payload.pageable.models.Pet": "Payload.Pageable.Pet", + "payload.pageable.serverdrivenpagination.models.LinkResponse": "Payload.Pageable.ServerDrivenPagination.link.Response.anonymous", + "payload.pageable.serverdrivenpagination.models.LinkResponseLinks": "Payload.Pageable.ServerDrivenPagination.link.Response.links.anonymous" } } diff --git a/packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-payload-pageable.properties b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-payload-pageable.properties new file mode 100644 index 0000000000..ca812989b4 --- /dev/null +++ b/packages/http-client-java/generator/http-client-generator-test/src/main/resources/azure-payload-pageable.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/samples/java/azure/example/basic/generated/BasicAction.java b/packages/http-client-java/generator/http-client-generator-test/src/samples/java/azure/example/basic/generated/BasicAction.java deleted file mode 100644 index 87c29de9ba..0000000000 --- a/packages/http-client-java/generator/http-client-generator-test/src/samples/java/azure/example/basic/generated/BasicAction.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. - -package azure.example.basic.generated; - -import azure.example.basic.AzureExampleClient; -import azure.example.basic.AzureExampleClientBuilder; -import azure.example.basic.models.ActionRequest; -import azure.example.basic.models.ActionResponse; -import azure.example.basic.models.Enum; -import azure.example.basic.models.Model; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -public class BasicAction { - public static void main(String[] args) { - AzureExampleClient azureExampleClient - = new AzureExampleClientBuilder().endpoint("http://localhost:3000").buildClient(); - // BEGIN:azure.example.basic.generated.basicaction.basicaction - ActionResponse response = azureExampleClient.basicAction("query", "header", - new ActionRequest("text") - .setModelProperty( - new Model().setInt32Property(1).setFloat32Property(1.5D).setEnumProperty(Enum.ENUM_VALUE1)) - .setArrayProperty(Arrays.asList("item")) - .setRecordProperty(mapOf("record", "value"))); - // END:azure.example.basic.generated.basicaction.basicaction - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/lro/rpc/RpcTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/lro/rpc/RpcTests.java index e41c531004..449c3ef2ca 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/lro/rpc/RpcTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/lro/rpc/RpcTests.java @@ -5,8 +5,6 @@ import _specs_.azure.core.lro.rpc.models.GenerationOptions; import _specs_.azure.core.lro.rpc.models.GenerationResult; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollOperationDetails; import com.azure.core.util.polling.PollResponse; @@ -16,9 +14,7 @@ public class RpcTests { - private final RpcClient client - = new RpcClientBuilder().httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)) - .buildClient(); + private final RpcClient client = new RpcClientBuilder().buildClient(); @Test public void testRpc() { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/model/ModelClientTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/model/ModelClientTests.java index 0ed95d8f3e..dd964907f6 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/model/ModelClientTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/model/ModelClientTests.java @@ -9,7 +9,7 @@ import org.junit.jupiter.api.Test; public class ModelClientTests { - ModelClient client = new ModelClientBuilder().buildClient(); + private final ModelClient client = new ModelClientBuilder().buildClient(); @Test public void get() { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/scalar/ScalarTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/scalar/ScalarTests.java index c4870f7c36..2da45de11f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/scalar/ScalarTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/_specs_/azure/core/scalar/ScalarTests.java @@ -4,17 +4,13 @@ package _specs_.azure.core.scalar; import _specs_.azure.core.scalar.models.AzureLocationModel; -import com.azure.core.http.policy.HttpLogDetailLevel; -import com.azure.core.http.policy.HttpLogOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class ScalarTests { private final static String LOCATION_REGION = "eastus"; - private final ScalarClient client - = new ScalarClientBuilder().httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)) - .buildClient(); + private final ScalarClient client = new ScalarClientBuilder().buildClient(); @Test public void testGet() { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/PageableTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/PageableTests.java similarity index 92% rename from packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/PageableTests.java rename to packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/PageableTests.java index 5508096709..0732efa4df 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/PageableTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/PageableTests.java @@ -1,8 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -package payload.pageable; +package azure.payload.pageable; +import azure.payload.pageable.models.User; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.rest.PagedIterable; @@ -10,7 +11,6 @@ import java.util.HashSet; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import payload.pageable.models.User; public class PageableTests { diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/generated/PageableClientTestBase.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/generated/PageableClientTestBase.java similarity index 90% rename from packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/generated/PageableClientTestBase.java rename to packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/generated/PageableClientTestBase.java index a513e45ce1..b9e8543f58 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/payload/pageable/generated/PageableClientTestBase.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/payload/pageable/generated/PageableClientTestBase.java @@ -2,19 +2,19 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package payload.pageable.generated; +package azure.payload.pageable.generated; // The Java test files under 'generated' package are generated for your reference. // If you wish to modify these files, please copy them out of the 'generated' package, and modify there. // See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. +import azure.payload.pageable.PageableClient; +import azure.payload.pageable.PageableClientBuilder; import com.azure.core.http.policy.HttpLogDetailLevel; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.test.TestMode; import com.azure.core.test.TestProxyTestBase; import com.azure.core.util.Configuration; -import payload.pageable.PageableClient; -import payload.pageable.PageableClientBuilder; class PageableClientTestBase extends TestProxyTestBase { protected PageableClient pageableClient; diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/org/utils/FileUtils.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/org/utils/FileUtils.java index 0bfb2107e0..f002da96f9 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/org/utils/FileUtils.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/org/utils/FileUtils.java @@ -14,11 +14,11 @@ private FileUtils() { } public static Path getJpgFile() { - return Paths.get("node_modules/@azure-tools/cadl-ranch-specs/assets/image.jpg"); + return Paths.get("node_modules/@typespec/http-specs/assets/image.jpg"); } public static Path getPngFile() { - return Paths.get("node_modules/@azure-tools/cadl-ranch-specs/assets/image.png"); + return Paths.get("node_modules/@typespec/http-specs/assets/image.png"); } public static byte[] getJpgBytes() { diff --git a/packages/http-client-java/generator/http-client-generator-test/tsp/subclient.tsp b/packages/http-client-java/generator/http-client-generator-test/tsp/subclient.tsp index 417bed2032..b255ff4b64 100644 --- a/packages/http-client-java/generator/http-client-generator-test/tsp/subclient.tsp +++ b/packages/http-client-java/generator/http-client-generator-test/tsp/subclient.tsp @@ -1,14 +1,14 @@ import "@typespec/http"; -import "@azure-tools/cadl-ranch-expect"; +import "@typespec/spector"; import "@azure-tools/typespec-client-generator-core"; using TypeSpec.Http; +using TypeSpec.Spector; using Azure.ClientGenerator.Core; /** * Describe client with `@clientInitialization` */ -@supportedBy("dpg") @scenarioService("/client/initialization/basic") @scenario @scenarioDoc(""" diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index 89fb0ef4ae..5bbcfa2a3d 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -15,7 +15,6 @@ "lodash": "~4.17.21" }, "devDependencies": { - "@azure-tools/cadl-ranch": "0.16.1", "@azure-tools/typespec-autorest": "0.49.0", "@azure-tools/typespec-azure-core": "0.49.0", "@azure-tools/typespec-azure-resource-manager": "0.49.0", @@ -90,192 +89,6 @@ "node": ">=10.12.0" } }, - "node_modules/@azure-tools/cadl-ranch": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch/-/cadl-ranch-0.16.1.tgz", - "integrity": "sha512-4tyd+2GDsZjkcsiB14T2m5imkPCokJkFLKrPe0mINb5Z6DVVzk/2BkhId//zk9KinpYL0ThG9ewM1ZeJ0jnoeg==", - "dev": true, - "dependencies": { - "@azure-tools/cadl-ranch-api": "~0.5.0", - "@azure-tools/cadl-ranch-coverage-sdk": "~0.9.0", - "@azure-tools/cadl-ranch-expect": "~0.15.6", - "@azure/identity": "^4.4.1", - "@types/js-yaml": "^4.0.5", - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0", - "ajv": "8.17.1", - "axios": "^1.7.5", - "body-parser": "^1.20.3", - "deep-equal": "^2.2.0", - "express": "^4.20.0", - "express-promise-router": "^4.1.1", - "form-data": "^3.0.1", - "glob": "^11.0.0", - "jackspeak": "4.0.1", - "js-yaml": "^4.1.0", - "morgan": "^1.10.0", - "multer": "^1.4.5-lts.1", - "node-fetch": "^3.3.1", - "picocolors": "^1.0.0", - "source-map-support": "^0.5.21", - "winston": "^3.14.0", - "xml2js": "^0.6.2", - "yargs": "^17.7.1" - }, - "bin": { - "cadl-ranch": "cmd/cli.mjs" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@azure-tools/cadl-ranch-api": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-api/-/cadl-ranch-api-0.5.0.tgz", - "integrity": "sha512-awgLMCWGy4VxIJ5n9SJuTH0WfZFsUv5kYffIYfvGPtV3NIkCwO1u39Polb4BBR8GLELWjRuHMxYsmhwpTzRBpw==", - "dev": true, - "dependencies": { - "body-parser": "^1.20.3", - "deep-equal": "^2.2.0", - "express": "^4.20.0", - "express-promise-router": "^4.1.1", - "glob": "^11.0.0", - "morgan": "^1.10.0", - "multer": "^1.4.5-lts.1", - "picocolors": "^1.0.0", - "winston": "^3.14.0", - "xml-formatter": "^3.6.3", - "xml2js": "^0.6.2", - "yargs": "^17.7.1" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@azure-tools/cadl-ranch-coverage-sdk": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-coverage-sdk/-/cadl-ranch-coverage-sdk-0.9.0.tgz", - "integrity": "sha512-u4WU5U6Ps6oct9E3FiBdORMsSiqpV1VBFeiqH4ZTXCV3A245n3GzznRexZ5bDuRlRY4ea2BVvKrVnemaYaLp+w==", - "dev": true, - "dependencies": { - "@azure/identity": "^4.4.1", - "@azure/storage-blob": "^12.24.0", - "@types/node": "^22.1.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/@azure-tools/cadl-ranch-expect": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.6.tgz", - "integrity": "sha512-t601oyRwiSy/Nbbro5A7OHZSKsVGxGRJMPnd4X80dYetTBinUHXS2+cVx+fVQlUmb/4Ru/qNOvG0jtTJY9/XHw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0" - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/compiler": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz", - "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@babel/code-frame": "~7.25.7", - "ajv": "~8.17.1", - "change-case": "~5.4.4", - "globby": "~14.0.2", - "mustache": "~4.2.0", - "picocolors": "~1.1.0", - "prettier": "~3.3.3", - "prompts": "~2.4.2", - "semver": "^7.6.3", - "temporal-polyfill": "^0.2.5", - "vscode-languageserver": "~9.0.1", - "vscode-languageserver-textdocument": "~1.0.12", - "yaml": "~2.5.1", - "yargs": "~17.7.2" - }, - "bin": { - "tsp": "cmd/tsp.js", - "tsp-server": "cmd/tsp-server.js" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/http": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz", - "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/streams": "~0.62.0" - }, - "peerDependenciesMeta": { - "@typespec/streams": { - "optional": true - } - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/rest": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz", - "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0" - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/versioning": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz", - "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=18.0.0" - }, - "peerDependencies": { - "@typespec/compiler": "~0.62.0" - } - }, - "node_modules/@azure-tools/cadl-ranch/node_modules/ajv": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", - "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.3", - "fast-uri": "^3.0.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, "node_modules/@azure-tools/codegen": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@azure-tools/codegen/-/codegen-2.10.0.tgz", @@ -393,244 +206,6 @@ "@typespec/versioning": "~0.63.0" } }, - "node_modules/@azure/abort-controller": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.2.tgz", - "integrity": "sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-auth": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.9.0.tgz", - "integrity": "sha512-FPwHpZywuyasDSLMqJ6fhbOK3TqUdviZNF8OqRGA4W5Ewib2lEEZ+pBsYcBa88B2NGO/SEnYPGhyBqNlE8ilSw==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-util": "^1.11.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-client": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.9.2.tgz", - "integrity": "sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.4.0", - "@azure/core-rest-pipeline": "^1.9.1", - "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.6.1", - "@azure/logger": "^1.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-http-compat": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.1.2.tgz", - "integrity": "sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-client": "^1.3.0", - "@azure/core-rest-pipeline": "^1.3.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-lro": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.7.2.tgz", - "integrity": "sha512-0YIpccoX8m/k00O7mDDMdJpbr6mf1yWo2dfmxt5A8XVZVVMz2SSKaEbMCeJRvgQ0IaSlqhjT47p4hVIRRy90xw==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-util": "^1.2.0", - "@azure/logger": "^1.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-paging": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.6.2.tgz", - "integrity": "sha512-YKWi9YuCU04B55h25cnOYZHxXYtEvQEbKST5vqRga7hWY9ydd3FZHdeQF8pyh+acWZvppw13M/LMGx0LABUVMA==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-rest-pipeline": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.18.0.tgz", - "integrity": "sha512-QSoGUp4Eq/gohEFNJaUOwTN7BCc2nHTjjbm75JT0aD7W65PWM1H/tItz0GsABn22uaKyGxiMhWQLt2r+FGU89Q==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.8.0", - "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.11.0", - "@azure/logger": "^1.0.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-tracing": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.2.0.tgz", - "integrity": "sha512-UKTiEJPkWcESPYJz3X5uKRYyOcJD+4nYph+KpfdPRnQJVrZfk0KJgdnaAWKfhsBBtAf/D58Az4AvCJEmWgIBAg==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-util": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.11.0.tgz", - "integrity": "sha512-DxOSLua+NdpWoSqULhjDyAZTXFdP/LKkqtYuxxz1SCN289zk3OG8UOpnCQAz/tygyACBtWp/BoO72ptK7msY8g==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/core-xml": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.4.4.tgz", - "integrity": "sha512-J4FYAqakGXcbfeZjwjMzjNcpcH4E+JtEBv+xcV1yL0Ydn/6wbQfeFKTCHh9wttAi0lmajHw7yBbHPRG+YHckZQ==", - "dev": true, - "dependencies": { - "fast-xml-parser": "^4.4.1", - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/identity": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.5.0.tgz", - "integrity": "sha512-EknvVmtBuSIic47xkOqyNabAme0RYTw52BTMz8eBgU1ysTyMrD1uOoM+JdS0J/4Yfp98IBT3osqq3BfwSaNaGQ==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.0.0", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-rest-pipeline": "^1.17.0", - "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.11.0", - "@azure/logger": "^1.0.0", - "@azure/msal-browser": "^3.26.1", - "@azure/msal-node": "^2.15.0", - "events": "^3.0.0", - "jws": "^4.0.0", - "open": "^8.0.0", - "stoppable": "^1.1.0", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/logger": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.4.tgz", - "integrity": "sha512-4IXXzcCdLdlXuCG+8UKEwLA1T1NHqUfanhXYHiQTn+6sfWCZXduqbtXDGceg3Ce5QxTGo7EqmbV6Bi+aqKuClQ==", - "dev": true, - "dependencies": { - "tslib": "^2.6.2" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@azure/msal-browser": { - "version": "3.27.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.27.0.tgz", - "integrity": "sha512-+b4ZKSD8+vslCtVRVetkegEhOFMLP3rxDWJY212ct+2r6jVg6OSQKc1Qz3kCoXo0FgwaXkb+76TMZfpHp8QtgA==", - "dev": true, - "dependencies": { - "@azure/msal-common": "14.16.0" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@azure/msal-common": { - "version": "14.16.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.16.0.tgz", - "integrity": "sha512-1KOZj9IpcDSwpNiQNjt0jDYZpQvNZay7QAEi/5DLubay40iGYtLzya/jbjRPLyOTZhEKyL1MzPuw2HqBCjceYA==", - "dev": true, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/@azure/msal-node": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.16.1.tgz", - "integrity": "sha512-1NEFpTmMMT2A7RnZuvRl/hUmJU+GLPjh+ShyIqPktG2PvSd2yvPnzGd/BxIBAAvJG5nr9lH4oYcQXepDbaE7fg==", - "dev": true, - "dependencies": { - "@azure/msal-common": "14.16.0", - "jsonwebtoken": "^9.0.0", - "uuid": "^8.3.0" - }, - "engines": { - "node": ">=16" - } - }, - "node_modules/@azure/storage-blob": { - "version": "12.25.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.25.0.tgz", - "integrity": "sha512-oodouhA3nCCIh843tMMbxty3WqfNT+Vgzj3Xo5jqR9UPnzq3d7mzLjlHAYz7lW+b4km3SIgz+NAgztvhm7Z6kQ==", - "dev": true, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.4.0", - "@azure/core-client": "^1.6.2", - "@azure/core-http-compat": "^2.0.0", - "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.1.1", - "@azure/core-rest-pipeline": "^1.10.1", - "@azure/core-tracing": "^1.1.2", - "@azure/core-util": "^1.6.1", - "@azure/core-xml": "^1.4.3", - "@azure/logger": "^1.0.0", - "events": "^3.0.0", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@babel/code-frame": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.9.tgz", @@ -711,26 +286,6 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, - "node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "dev": true, - "engines": { - "node": ">=0.1.90" - } - }, - "node_modules/@dabh/diagnostics": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", - "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", - "dev": true, - "dependencies": { - "colorspace": "1.1.x", - "enabled": "2.0.x", - "kuler": "^2.0.0" - } - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", @@ -1912,12 +1467,6 @@ "undici-types": "~6.20.0" } }, - "node_modules/@types/triple-beam": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", - "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", - "dev": true - }, "node_modules/@typespec/compiler": { "version": "0.63.0", "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz", @@ -2207,31 +1756,6 @@ "url": "https://opencollective.com/vitest" } }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dev": true, - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/agent-base": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", - "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", - "dev": true, - "dependencies": { - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, "node_modules/ajv": { "version": "8.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", @@ -2301,39 +1825,11 @@ "node": ">=4" } }, - "node_modules/append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", - "dev": true - }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "dev": true - }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -2344,119 +1840,10 @@ "node": ">=12" } }, - "node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/axios/node_modules/form-data": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", - "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "dev": true, - "dependencies": { - "safe-buffer": "5.1.2" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/basic-auth/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/body-parser": { - "version": "1.20.3", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", - "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.13.0", - "raw-body": "2.5.2", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", "dev": true }, "node_modules/brace-expansion": { @@ -2479,39 +1866,6 @@ "node": ">=8" } }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "dev": true - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true - }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dev": true, - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/c8": { "version": "10.1.3", "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", @@ -2566,25 +1920,6 @@ "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/chai": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.2.tgz", @@ -2643,16 +1978,6 @@ "node": ">=12" } }, - "node_modules/color": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", - "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.3", - "color-string": "^1.6.0" - } - }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -2666,107 +1991,18 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, - "node_modules/color-string": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", - "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", - "dev": true, - "dependencies": { - "color-name": "^1.0.0", - "simple-swizzle": "^0.2.2" - } - }, - "node_modules/colorspace": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", - "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", - "dev": true, - "dependencies": { - "color": "^3.1.3", - "text-hex": "1.0.x" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dev": true, - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/convert-source-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", "dev": true }, - "node_modules/cookie": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", - "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", - "dev": true - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -2781,15 +2017,6 @@ "node": ">= 8" } }, - "node_modules/data-uri-to-buffer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", - "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -2817,191 +2044,17 @@ "node": ">=6" } }, - "node_modules/deep-equal": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-2.2.3.tgz", - "integrity": "sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==", - "dev": true, - "dependencies": { - "array-buffer-byte-length": "^1.0.0", - "call-bind": "^1.0.5", - "es-get-iterator": "^1.1.3", - "get-intrinsic": "^1.2.2", - "is-arguments": "^1.1.1", - "is-array-buffer": "^3.0.2", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.2", - "isarray": "^2.0.5", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "object.assign": "^4.1.4", - "regexp.prototype.flags": "^1.5.1", - "side-channel": "^1.0.4", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.1", - "which-typed-array": "^1.1.13" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "dev": true, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "dev": true }, - "node_modules/ecdsa-sig-formatter": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", - "dev": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "dev": true - }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, - "node_modules/enabled": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", - "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", - "dev": true - }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-get-iterator": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.3.tgz", - "integrity": "sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.1.3", - "has-symbols": "^1.0.3", - "is-arguments": "^1.1.1", - "is-map": "^2.0.2", - "is-set": "^2.0.2", - "is-string": "^1.0.7", - "isarray": "^2.0.5", - "stop-iteration-iterator": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/es-module-lexer": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", @@ -3056,12 +2109,6 @@ "node": ">=6" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "dev": true - }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -3080,24 +2127,6 @@ "@types/estree": "^1.0.0" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/events": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", - "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", - "dev": true, - "engines": { - "node": ">=0.8.x" - } - }, "node_modules/expect-type": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.1.0.tgz", @@ -3108,115 +2137,30 @@ "node": ">=12.0.0" } }, - "node_modules/express": { - "version": "4.21.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", - "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", - "dev": true, - "license": "MIT", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.3", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.7.1", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.3.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.12", - "proxy-addr": "~2.0.7", - "qs": "6.13.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.19.0", - "serve-static": "1.16.2", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" + "engines": { + "node": ">=8.6.0" } }, - "node_modules/express-promise-router": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/express-promise-router/-/express-promise-router-4.1.1.tgz", - "integrity": "sha512-Lkvcy/ZGrBhzkl3y7uYBHLMtLI4D6XQ2kiFg9dq7fbktBch5gjqJ0+KovX0cvCAvTJw92raWunRLM/OM+5l4fA==", - "dev": true, - "dependencies": { - "is-promise": "^4.0.0", - "lodash.flattendeep": "^4.0.0", - "methods": "^1.0.0" - }, - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "@types/express": "^4.0.0", - "express": "^4.0.0" - }, - "peerDependenciesMeta": { - "@types/express": { - "optional": true - } - } - }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/express/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dependencies": { "is-glob": "^4.0.1" }, @@ -3229,28 +2173,6 @@ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==" }, - "node_modules/fast-xml-parser": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" - } - ], - "dependencies": { - "strnum": "^1.0.5" - }, - "bin": { - "fxparser": "src/cli/cli.js" - } - }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -3259,35 +2181,6 @@ "reusify": "^1.0.4" } }, - "node_modules/fecha": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", - "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", - "dev": true - }, - "node_modules/fetch-blob": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", - "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "paypal", - "url": "https://paypal.me/jimmywarting" - } - ], - "dependencies": { - "node-domexception": "^1.0.0", - "web-streams-polyfill": "^3.0.3" - }, - "engines": { - "node": "^12.20 || >= 14.13" - } - }, "node_modules/fflate": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", @@ -3306,39 +2199,6 @@ "node": ">=8" } }, - "node_modules/finalhandler": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", - "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/finalhandler/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -3362,41 +2222,6 @@ "dev": true, "license": "ISC" }, - "node_modules/fn.name": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", - "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", - "dev": true - }, - "node_modules/follow-redirects": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", - "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, "node_modules/foreground-child": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.1.tgz", @@ -3413,50 +2238,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/form-data": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.2.tgz", - "integrity": "sha512-sJe+TQb2vIaIyO783qN6BlMYWMw3WBOHA1Ay2qxsnjuafEOQFJ2JakedOQirT6D5XPRxDvS7AHYyem9fTpb4LQ==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formdata-polyfill": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", - "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", - "dev": true, - "dependencies": { - "fetch-blob": "^3.1.2" - }, - "engines": { - "node": ">=12.20.0" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", @@ -3496,15 +2277,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", @@ -3513,25 +2285,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/glob": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.0.tgz", @@ -3575,32 +2328,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -3609,57 +2341,6 @@ "node": ">=4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/hasown": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", @@ -3678,60 +2359,6 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dev": true, - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-proxy-agent": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", - "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", - "dev": true, - "dependencies": { - "agent-base": "^7.1.0", - "debug": "^4.3.4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/https-proxy-agent": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", - "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", - "dev": true, - "dependencies": { - "agent-base": "^7.0.2", - "debug": "4" - }, - "engines": { - "node": ">= 14" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/ignore": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", @@ -3750,113 +2377,6 @@ "node": ">=8" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-arrayish": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", - "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", - "dev": true - }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", - "dev": true, - "dependencies": { - "has-bigints": "^1.0.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-core-module": { "version": "2.15.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", @@ -3872,36 +2392,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true, - "bin": { - "is-docker": "cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3929,18 +2419,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-map": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", - "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -3949,158 +2427,6 @@ "node": ">=0.12.0" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "dev": true - }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-set": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", - "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakmap": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", - "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-weakset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz", - "integrity": "sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", - "dev": true - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -4234,70 +2560,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/jsonwebtoken": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", - "integrity": "sha512-PRp66vJ865SSqOlgqS8hujT5U4AOgMfhrwYIuIhfKaoSCZcirrmASQr8CX7cUg+RMih+hgznrjp99o+W4pJLHQ==", - "dev": true, - "dependencies": { - "jws": "^3.2.2", - "lodash.includes": "^4.3.0", - "lodash.isboolean": "^3.0.3", - "lodash.isinteger": "^4.0.4", - "lodash.isnumber": "^3.0.3", - "lodash.isplainobject": "^4.0.6", - "lodash.isstring": "^4.0.1", - "lodash.once": "^4.0.0", - "ms": "^2.1.1", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=12", - "npm": ">=6" - } - }, - "node_modules/jsonwebtoken/node_modules/jwa": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", - "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", - "dev": true, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jsonwebtoken/node_modules/jws": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", - "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", - "dev": true, - "dependencies": { - "jwa": "^1.4.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jwa": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", - "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", - "dev": true, - "dependencies": { - "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.11", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/jws": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", - "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", - "dev": true, - "dependencies": { - "jwa": "^2.0.0", - "safe-buffer": "^5.0.1" - } - }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", @@ -4306,12 +2568,6 @@ "node": ">=6" } }, - "node_modules/kuler": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", - "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", - "dev": true - }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4327,75 +2583,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", - "dev": true - }, - "node_modules/lodash.includes": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", - "dev": true - }, - "node_modules/lodash.isboolean": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", - "dev": true - }, - "node_modules/lodash.isinteger": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", - "dev": true - }, - "node_modules/lodash.isnumber": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", - "dev": true - }, - "node_modules/lodash.isplainobject": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", - "dev": true - }, - "node_modules/lodash.isstring": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", - "dev": true - }, - "node_modules/lodash.once": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", - "dev": true - }, - "node_modules/logform": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", - "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", - "dev": true, - "dependencies": { - "@colors/colors": "1.6.0", - "@types/triple-beam": "^1.3.2", - "fecha": "^4.2.0", - "ms": "^2.1.1", - "safe-stable-stringify": "^2.3.1", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/loupe": { "version": "3.1.2", @@ -4450,24 +2641,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -4476,15 +2649,6 @@ "node": ">= 8" } }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -4497,39 +2661,6 @@ "node": ">=8.6" } }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "dev": true, - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.1.tgz", @@ -4545,15 +2676,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -4563,61 +2685,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "dependencies": { - "minimist": "^1.2.6" - }, - "bin": { - "mkdirp": "bin/cmd.js" - } - }, - "node_modules/morgan": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", - "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", - "dev": true, - "dependencies": { - "basic-auth": "~2.0.1", - "debug": "2.6.9", - "depd": "~2.0.0", - "on-finished": "~2.3.0", - "on-headers": "~1.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/morgan/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/morgan/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/morgan/node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/mrmime": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.0.tgz", @@ -4634,24 +2701,6 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", - "dev": true, - "dependencies": { - "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", - "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" - }, - "engines": { - "node": ">= 6.0.0" - } - }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", @@ -4679,163 +2728,6 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/node-domexception": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", - "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/jimmywarting" - }, - { - "type": "github", - "url": "https://paypal.me/jimmywarting" - } - ], - "engines": { - "node": ">=10.5.0" - } - }, - "node_modules/node-fetch": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", - "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", - "dev": true, - "dependencies": { - "data-uri-to-buffer": "^4.0.0", - "fetch-blob": "^3.1.4", - "formdata-polyfill": "^4.0.10" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/node-fetch" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", - "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dev": true, - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/one-time": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", - "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", - "dev": true, - "dependencies": { - "fn.name": "1.x.x" - } - }, - "node_modules/open": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "dev": true, - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4872,15 +2764,6 @@ "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", "dev": true }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -4921,13 +2804,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/path-to-regexp": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", - "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", - "dev": true, - "license": "MIT" - }, "node_modules/path-type": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", @@ -4983,15 +2859,6 @@ "node": ">=4" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/postcss": { "version": "8.4.49", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", @@ -5035,12 +2902,6 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true - }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -5065,25 +2926,6 @@ "node": ">=4.0.0" } }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dev": true, - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true - }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5094,21 +2936,6 @@ "node": ">=6" } }, - "node_modules/qs": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", - "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -5128,75 +2955,6 @@ } ] }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", - "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", - "dev": true, - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "node_modules/readable-stream/node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz", - "integrity": "sha512-vqlC04+RQoFalODCbCumG2xIOvapzVMHwsyIGM/SIE8fRhFFsXeH8/QQ+s0T0kDAhKc4k30s73/0ydkHQz6HlQ==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -5299,39 +3057,16 @@ "@rollup/rollup-linux-s390x-gnu": "4.28.1", "@rollup/rollup-linux-x64-gnu": "4.28.1", "@rollup/rollup-linux-x64-musl": "4.28.1", - "@rollup/rollup-win32-arm64-msvc": "4.28.1", - "@rollup/rollup-win32-ia32-msvc": "4.28.1", - "@rollup/rollup-win32-x64-msvc": "4.28.1", - "fsevents": "~2.3.2" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" + "@rollup/rollup-win32-arm64-msvc": "4.28.1", + "@rollup/rollup-win32-ia32-msvc": "4.28.1", + "@rollup/rollup-win32-x64-msvc": "4.28.1", + "fsevents": "~2.3.2" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "funding": [ { "type": "github", @@ -5345,29 +3080,11 @@ "type": "consulting", "url": "https://feross.org/support" } - ] - }, - "node_modules/safe-stable-stringify": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", - "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", - "dev": true, - "engines": { - "node": ">=10" + ], + "dependencies": { + "queue-microtask": "^1.2.2" } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, - "node_modules/sax": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", - "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", - "dev": true - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -5379,107 +3096,6 @@ "node": ">=10" } }, - "node_modules/send": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", - "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/send/node_modules/debug/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", - "dev": true - }, - "node_modules/send/node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/serve-static": { - "version": "1.16.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", - "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", - "dev": true, - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.19.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "dev": true - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -5501,24 +3117,6 @@ "node": ">=8" } }, - "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", @@ -5538,15 +3136,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/simple-swizzle": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", - "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", - "dev": true, - "dependencies": { - "is-arrayish": "^0.3.1" - } - }, "node_modules/sirv": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.0.tgz", @@ -5598,16 +3187,6 @@ "node": ">=0.10.0" } }, - "node_modules/source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, - "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" - } - }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -5615,15 +3194,6 @@ "dev": true, "license": "BSD-3-Clause" }, - "node_modules/stack-trace": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", - "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -5631,15 +3201,6 @@ "dev": true, "license": "MIT" }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", @@ -5647,52 +3208,6 @@ "dev": true, "license": "MIT" }, - "node_modules/stop-iteration-iterator": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz", - "integrity": "sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==", - "dev": true, - "dependencies": { - "internal-slot": "^1.0.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/stoppable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/stoppable/-/stoppable-1.1.0.tgz", - "integrity": "sha512-KXDYZ9dszj6bzvnEMRYvxgeTHU74QBFL54XKtP3nyMuJ81CFYtABZ3bAzL2EdFUaEwJOBOgENyFj3R7oTzDyyw==", - "dev": true, - "engines": { - "node": ">=4", - "npm": ">=6" - } - }, - "node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", - "dev": true, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "dependencies": { - "safe-buffer": "~5.1.0" - } - }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -5767,12 +3282,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/strnum": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", - "dev": true - }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -5895,12 +3404,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/text-hex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", - "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", - "dev": true - }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", @@ -5998,15 +3501,6 @@ "node": ">=8.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/totalist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", @@ -6017,40 +3511,6 @@ "node": ">=6" } }, - "node_modules/triple-beam": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", - "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", - "dev": true, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/tslib": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "dev": true - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dev": true, - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true - }, "node_modules/typescript": { "version": "5.7.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", @@ -6093,15 +3553,6 @@ "node": ">= 4.0.0" } }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -6112,30 +3563,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", @@ -6150,15 +3577,6 @@ "node": ">=10.12.0" } }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "dev": true, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/vite": { "version": "5.4.11", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", @@ -6346,15 +3764,6 @@ "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" }, - "node_modules/web-streams-polyfill": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", - "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -6370,59 +3779,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-collection": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", - "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", - "dev": true, - "dependencies": { - "is-map": "^2.0.3", - "is-set": "^2.0.3", - "is-weakmap": "^2.0.2", - "is-weakset": "^2.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -6440,70 +3796,6 @@ "node": ">=8" } }, - "node_modules/winston": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", - "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", - "dev": true, - "dependencies": { - "@colors/colors": "^1.6.0", - "@dabh/diagnostics": "^2.0.2", - "async": "^3.2.3", - "is-stream": "^2.0.0", - "logform": "^2.7.0", - "one-time": "^1.0.0", - "readable-stream": "^3.4.0", - "safe-stable-stringify": "^2.3.1", - "stack-trace": "0.0.x", - "triple-beam": "^1.3.0", - "winston-transport": "^4.9.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-transport": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", - "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", - "dev": true, - "dependencies": { - "logform": "^2.7.0", - "readable-stream": "^3.6.2", - "triple-beam": "^1.3.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, - "node_modules/winston-transport/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/winston/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -6601,58 +3893,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "node_modules/xml-formatter": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/xml-formatter/-/xml-formatter-3.6.3.tgz", - "integrity": "sha512-++x1TlRO1FRlQ82AZ4WnoCSufaI/PT/sycn4K8nRl4gnrNC1uYY2VV/67aALZ2m0Q4Q/BLj/L69K360Itw9NNg==", - "dev": true, - "dependencies": { - "xml-parser-xo": "^4.1.2" - }, - "engines": { - "node": ">= 16" - } - }, - "node_modules/xml-parser-xo": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/xml-parser-xo/-/xml-parser-xo-4.1.2.tgz", - "integrity": "sha512-Z/DRB0ZAKj5vAQg++XsfQQKfT73Vfj5n5lKIVXobBDQEva6NHWUTxOA6OohJmEcpoy8AEqBmSGkXXAnFwt5qAA==", - "dev": true, - "engines": { - "node": ">= 16" - } - }, - "node_modules/xml2js": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz", - "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==", - "dev": true, - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "dev": true, - "engines": { - "node": ">=0.4" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json index dafce26a16..b75e74490d 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -79,7 +79,6 @@ "c8": "~10.1.3", "rimraf": "~6.0.1", "typescript": "~5.7.2", - "vitest": "^2.1.8", - "@azure-tools/cadl-ranch": "0.16.1" + "vitest": "^2.1.8" } } From 6f6ee2a31d684cd4239a80e4abbe69a32ad8da7e Mon Sep 17 00:00:00 2001 From: Sarangan Rajamanickam Date: Fri, 13 Dec 2024 18:10:09 +0000 Subject: [PATCH 63/71] `typespec` repository - Upload Manifest file to the new storage account (#5336) In the `cadl-ranch` repository, during the publish process, the CI publishes the manifest file to the `azuresdkcadlranch` storage account. You can find the code [here](https://github.com/Azure/cadl-ranch/blob/main/.azure-pipelines/publish.yml#L35) With the new Spec Dashboard, the `typespec` repository CI has to publish the manifest file to the `typespec` storage account. I have tested this code in CI in my branch. You can find the link [here](https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4401569&view=logs&j=feeac6a1-95f5-5e4f-b973-2aeaa4cef844). Please review and approve the PR. Thanks --- eng/tsp-core/pipelines/publish.yml | 30 +++++++++++++++++++++++++++++ packages/spec-dashboard/src/apis.ts | 3 +++ 2 files changed, 33 insertions(+) diff --git a/eng/tsp-core/pipelines/publish.yml b/eng/tsp-core/pipelines/publish.yml index e70f764fb0..e31d1acca0 100644 --- a/eng/tsp-core/pipelines/publish.yml +++ b/eng/tsp-core/pipelines/publish.yml @@ -176,3 +176,33 @@ extends: displayName: "Build" - script: docker push $(imageName) --all-tags displayName: "Push" + + - stage: publish_manifest + displayName: Manifest + dependsOn: build + jobs: + - job: publish_manifest + displayName: Publish Manifest + pool: + name: $(WINDOWSPOOL) + image: $(WINDOWSVMIMAGE) + os: windows + variables: + TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build + steps: + - template: /eng/tsp-core/pipelines/templates/install.yml + - template: /eng/tsp-core/pipelines/templates/build.yml + + - script: pnpm run validate-scenarios --debug + displayName: Validate Scenarios + + - script: pnpm run validate-mock-apis --debug + displayName: Validate mock apis + + - task: AzureCLI@2 + displayName: Upload scenario manifest + inputs: + azureSubscription: "TypeSpec Storage" + scriptType: "bash" + scriptLocation: "inlineScript" + inlineScript: "pnpm upload-manifest" diff --git a/packages/spec-dashboard/src/apis.ts b/packages/spec-dashboard/src/apis.ts index 82ea1166ad..3e6090d3d7 100644 --- a/packages/spec-dashboard/src/apis.ts +++ b/packages/spec-dashboard/src/apis.ts @@ -70,6 +70,9 @@ export async function getCoverageSummaries(): Promise { (manifest: ScenarioManifest) => manifest.setName !== "@azure-tools/azure-http-specs", )[0]; for (const key in generatorReports["standard"]) { + if (!(generatorReports["standard"] as any)[key]) { + continue; + } (generatorReports["standard"] as any)[key] = { ...(generatorReports["standard"] as any)[key][0], generatorMetadata: (generatorReports["standard"] as any)[key]["generatorMetadata"], From 7ad5e779bcad446884e1a95fcecff5a22c5dc2c9 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Mon, 16 Dec 2024 15:44:26 +0800 Subject: [PATCH 64/71] [http-client-csharp] Bump typespec version to 0.63.0 (#5354) Fixes https://github.com/microsoft/typespec/issues/5347 --- .../emitter/src/lib/operation-converter.ts | 10 +- .../http-client-csharp/emitter/src/options.ts | 1 + packages/http-client-csharp/package-lock.json | 297 +++++++++++++----- packages/http-client-csharp/package.json | 36 +-- 4 files changed, 239 insertions(+), 105 deletions(-) diff --git a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts index ce895e80be..6a1b182add 100644 --- a/packages/http-client-csharp/emitter/src/lib/operation-converter.ts +++ b/packages/http-client-csharp/emitter/src/lib/operation-converter.ts @@ -150,6 +150,14 @@ function fromSdkOperationParameters( ): Map { const parameters = new Map(); for (const p of operation.parameters) { + if (p.kind === "cookie") { + Logger.getInstance().error( + `Cookie parameter is not supported: ${p.name}, found in operation ${operation.path}`, + ); + throw new Error( + `Cookie parameter is not supported: ${p.name}, found in operation ${operation.path}`, + ); + } const param = fromSdkHttpOperationParameter(p, rootApiVersions, sdkContext, typeMap); parameters.set(p, param); } @@ -329,7 +337,7 @@ function loadOperationPaging( }; } -// TODO: https://github.com/Azure/typespec-azure/issues/981 +// TODO: https://github.com/Azure/typespec-azure/issues/1441 function getParameterLocation( p: SdkPathParameter | SdkQueryParameter | SdkHeaderParameter | SdkBodyParameter | undefined, ): RequestLocation { diff --git a/packages/http-client-csharp/emitter/src/options.ts b/packages/http-client-csharp/emitter/src/options.ts index 5a1aff1f4c..1608802492 100644 --- a/packages/http-client-csharp/emitter/src/options.ts +++ b/packages/http-client-csharp/emitter/src/options.ts @@ -39,6 +39,7 @@ export const NetEmitterOptionsSchema: JSONSchemaType = { type: "object", additionalProperties: false, properties: { + "emitter-name": { type: "string", nullable: true }, "examples-directory": { type: "string", nullable: true }, "examples-dir": { type: "string", nullable: true }, "api-version": { type: "string", nullable: true }, diff --git a/packages/http-client-csharp/package-lock.json b/packages/http-client-csharp/package-lock.json index 234f218d55..4ea23af56c 100644 --- a/packages/http-client-csharp/package-lock.json +++ b/packages/http-client-csharp/package-lock.json @@ -13,19 +13,19 @@ }, "devDependencies": { "@azure-tools/cadl-ranch": "0.16.1", - "@azure-tools/cadl-ranch-specs": "0.39.3", - "@azure-tools/typespec-azure-core": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.6", + "@azure-tools/cadl-ranch-specs": "0.39.6", + "@azure-tools/typespec-azure-core": "0.49.0", + "@azure-tools/typespec-client-generator-core": "0.49.0", "@microsoft/api-extractor": "^7.47.11", "@types/node": "~22.7.5", - "@typespec/compiler": "0.62.0", - "@typespec/http": "0.62.0", - "@typespec/json-schema": "0.62.0", - "@typespec/library-linter": "0.62.0", - "@typespec/openapi": "0.62.0", - "@typespec/rest": "0.62.0", - "@typespec/versioning": "0.62.0", - "@typespec/xml": "^0.62.0", + "@typespec/compiler": "0.63.0", + "@typespec/http": "0.63.0", + "@typespec/json-schema": "0.63.0", + "@typespec/library-linter": "0.63.0", + "@typespec/openapi": "0.63.0", + "@typespec/rest": "0.63.0", + "@typespec/versioning": "0.63.0", + "@typespec/xml": "^0.63.0", "@vitest/coverage-v8": "^2.1.2", "@vitest/ui": "^2.1.2", "c8": "^10.1.2", @@ -34,13 +34,13 @@ "vitest": "^2.1.2" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0 || ~0.49.0-0", - "@azure-tools/typespec-client-generator-core": ">=0.48.1 <1.0.0 || ~0.49.0-0", - "@typespec/compiler": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/http": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/openapi": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/rest": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/versioning": ">=0.62.0 <1.0.0 || ~0.63.0-0" + "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", + "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", + "@typespec/compiler": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/http": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/openapi": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/rest": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/versioning": ">=0.63.0 <1.0.0 || ~0.64.0-0" } }, "../http-client-csharp-generator/artifacts/bin/Microsoft.Generator.CSharp.ClientModel/Debug/net8.0": { @@ -143,41 +143,165 @@ } }, "node_modules/@azure-tools/cadl-ranch-expect": { - "version": "0.15.6", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.6.tgz", - "integrity": "sha512-t601oyRwiSy/Nbbro5A7OHZSKsVGxGRJMPnd4X80dYetTBinUHXS2+cVx+fVQlUmb/4Ru/qNOvG0jtTJY9/XHw==", + "version": "0.15.7", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-expect/-/cadl-ranch-expect-0.15.7.tgz", + "integrity": "sha512-3f6PLUn4vVyiKOTnqdxppHhpQ3chb2D6ZMI7w65Xf5DYByyqC/rnMU25AjUu1jiIKwwANDtd6UDX6pWQrj87vQ==", "dev": true, "license": "MIT", "engines": { "node": ">=16.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0" } }, "node_modules/@azure-tools/cadl-ranch-specs": { - "version": "0.39.3", - "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-specs/-/cadl-ranch-specs-0.39.3.tgz", - "integrity": "sha512-k7sAHQkrRD9kusuQpw/A4hjt2wGJYcvwW7hdC7ioNB1lJ8Q17vWfOyn5TnKREosXsvu8hhspXYRtQJZdSzuwbQ==", + "version": "0.39.6", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch-specs/-/cadl-ranch-specs-0.39.6.tgz", + "integrity": "sha512-oa8CDSVZhpO8xwjxLjgAa8ppyBel/QCCw9DjAd6sdj/VumJq+Bzcj9wKly0Vy4RFqdPSxPMdCcjlED63Xb1+YQ==", "dev": true, + "license": "MIT", "dependencies": { - "@azure-tools/cadl-ranch": "~0.16.1", + "@azure-tools/cadl-ranch": "~0.16.2", "@azure-tools/cadl-ranch-api": "~0.5.0" }, "engines": { "node": ">=16.0.0" }, "peerDependencies": { - "@azure-tools/cadl-ranch-expect": "~0.15.6", - "@azure-tools/typespec-azure-core": "~0.48.0", + "@azure-tools/cadl-ranch-expect": "~0.15.7", + "@azure-tools/typespec-azure-core": "~0.49.0", + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0", + "@typespec/xml": "~0.63.0" + } + }, + "node_modules/@azure-tools/cadl-ranch-specs/node_modules/@azure-tools/cadl-ranch": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@azure-tools/cadl-ranch/-/cadl-ranch-0.16.2.tgz", + "integrity": "sha512-1FtmiOp89qo3Jj2Gq6hTq23paolHocxNoBIugZPcEPY0ZNwOe+Ea24D0v0e3gd6RbomRKfKbmr3UVodN/xWLQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@azure-tools/cadl-ranch-api": "~0.5.0", + "@azure-tools/cadl-ranch-coverage-sdk": "~0.9.0", + "@azure-tools/cadl-ranch-expect": "~0.15.7", + "@azure/identity": "^4.4.1", + "@types/js-yaml": "^4.0.5", + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0", + "ajv": "8.17.1", + "axios": "^1.7.5", + "body-parser": "^1.20.3", + "deep-equal": "^2.2.0", + "express": "^4.20.0", + "express-promise-router": "^4.1.1", + "form-data": "^3.0.1", + "glob": "^11.0.0", + "jackspeak": "4.0.1", + "js-yaml": "^4.1.0", + "morgan": "^1.10.0", + "multer": "^1.4.5-lts.1", + "node-fetch": "^3.3.1", + "picocolors": "^1.0.0", + "source-map-support": "^0.5.21", + "winston": "^3.14.0", + "xml2js": "^0.6.2", + "yargs": "^17.7.1" + }, + "bin": { + "cadl-ranch": "cmd/cli.mjs" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/@azure-tools/cadl-ranch-specs/node_modules/jackspeak": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.0.1.tgz", + "integrity": "sha512-cub8rahkh0Q/bw1+GxP7aeSe29hHHn2V4m29nnDlvCdlgU+3UGxkZp7Z53jLUdpX3jdTO0nJZUDl3xvbWc2Xog==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/compiler": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz", + "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "~7.25.7", + "ajv": "~8.17.1", + "change-case": "~5.4.4", + "globby": "~14.0.2", + "mustache": "~4.2.0", + "picocolors": "~1.1.0", + "prettier": "~3.3.3", + "prompts": "~2.4.2", + "semver": "^7.6.3", + "temporal-polyfill": "^0.2.5", + "vscode-languageserver": "~9.0.1", + "vscode-languageserver-textdocument": "~1.0.12", + "yaml": "~2.5.1", + "yargs": "~17.7.2" + }, + "bin": { + "tsp": "cmd/tsp.js", + "tsp-server": "cmd/tsp-server.js" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/http": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz", + "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0", - "@typespec/xml": "~0.62.0" + "@typespec/streams": "~0.62.0" + }, + "peerDependenciesMeta": { + "@typespec/streams": { + "optional": true + } + } + }, + "node_modules/@azure-tools/cadl-ranch/node_modules/@typespec/rest": { + "version": "0.62.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz", + "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@typespec/compiler": "~0.62.0", + "@typespec/http": "~0.62.0" } }, "node_modules/@azure-tools/cadl-ranch/node_modules/jackspeak": { @@ -200,40 +324,41 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.48.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.48.0.tgz", - "integrity": "sha512-80qyqgTgBbrnCGXtz6eWAMBdEAjYVVL780L0Ye+rBEd6VoA0m3JrgzUqf5bC0Iwju6lEtBAb8o6sefKD/NGA7g==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.49.0.tgz", + "integrity": "sha512-hNKy+aePmPkB1brHQkO1tsJXqXPzt/9ehy10dv0rKdp9xq5dE3yBctHF5Aj3Nr8kr8GRG5z4KYpYPbV5guoT5w==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0" } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.6", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.6.tgz", - "integrity": "sha512-SVD4JCON52UIs4AogxQs8OrXjFdEf9EJPuK76Ze33VhtYdNNXPLJir2uV1wNJAnNtH2i3IMBkfrq2RjV1HHpdA==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.49.0.tgz", + "integrity": "sha512-inFLRIeTU0mQg4PT19O3YwT/4YODLuTgIsXuhKDdG/sEsx8PG8AEFTabtnZJ0w3Lc4xuxKFJrzZ2ZH2iiAAbig==", "dev": true, "license": "MIT", "dependencies": { "change-case": "~5.4.4", - "pluralize": "^8.0.0" + "pluralize": "^8.0.0", + "yaml": "~2.5.1" }, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.48.0", - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/openapi": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0" + "@azure-tools/typespec-azure-core": "~0.49.0", + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/openapi": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0" } }, "node_modules/@azure/abort-controller": { @@ -1755,9 +1880,9 @@ "license": "MIT" }, "node_modules/@typespec/compiler": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz", - "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz", + "integrity": "sha512-cC3YniwbFghn1fASX3r1IgNjMrwaY4gmzznkHT4f/NxE+HK4XoXWn4EG7287QgVMCaHUykzJCIfW9k7kIleW5A==", "dev": true, "license": "MIT", "dependencies": { @@ -1766,7 +1891,7 @@ "change-case": "~5.4.4", "globby": "~14.0.2", "mustache": "~4.2.0", - "picocolors": "~1.1.0", + "picocolors": "~1.1.1", "prettier": "~3.3.3", "prompts": "~2.4.2", "semver": "^7.6.3", @@ -1785,17 +1910,17 @@ } }, "node_modules/@typespec/http": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz", - "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.63.0.tgz", + "integrity": "sha512-SYVbBmLPAPdWZfdMs0QlbpTnFREDnkINu2FR+0kRX12qzbRgpRbLsdhg59qx4TfKoh4IAPgSV+Fq84w7BWGsyQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/streams": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/streams": "~0.63.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -1804,9 +1929,9 @@ } }, "node_modules/@typespec/json-schema": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-0.62.0.tgz", - "integrity": "sha512-8wM+ENB8NY9y4mhevk6XImYqzgiZdQFlq9fMwsoJGT7jsNA4MYAHsDrVH2jWfOnR1EssCHNV5bu1DttfXpaZvg==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/json-schema/-/json-schema-0.63.0.tgz", + "integrity": "sha512-jGRXxUxdrwW/XzvaDqyt5mS/V1iBnrDaHUMRIkrFLCwzgll/NenquLI/nopihzLFXK78MfFYuHg4DEPYY5PdFw==", "dev": true, "license": "MIT", "dependencies": { @@ -1816,74 +1941,74 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@typespec/library-linter": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.62.0.tgz", - "integrity": "sha512-Y7YyE11eZ2OgvTuDu5qS2K+VwF/b2y9RMPe6/thVtoLHI9Az76UrICpeXUbBH3NbDeYQ8yeV83tFT5DpsvGFog==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/library-linter/-/library-linter-0.63.0.tgz", + "integrity": "sha512-j4zIhe1duQtNk43C8ex8w9LX3N/KnnILQDnwcKu1A8P3US+QUBcl/XJiiOFf7Cq7HnECAmnpYsfABFavkHeDGg==", "dev": true, "license": "MIT", "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@typespec/openapi": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.62.0.tgz", - "integrity": "sha512-Xtm0Nd2BuSmEfSWGtc10ok22jyomYm9L2jY+kVTy+v5J89DrVh0o6+YpipUl1QhcItM1YMBphWHIHPfwkDRbnw==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.63.0.tgz", + "integrity": "sha512-/KzR60mj3P/LnNWd/QfH0KTN/If4+mjrsWNSB7/uab6c8Qu/lNsGlZDkmWq4EFiwBR7VmpdFz9FP7d/m3O+tGw==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0" } }, "node_modules/@typespec/rest": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz", - "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.63.0.tgz", + "integrity": "sha512-HftzMjSDHAYX+ILE9C6pFS4oAq7oBHMCtpA8QgSFPDF4V5a8l1k2K8c4x1B+7yl+GkREmIdtpc6S0xZm2G7hXg==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0" } }, "node_modules/@typespec/versioning": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz", - "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.63.0.tgz", + "integrity": "sha512-BPvmPL+g20yEmSA8XRfbIHdToNOjssq4QfwOU6D7kKLLXnZHFb1hmuwW0tf0Wa/lYgoaUC60ONAeoXgNT1ZOIQ==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@typespec/xml": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.62.0.tgz", - "integrity": "sha512-DexGTQHB75fncDcYfs5CIbNwO6NOhjwCaaNoHYAsVVzs4T8qwzw6WQdEEMzZRbgsxwnllFkxKwGhLtRMQdv/cQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.63.0.tgz", + "integrity": "sha512-2aQxWWqc5f4OTmC2nNafHi+ppr8GqwwMXx/2DnNjeshZF/JD0FNCYH8gV4gFZe7mfRfB9bAxNkcKj2AF01ntqA==", "dev": true, "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@vitest/coverage-v8": { diff --git a/packages/http-client-csharp/package.json b/packages/http-client-csharp/package.json index 36d968db1c..0a2855cd7c 100644 --- a/packages/http-client-csharp/package.json +++ b/packages/http-client-csharp/package.json @@ -46,29 +46,29 @@ "json-serialize-refs": "0.1.0-0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0 || ~0.49.0-0", - "@azure-tools/typespec-client-generator-core": ">=0.48.1 <1.0.0 || ~0.49.0-0", - "@typespec/compiler": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/http": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/openapi": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/rest": ">=0.62.0 <1.0.0 || ~0.63.0-0", - "@typespec/versioning": ">=0.62.0 <1.0.0 || ~0.63.0-0" + "@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", + "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0 || ~0.50.0-0", + "@typespec/compiler": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/http": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/openapi": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/rest": ">=0.63.0 <1.0.0 || ~0.64.0-0", + "@typespec/versioning": ">=0.63.0 <1.0.0 || ~0.64.0-0" }, "devDependencies": { "@azure-tools/cadl-ranch": "0.16.1", - "@azure-tools/cadl-ranch-specs": "0.39.3", - "@azure-tools/typespec-azure-core": "0.48.0", - "@azure-tools/typespec-client-generator-core": "0.48.6", + "@azure-tools/cadl-ranch-specs": "0.39.6", + "@azure-tools/typespec-azure-core": "0.49.0", + "@azure-tools/typespec-client-generator-core": "0.49.0", "@microsoft/api-extractor": "^7.47.11", "@types/node": "~22.7.5", - "@typespec/compiler": "0.62.0", - "@typespec/http": "0.62.0", - "@typespec/json-schema": "0.62.0", - "@typespec/library-linter": "0.62.0", - "@typespec/openapi": "0.62.0", - "@typespec/rest": "0.62.0", - "@typespec/versioning": "0.62.0", - "@typespec/xml": "^0.62.0", + "@typespec/compiler": "0.63.0", + "@typespec/http": "0.63.0", + "@typespec/json-schema": "0.63.0", + "@typespec/library-linter": "0.63.0", + "@typespec/openapi": "0.63.0", + "@typespec/rest": "0.63.0", + "@typespec/versioning": "0.63.0", + "@typespec/xml": "^0.63.0", "@vitest/coverage-v8": "^2.1.2", "@vitest/ui": "^2.1.2", "c8": "^10.1.2", From 9bc1675cc5013be49b3af4b0f1c441d95e011541 Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Mon, 16 Dec 2024 16:32:29 +0800 Subject: [PATCH 65/71] Adopt http/special-headers/conditional-request from cadl ranch (#5318) Fixes https://github.com/microsoft/typespec/issues/3990 cherry picked from @nisha-bhatia 's [PR](https://github.com/microsoft/typespec/pull/5214) for clarity. But this requires the update in that PR to work properly. --------- Co-authored-by: nisha-bhatia <67986960+nisha-bhatia@users.noreply.github.com> --- .../eng/scripts/Generate.ps1 | 1 - .../src/Properties/launchSettings.json | 5 + .../ConditionalRequestHeaderTests.cs | 46 +++ .../conditional-request/Configuration.json | 6 + .../SpecialHeaders.ConditionalRequest.sln | 48 +++ .../src/Generated/ConditionalRequestClient.cs | 53 ++++ .../ConditionalRequestClientOptions.cs | 12 + .../SpecialHeaders.ConditionalRequest.csproj | 16 + .../conditional-request/tspCodeModel.json | 273 ++++++++++++++++++ 9 files changed, 459 insertions(+), 1 deletion(-) create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/SpecialHeaders/ConditionalRequests/ConditionalRequestHeaderTests.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/Configuration.json create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj create mode 100644 packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/tspCodeModel.json diff --git a/packages/http-client-csharp/eng/scripts/Generate.ps1 b/packages/http-client-csharp/eng/scripts/Generate.ps1 index 09eb3be3db..bf1f9567a9 100644 --- a/packages/http-client-csharp/eng/scripts/Generate.ps1 +++ b/packages/http-client-csharp/eng/scripts/Generate.ps1 @@ -51,7 +51,6 @@ function IsSpecDir { $failingSpecs = @( Join-Path 'http' 'payload' 'pageable' Join-Path 'http' 'payload' 'xml' - Join-Path 'http' 'special-headers' 'conditional-request' Join-Path 'http' 'type' 'model' 'flatten' Join-Path 'http' 'type' 'model' 'templated' ) diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json index 7e1721b39f..7893edf6b4 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp/src/Properties/launchSettings.json @@ -160,6 +160,11 @@ "commandName": "Executable", "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" }, + "http-special-headers-conditional-request": { + "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/special-headers/conditional-request -p StubLibraryPlugin", + "commandName": "Executable", + "executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe" + }, "http-special-headers-repeatability": { "commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/special-headers/repeatability -p StubLibraryPlugin", "commandName": "Executable", diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/SpecialHeaders/ConditionalRequests/ConditionalRequestHeaderTests.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/SpecialHeaders/ConditionalRequests/ConditionalRequestHeaderTests.cs new file mode 100644 index 0000000000..4fa6365319 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/SpecialHeaders/ConditionalRequests/ConditionalRequestHeaderTests.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Threading.Tasks; +using NUnit.Framework; +using SpecialHeaders.ConditionalRequest; +using TestProjects.CadlRanch.Tests; + +namespace CadlRanchProjects.Tests.Http.SpecialHeaders.ConditionalRequests +{ + public class ConditionalRequestHeaderTests : CadlRanchTestBase + { + [CadlRanchTest] + public Task Special_Headers_Conditional_Request_PostIfMatch() => Test(async (host) => + { + string ifMatch = new string("valid"); + var response = await new ConditionalRequestClient(host, null).PostIfMatchAsync(ifMatch); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task Special_Headers_Conditional_Request_PostIfNoneMatch() => Test(async (host) => + { + string ifNoneMatch = new string("invalid"); + var response = await new ConditionalRequestClient(host, null).PostIfNoneMatchAsync(ifNoneMatch); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task Special_Headers_Conditional_Request_HeadIfModifiedSince() => Test(async (host) => + { + DateTimeOffset ifModifiedSince = DateTimeOffset.Parse("Fri, 26 Aug 2022 14:38:00 GMT"); + var response = await new ConditionalRequestClient(host, null).HeadIfModifiedSinceAsync(ifModifiedSince); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + + [CadlRanchTest] + public Task Special_Headers_Conditional_Request_PostIfUnmodifiedSince() => Test(async (host) => + { + DateTimeOffset ifUnmodifiedSince = DateTimeOffset.Parse("Fri, 26 Aug 2022 14:38:00 GMT"); + var response = await new ConditionalRequestClient(host, null).HeadIfModifiedSinceAsync(ifUnmodifiedSince); + Assert.AreEqual(204, response.GetRawResponse().Status); + }); + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/Configuration.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/Configuration.json new file mode 100644 index 0000000000..54ff8e4fd6 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/Configuration.json @@ -0,0 +1,6 @@ +{ + "output-folder": ".", + "namespace": "SpecialHeaders.ConditionalRequest", + "library-name": "SpecialHeaders.ConditionalRequest", + "use-model-reader-writer": true +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln new file mode 100644 index 0000000000..df8870de15 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/SpecialHeaders.ConditionalRequest.sln @@ -0,0 +1,48 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpecialHeaders.ConditionalRequest", "src\SpecialHeaders.ConditionalRequest.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs new file mode 100644 index 0000000000..579b7f5d14 --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClient.cs @@ -0,0 +1,53 @@ +// + +#nullable disable + +using System; +using System.ClientModel; +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; + +namespace SpecialHeaders.ConditionalRequest +{ + public partial class ConditionalRequestClient + { + public ConditionalRequestClient() : this(new Uri("http://localhost:3000"), new ConditionalRequestClientOptions()) => throw null; + + public ConditionalRequestClient(Uri endpoint, ConditionalRequestClientOptions options) => throw null; + + public ClientPipeline Pipeline => throw null; + + public virtual ClientResult PostIfMatch(string ifMatch, RequestOptions options) => throw null; + + public virtual Task PostIfMatchAsync(string ifMatch, RequestOptions options) => throw null; + + public virtual ClientResult PostIfMatch(string ifMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfMatchAsync(string ifMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult PostIfNoneMatch(string ifNoneMatch, RequestOptions options) => throw null; + + public virtual Task PostIfNoneMatchAsync(string ifNoneMatch, RequestOptions options) => throw null; + + public virtual ClientResult PostIfNoneMatch(string ifNoneMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfNoneMatchAsync(string ifNoneMatch = null, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult HeadIfModifiedSince(DateTimeOffset? ifModifiedSince, RequestOptions options) => throw null; + + public virtual Task HeadIfModifiedSinceAsync(DateTimeOffset? ifModifiedSince, RequestOptions options) => throw null; + + public virtual ClientResult HeadIfModifiedSince(DateTimeOffset? ifModifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task HeadIfModifiedSinceAsync(DateTimeOffset? ifModifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual ClientResult PostIfUnmodifiedSince(DateTimeOffset? ifUnmodifiedSince, RequestOptions options) => throw null; + + public virtual Task PostIfUnmodifiedSinceAsync(DateTimeOffset? ifUnmodifiedSince, RequestOptions options) => throw null; + + public virtual ClientResult PostIfUnmodifiedSince(DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) => throw null; + + public virtual Task PostIfUnmodifiedSinceAsync(DateTimeOffset? ifUnmodifiedSince = null, CancellationToken cancellationToken = default) => throw null; + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs new file mode 100644 index 0000000000..924fd0111b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/Generated/ConditionalRequestClientOptions.cs @@ -0,0 +1,12 @@ +// + +#nullable disable + +using System.ClientModel.Primitives; + +namespace SpecialHeaders.ConditionalRequest +{ + public partial class ConditionalRequestClientOptions : ClientPipelineOptions + { + } +} diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj new file mode 100644 index 0000000000..d130eaa44b --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/src/SpecialHeaders.ConditionalRequest.csproj @@ -0,0 +1,16 @@ + + + This is the SpecialHeaders.ConditionalRequest client library for developing .NET applications with rich experience. + SDK Code Generation SpecialHeaders.ConditionalRequest + 1.0.0-beta.1 + SpecialHeaders.ConditionalRequest + netstandard2.0 + latest + true + + + + + + + diff --git a/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/tspCodeModel.json b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/tspCodeModel.json new file mode 100644 index 0000000000..1ee0e40c9e --- /dev/null +++ b/packages/http-client-csharp/generator/TestProjects/CadlRanch/http/special-headers/conditional-request/tspCodeModel.json @@ -0,0 +1,273 @@ +{ + "$id": "1", + "Name": "SpecialHeaders.ConditionalRequest", + "ApiVersions": [], + "Enums": [], + "Models": [], + "Clients": [ + { + "$id": "2", + "Name": "ConditionalRequestClient", + "Description": "Illustrates conditional request headers", + "Operations": [ + { + "$id": "3", + "Name": "postIfMatch", + "ResourceName": "ConditionalRequest", + "Description": "Check when only If-Match in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "4", + "Name": "ifMatch", + "NameInRequest": "If-Match", + "Description": "The request should only proceed if an entity matches this string.", + "Type": { + "$id": "5", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "6", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-match", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfMatch", + "Decorators": [] + }, + { + "$id": "7", + "Name": "postIfNoneMatch", + "ResourceName": "ConditionalRequest", + "Description": "Check when only If-None-Match in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "8", + "Name": "ifNoneMatch", + "NameInRequest": "If-None-Match", + "Description": "The request should only proceed if no entity matches this string.", + "Type": { + "$id": "9", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "10", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-none-match", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfNoneMatch", + "Decorators": [] + }, + { + "$id": "11", + "Name": "headIfModifiedSince", + "ResourceName": "ConditionalRequest", + "Description": "Check when only If-Modified-Since in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "12", + "Name": "ifModifiedSince", + "NameInRequest": "If-Modified-Since", + "Description": "A timestamp indicating the last modified time of the resource known to the\nclient. The operation will be performed only if the resource on the service has\nbeen modified since the specified time.", + "Type": { + "$id": "13", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "14", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "15", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "HEAD", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-modified-since", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.headIfModifiedSince", + "Decorators": [] + }, + { + "$id": "16", + "Name": "postIfUnmodifiedSince", + "ResourceName": "ConditionalRequest", + "Description": "Check when only If-Unmodified-Since in header is defined.", + "Accessibility": "public", + "Parameters": [ + { + "$id": "17", + "Name": "ifUnmodifiedSince", + "NameInRequest": "If-Unmodified-Since", + "Description": "A timestamp indicating the last modified time of the resource known to the\nclient. The operation will be performed only if the resource on the service has\nnot been modified since the specified time.", + "Type": { + "$id": "18", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc7231", + "wireType": { + "$id": "19", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "Location": "Header", + "IsApiVersion": false, + "IsContentType": false, + "IsEndpoint": false, + "Explode": false, + "IsRequired": false, + "Kind": "Method", + "Decorators": [], + "SkipUrlEncoding": false + } + ], + "Responses": [ + { + "$id": "20", + "StatusCodes": [ + 204 + ], + "BodyMediaType": "Json", + "Headers": [], + "IsErrorResponse": false + } + ], + "HttpMethod": "POST", + "RequestBodyMediaType": "None", + "Uri": "{endpoint}", + "Path": "/special-headers/conditional-request/if-unmodified-since", + "BufferResponse": true, + "GenerateProtocolMethod": true, + "GenerateConvenienceMethod": true, + "CrossLanguageDefinitionId": "SpecialHeaders.ConditionalRequest.postIfUnmodifiedSince", + "Decorators": [] + } + ], + "Protocol": { + "$id": "21" + }, + "Parameters": [ + { + "$id": "22", + "Name": "endpoint", + "NameInRequest": "endpoint", + "Description": "Service host", + "Type": { + "$id": "23", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "Location": "Uri", + "IsApiVersion": false, + "IsResourceParameter": false, + "IsContentType": false, + "IsRequired": true, + "IsEndpoint": true, + "SkipUrlEncoding": false, + "Explode": false, + "Kind": "Client", + "DefaultValue": { + "$id": "24", + "Type": { + "$id": "25", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "Value": "http://localhost:3000" + } + } + ], + "Decorators": [] + } + ] +} From 3bd6a8758cb12b0f182c03d70f2c39781a0d84af Mon Sep 17 00:00:00 2001 From: Dapeng Zhang Date: Mon, 16 Dec 2024 16:43:00 +0800 Subject: [PATCH 66/71] introduce the abstraction for tokencredential type and keycredential type (#5231) Fixes https://github.com/microsoft/typespec/issues/5235 Fixes https://github.com/microsoft/typespec/issues/4410 The ClientProviderTests class contains both general client provider features (such as service operations, query parameters, api-versions) and auth specific features. My PR is trying to separate them - therefore some test cases are moved to a new class. --- .../src/Primitives/ScmKnownParameters.cs | 2 - .../Abstractions/ClientPipelineApi.cs | 5 +- .../Abstractions/IClientPipelineApi.cs | 3 + .../src/Providers/ClientPipelineProvider.cs | 22 +- .../src/Providers/ClientProvider.cs | 242 ++++-- .../src/Providers/RestClientProvider.cs | 4 +- .../src/ScmTypeFactory.cs | 9 - .../OutputTypes/ScmKnownParametersTests.cs | 10 - .../Abstractions/ClientPipelineApiTests.cs | 11 +- .../ClientProviders/ClientProviderTests.cs | 705 ++++++++++++++---- ...yConstructor(WithDefault,False,False,0).cs | 6 + ...ryConstructor(WithDefault,False,True,0).cs | 8 + ...ryConstructor(WithDefault,True,False,0).cs | 8 + ...aryConstructor(WithDefault,True,True,0).cs | 8 + ...aryConstructor(WithDefault,True,True,1).cs | 8 + ...Constructor(WithRequired,False,False,0).cs | 6 + ...yConstructor(WithRequired,False,True,0).cs | 8 + ...yConstructor(WithRequired,True,False,0).cs | 8 + ...ryConstructor(WithRequired,True,True,0).cs | 8 + ...ryConstructor(WithRequired,True,True,1).cs | 8 + .../test/TestHelpers/MockHelpers.cs | 9 +- .../src/Generated/UnbrandedTypeSpecClient.cs | 2 +- 22 files changed, 819 insertions(+), 281 deletions(-) create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs create mode 100644 packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Primitives/ScmKnownParameters.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Primitives/ScmKnownParameters.cs index fe2737a59a..00fa78fc93 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Primitives/ScmKnownParameters.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Primitives/ScmKnownParameters.cs @@ -30,8 +30,6 @@ internal static class ScmKnownParameters public static readonly ParameterProvider Data = new("data", FormattableStringHelpers.Empty, typeof(BinaryData)); public static ParameterProvider ClientOptions(CSharpType clientOptionsType) => new("options", $"The options for configuring the client.", clientOptionsType.WithNullable(true), initializationValue: New.Instance(clientOptionsType.WithNullable(true))); - public static readonly ParameterProvider KeyAuth = new("keyCredential", $"The token credential to copy", ClientModelPlugin.Instance.TypeFactory.KeyCredentialType); - public static readonly ParameterProvider MatchConditionsParameter = new("matchConditions", $"The content to send as the request conditions of the request.", ClientModelPlugin.Instance.TypeFactory.MatchConditionsType, DefaultOf(ClientModelPlugin.Instance.TypeFactory.MatchConditionsType)); public static readonly ParameterProvider OptionalRequestOptions = new( ClientModelPlugin.Instance.TypeFactory.HttpRequestOptionsApi.ParameterName, $"The request options, which can override default behaviors of the client pipeline on a per-call basis.", diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientPipelineApi.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientPipelineApi.cs index 627f5c90d5..a9928848d3 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientPipelineApi.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/ClientPipelineApi.cs @@ -14,6 +14,8 @@ public abstract record ClientPipelineApi : ScopedApi, IClientPipelineApi public abstract CSharpType ClientPipelineType { get; } public abstract CSharpType ClientPipelineOptionsType { get; } public abstract CSharpType PipelinePolicyType { get; } + public abstract CSharpType? KeyCredentialType { get; } + public abstract CSharpType? TokenCredentialType { get; } protected ClientPipelineApi(Type type, ValueExpression original) : base(type, original) { @@ -26,7 +28,8 @@ protected ClientPipelineApi(Type type, ValueExpression original) : base(type, or public abstract ValueExpression Create(ValueExpression options, ValueExpression perRetryPolicies); - public abstract ValueExpression AuthorizationPolicy(params ValueExpression[] arguments); + public abstract ValueExpression KeyAuthorizationPolicy(ValueExpression credential, ValueExpression headerName, ValueExpression? keyPrefix = null); + public abstract ValueExpression TokenAuthorizationPolicy(ValueExpression credential, ValueExpression scopes); public abstract ClientPipelineApi FromExpression(ValueExpression expression); public abstract ClientPipelineApi ToExpression(); } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs index 85f51aa1ee..dca1ebc635 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/Abstractions/IClientPipelineApi.cs @@ -10,5 +10,8 @@ public interface IClientPipelineApi : IExpressionApi CSharpType ClientPipelineType { get; } CSharpType ClientPipelineOptionsType { get; } CSharpType PipelinePolicyType { get; } + + CSharpType? KeyCredentialType { get; } + CSharpType? TokenCredentialType { get; } } } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientPipelineProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientPipelineProvider.cs index 283861da85..5cf9279ea5 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientPipelineProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientPipelineProvider.cs @@ -1,11 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using System.ClientModel; using System.ClientModel.Primitives; using Microsoft.Generator.CSharp.Expressions; using Microsoft.Generator.CSharp.Primitives; -using Microsoft.Generator.CSharp.Statements; using Microsoft.Generator.CSharp.Snippets; +using Microsoft.Generator.CSharp.Statements; using static Microsoft.Generator.CSharp.Snippets.Snippet; namespace Microsoft.Generator.CSharp.ClientModel.Providers @@ -25,6 +27,10 @@ public ClientPipelineProvider(ValueExpression original) : base(typeof(ClientPipe public override CSharpType PipelinePolicyType => typeof(PipelinePolicy); + public override CSharpType KeyCredentialType => typeof(ApiKeyCredential); + + public override CSharpType? TokenCredentialType => null; // Scm library does not support token credentials yet. + public override ValueExpression Create(ValueExpression options, ValueExpression perRetryPolicies) => Static().Invoke(nameof(ClientPipeline.Create), [options, New.Array(ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType), perRetryPolicies, New.Array(ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType)]).As(); @@ -34,8 +40,18 @@ public override ValueExpression CreateMessage(HttpRequestOptionsApi requestOptio public override ClientPipelineApi FromExpression(ValueExpression expression) => new ClientPipelineProvider(expression); - public override ValueExpression AuthorizationPolicy(params ValueExpression[] arguments) - => Static().Invoke(nameof(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy), arguments).As(); + public override ValueExpression KeyAuthorizationPolicy(ValueExpression credential, ValueExpression headerName, ValueExpression? keyPrefix = null) + { + ValueExpression[] arguments = keyPrefix == null ? [credential, headerName] : [credential, headerName, keyPrefix]; + return Static().Invoke(nameof(ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy), arguments).As(); + } + + public override ValueExpression TokenAuthorizationPolicy(ValueExpression credential, ValueExpression scopes) + { + // Scm library does not support token credentials yet. The throw here is intentional. + // For a plugin that supports token credentials, they could override this implementation as well as the above TokenCredentialType property. + throw new NotImplementedException(); + } public override ClientPipelineApi ToExpression() => this; diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientProvider.cs index 6ea60345e8..c050d10981 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/ClientProvider.cs @@ -19,9 +19,15 @@ namespace Microsoft.Generator.CSharp.ClientModel.Providers { public class ClientProvider : TypeProvider { + private record AuthFields(FieldProvider AuthField); + private record ApiKeyFields(FieldProvider AuthField, FieldProvider AuthorizationHeaderField, FieldProvider? AuthorizationApiKeyPrefixField) : AuthFields(AuthField); + private record OAuth2Fields(FieldProvider AuthField, FieldProvider AuthorizationScopesField) : AuthFields(AuthField); + private const string AuthorizationHeaderConstName = "AuthorizationHeader"; private const string AuthorizationApiKeyPrefixConstName = "AuthorizationApiKeyPrefix"; private const string ApiKeyCredentialFieldName = "_keyCredential"; + private const string TokenCredentialScopesFieldName = "AuthorizationScopes"; + private const string TokenCredentialFieldName = "_tokenCredential"; private const string EndpointFieldName = "_endpoint"; private const string ClientSuffix = "Client"; private readonly FormattableString _publicCtorDescription; @@ -29,11 +35,12 @@ public class ClientProvider : TypeProvider private readonly InputAuth? _inputAuth; private readonly ParameterProvider _endpointParameter; private readonly FieldProvider? _clientCachingField; - private readonly FieldProvider? _apiKeyAuthField; - private readonly FieldProvider? _authorizationHeaderConstant; - private readonly FieldProvider? _authorizationApiKeyPrefixConstant; + + private readonly ApiKeyFields? _apiKeyAuthFields; + private readonly OAuth2Fields? _oauth2Fields; + private FieldProvider? _apiVersionField; - private readonly List _subClientInternalConstructorParams; + private readonly Lazy> _subClientInternalConstructorParams; private IReadOnlyList>? _subClients; private ParameterProvider? _clientOptionsParameter; private ClientOptionsProvider? _clientOptions; @@ -61,24 +68,50 @@ public ClientProvider(InputClient inputClient) _publicCtorDescription = $"Initializes a new instance of {Name}."; var apiKey = _inputAuth?.ApiKey; - _apiKeyAuthField = apiKey != null ? new FieldProvider( - FieldModifiers.Private | FieldModifiers.ReadOnly, - ClientModelPlugin.Instance.TypeFactory.KeyCredentialType, - ApiKeyCredentialFieldName, - this, - description: $"A credential used to authenticate to the service.") : null; - _authorizationHeaderConstant = apiKey?.Name != null ? new( - FieldModifiers.Private | FieldModifiers.Const, - typeof(string), - AuthorizationHeaderConstName, - this, - initializationValue: Literal(apiKey.Name)) : null; - _authorizationApiKeyPrefixConstant = apiKey?.Prefix != null ? new( - FieldModifiers.Private | FieldModifiers.Const, - typeof(string), - AuthorizationApiKeyPrefixConstName, - this, - initializationValue: Literal(apiKey.Prefix)) : null; + var keyCredentialType = ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.KeyCredentialType; + if (apiKey != null && keyCredentialType != null) + { + var apiKeyAuthField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.ReadOnly, + keyCredentialType, + ApiKeyCredentialFieldName, + this, + description: $"A credential used to authenticate to the service."); + var authorizationHeaderField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Const, + typeof(string), + AuthorizationHeaderConstName, + this, + initializationValue: Literal(apiKey.Name)); + var authorizationApiKeyPrefixField = apiKey.Prefix != null ? + new FieldProvider( + FieldModifiers.Private | FieldModifiers.Const, + typeof(string), + AuthorizationApiKeyPrefixConstName, + this, + initializationValue: Literal(apiKey.Prefix)) : + null; + _apiKeyAuthFields = new(apiKeyAuthField, authorizationHeaderField, authorizationApiKeyPrefixField); + } + // in this plugin, the type of TokenCredential is null therefore these code will never be executed, but it should be invoked in other plugins that could support it. + var tokenAuth = _inputAuth?.OAuth2; + var tokenCredentialType = ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.TokenCredentialType; + if (tokenAuth != null && tokenCredentialType != null) + { + var tokenCredentialField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.ReadOnly, + tokenCredentialType, + TokenCredentialFieldName, + this, + description: $"A credential used to authenticate to the service."); + var tokenCredentialScopesField = new FieldProvider( + FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, + typeof(string[]), + TokenCredentialScopesFieldName, + this, + initializationValue: New.Array(typeof(string), tokenAuth.Scopes.Select(Literal).ToArray())); + _oauth2Fields = new(tokenCredentialField, tokenCredentialScopesField); + } EndpointField = new( FieldModifiers.Private | FieldModifiers.ReadOnly, typeof(Uri), @@ -92,10 +125,6 @@ public ClientProvider(InputClient inputClient) body: new AutoPropertyBody(false), enclosingType: this); - _subClientInternalConstructorParams = _apiKeyAuthField != null - ? [PipelineProperty.AsParameter, _apiKeyAuthField.AsParameter, _endpointParameter] - : [PipelineProperty.AsParameter, _endpointParameter]; - if (_inputClient.Parent != null) { // _clientCachingField will only have subClients (children) @@ -108,23 +137,43 @@ public ClientProvider(InputClient inputClient) } _endpointParameterName = new(GetEndpointParameterName); - _additionalClientFields = new Lazy>(() => BuildAdditionalClientFields()); + _additionalClientFields = new(BuildAdditionalClientFields); _allClientParameters = _inputClient.Parameters.Concat(_inputClient.Operations.SelectMany(op => op.Parameters).Where(p => p.Kind == InputOperationParameterKind.Client)).DistinctBy(p => p.Name).ToArray(); + _subClientInternalConstructorParams = new(GetSubClientInternalConstructorParameters); + _clientParameters = new(GetClientParameters); + } - foreach (var field in _additionalClientFields.Value) + private IReadOnlyList GetSubClientInternalConstructorParameters() + { + var subClientParameters = new List + { + PipelineProperty.AsParameter + }; + + if (_apiKeyAuthFields != null) + { + subClientParameters.Add(_apiKeyAuthFields.AuthField.AsParameter); + } + if (_oauth2Fields != null) { - _subClientInternalConstructorParams.Add(field.AsParameter); + subClientParameters.Add(_oauth2Fields.AuthField.AsParameter); } + subClientParameters.Add(_endpointParameter); + subClientParameters.AddRange(ClientParameters); + + return subClientParameters; } - private List? _clientParameters; - internal IReadOnlyList GetClientParameters() + private Lazy> _clientParameters; + internal IReadOnlyList ClientParameters => _clientParameters.Value; + private IReadOnlyList GetClientParameters() { - if (_clientParameters is null) + var parameters = new List(_additionalClientFields.Value.Count); + foreach (var field in _additionalClientFields.Value) { - _ = Constructors; + parameters.Add(field.AsParameter); } - return _clientParameters ?? []; + return parameters; } private Lazy _endpointParameterName; @@ -159,17 +208,22 @@ protected override FieldProvider[] BuildFields() { List fields = [EndpointField]; - if (_apiKeyAuthField != null && _authorizationHeaderConstant != null) + if (_apiKeyAuthFields != null) { - fields.Add(_authorizationHeaderConstant); - fields.Add(_apiKeyAuthField); - - if (_authorizationApiKeyPrefixConstant != null) + fields.Add(_apiKeyAuthFields.AuthField); + fields.Add(_apiKeyAuthFields.AuthorizationHeaderField); + if (_apiKeyAuthFields.AuthorizationApiKeyPrefixField != null) { - fields.Add(_authorizationApiKeyPrefixConstant); + fields.Add(_apiKeyAuthFields.AuthorizationApiKeyPrefixField); } } + if (_oauth2Fields != null) + { + fields.Add(_oauth2Fields.AuthField); + fields.Add(_oauth2Fields.AuthorizationScopesField); + } + fields.AddRange(_additionalClientFields.Value); // add sub-client caching fields @@ -225,9 +279,8 @@ protected override ConstructorProvider[] BuildConstructors() // handle sub-client constructors if (ClientOptionsParameter is null) { - _clientParameters = _subClientInternalConstructorParams; List body = new(3) { EndpointField.Assign(_endpointParameter).Terminate() }; - foreach (var p in _subClientInternalConstructorParams) + foreach (var p in _subClientInternalConstructorParams.Value) { var assignment = p.Field?.Assign(p).Terminate() ?? p.Property?.Assign(p).Terminate(); if (assignment != null) @@ -236,35 +289,61 @@ protected override ConstructorProvider[] BuildConstructors() } } var subClientConstructor = new ConstructorProvider( - new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Internal, _subClientInternalConstructorParams), + new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Internal, _subClientInternalConstructorParams.Value), body, this); return [mockingConstructor, subClientConstructor]; } - var requiredParameters = GetRequiredParameters(); - ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, ClientOptionsParameter]; - var primaryConstructor = new ConstructorProvider( - new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Public, primaryConstructorParameters), - BuildPrimaryConstructorBody(primaryConstructorParameters), - this); + // we need to construct two sets of constructors for both auth we supported if any. + var primaryConstructors = new List(); + var secondaryConstructors = new List(); - // If the endpoint parameter contains an initialization value, it is not required. - ParameterProvider[] secondaryConstructorParameters = _endpointParameter.InitializationValue is null - ? [_endpointParameter, .. requiredParameters] - : [.. requiredParameters]; - var secondaryConstructor = BuildSecondaryConstructor(secondaryConstructorParameters, primaryConstructorParameters); - var shouldIncludeMockingConstructor = secondaryConstructorParameters.Length > 0 || _apiKeyAuthField != null; + // if there is key auth + if (_apiKeyAuthFields != null) + { + AppendConstructors(_apiKeyAuthFields, primaryConstructors, secondaryConstructors); + } + // if there is oauth2 auth + if (_oauth2Fields!= null) + { + AppendConstructors(_oauth2Fields, primaryConstructors, secondaryConstructors); + } + // if there is no auth + if (_apiKeyAuthFields == null && _oauth2Fields == null) + { + AppendConstructors(null, primaryConstructors, secondaryConstructors); + } + var shouldIncludeMockingConstructor = secondaryConstructors.All(c => c.Signature.Parameters.Count > 0); return shouldIncludeMockingConstructor - ? [ConstructorProviderHelper.BuildMockingConstructor(this), secondaryConstructor, primaryConstructor] - : [secondaryConstructor, primaryConstructor]; + ? [ConstructorProviderHelper.BuildMockingConstructor(this), .. secondaryConstructors, .. primaryConstructors] + : [.. secondaryConstructors, .. primaryConstructors]; + + void AppendConstructors(AuthFields? authFields, List primaryConstructors, List secondaryConstructors) + { + var requiredParameters = GetRequiredParameters(authFields?.AuthField); + ParameterProvider[] primaryConstructorParameters = [_endpointParameter, .. requiredParameters, ClientOptionsParameter]; + var primaryConstructor = new ConstructorProvider( + new ConstructorSignature(Type, _publicCtorDescription, MethodSignatureModifiers.Public, primaryConstructorParameters), + BuildPrimaryConstructorBody(primaryConstructorParameters, authFields), + this); + + primaryConstructors.Add(primaryConstructor); + + // If the endpoint parameter contains an initialization value, it is not required. + ParameterProvider[] secondaryConstructorParameters = _endpointParameter.InitializationValue is null + ? [_endpointParameter, .. requiredParameters] + : [.. requiredParameters]; + var secondaryConstructor = BuildSecondaryConstructor(secondaryConstructorParameters, primaryConstructorParameters); + + secondaryConstructors.Add(secondaryConstructor); + } } - private IReadOnlyList GetRequiredParameters() + private IReadOnlyList GetRequiredParameters(FieldProvider? authField) { List requiredParameters = []; - _clientParameters = []; ParameterProvider? currentParam = null; foreach (var parameter in _allClientParameters) @@ -275,11 +354,10 @@ private IReadOnlyList GetRequiredParameters() currentParam = CreateParameter(parameter); requiredParameters.Add(currentParam); } - _clientParameters.Add(currentParam ?? CreateParameter(parameter)); } - if (_apiKeyAuthField is not null) - requiredParameters.Add(_apiKeyAuthField.AsParameter); + if (authField is not null) + requiredParameters.Add(authField.AsParameter); return requiredParameters; } @@ -291,7 +369,7 @@ private ParameterProvider CreateParameter(InputParameter parameter) return param; } - private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList primaryConstructorParameters) + private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList primaryConstructorParameters, AuthFields? authFields) { if (ClientOptions is null || ClientOptionsParameter is null) { @@ -314,14 +392,19 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList().AuthorizationPolicy(authorizationPolicyArgs)); + case ApiKeyFields keyAuthFields: + ValueExpression? keyPrefixExpression = keyAuthFields.AuthorizationApiKeyPrefixField != null ? (ValueExpression)keyAuthFields.AuthorizationApiKeyPrefixField : null; + perRetryPolicies = New.Array(ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, This.ToApi().KeyAuthorizationPolicy(keyAuthFields.AuthField, keyAuthFields.AuthorizationHeaderField, keyPrefixExpression)); + break; + case OAuth2Fields oauth2AuthFields: + perRetryPolicies = New.Array(ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType, isInline: true, This.ToApi().TokenAuthorizationPolicy(oauth2AuthFields.AuthField, oauth2AuthFields.AuthorizationScopesField)); + break; + default: + perRetryPolicies = New.Array(ClientModelPlugin.Instance.TypeFactory.ClientPipelineApi.PipelinePolicyType); + break; } body.Add(PipelineProperty.Assign(This.ToApi().Create(ClientOptionsParameter, perRetryPolicies)).Terminate()); @@ -329,18 +412,13 @@ private MethodBodyStatement[] BuildPrimaryConstructorBody(IReadOnlyList p.Name.ToCleanName()); foreach (var f in Fields) { - if (f != _apiKeyAuthField - && f != EndpointField - && !f.Modifiers.HasFlag(FieldModifiers.Const)) + if (f == _apiVersionField && ClientOptions.VersionProperty != null) { - if (f == _apiVersionField && ClientOptions.VersionProperty != null) - { - body.Add(f.Assign(ClientOptionsParameter.Property(ClientOptions.VersionProperty.Name)).Terminate()); - } - else if (clientOptionsPropertyDict.TryGetValue(f.Name.ToCleanName(), out var optionsProperty)) - { - clientOptionsPropertyDict.TryGetValue(f.Name.ToCleanName(), out optionsProperty); - } + body.Add(f.Assign(ClientOptionsParameter.Property(ClientOptions.VersionProperty.Name)).Terminate()); + } + else if (clientOptionsPropertyDict.TryGetValue(f.Name.ToCleanName(), out var optionsProperty)) + { + clientOptionsPropertyDict.TryGetValue(f.Name.ToCleanName(), out optionsProperty); } } @@ -410,7 +488,7 @@ protected override MethodProvider[] BuildMethods() List subClientConstructorArgs = new(3); // Populate constructor arguments - foreach (var param in subClientInstance._subClientInternalConstructorParams) + foreach (var param in subClientInstance._subClientInternalConstructorParams.Value) { if (parentClientProperties.TryGetValue(param.Name, out var parentProperty)) { diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs index 232e030537..65c737b876 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/Providers/RestClientProvider.cs @@ -97,7 +97,7 @@ private MethodProvider BuildCreateRequestMethod(InputOperation operation) [.. parameters, options]); var paramMap = new Dictionary(signature.Parameters.ToDictionary(p => p.Name)); - foreach (var param in ClientProvider.GetClientParameters()) + foreach (var param in ClientProvider.ClientParameters) { paramMap[param.Name] = param; } @@ -356,7 +356,7 @@ private void AddUriSegments( /* when the parameter is in operation.uri, it is client parameter * It is not operation parameter and not in inputParamHash list. */ - var isClientParameter = ClientProvider.GetClientParameters().Any(p => p.Name == paramName); + var isClientParameter = ClientProvider.ClientParameters.Any(p => p.Name == paramName); CSharpType? type; string? format; ValueExpression valueExpression; diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ScmTypeFactory.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ScmTypeFactory.cs index 18364b2d46..3a63e2614b 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ScmTypeFactory.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/src/ScmTypeFactory.cs @@ -2,21 +2,16 @@ // Licensed under the MIT License. using System; -using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.IO; -using System.Net; using System.Text.Json; using Microsoft.Generator.CSharp.ClientModel.Providers; -using Microsoft.Generator.CSharp.ClientModel.Snippets; using Microsoft.Generator.CSharp.Expressions; using Microsoft.Generator.CSharp.Input; using Microsoft.Generator.CSharp.Primitives; using Microsoft.Generator.CSharp.Providers; using Microsoft.Generator.CSharp.Snippets; using Microsoft.Generator.CSharp.Statements; -using static Microsoft.Generator.CSharp.Snippets.Snippet; namespace Microsoft.Generator.CSharp.ClientModel { @@ -27,10 +22,6 @@ public class ScmTypeFactory : TypeFactory public virtual CSharpType MatchConditionsType => typeof(PipelineMessageClassifier); - public virtual CSharpType KeyCredentialType => typeof(ApiKeyCredential); - - public virtual CSharpType TokenCredentialType => throw new NotImplementedException("Token credential is not supported in Scm libraries yet"); - public virtual IClientResponseApi ClientResponseApi => ClientResultProvider.Instance; public virtual IHttpResponseApi HttpResponseApi => PipelineResponseProvider.Instance; diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/OutputTypes/ScmKnownParametersTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/OutputTypes/ScmKnownParametersTests.cs index 091102c8de..063aa6c659 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/OutputTypes/ScmKnownParametersTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/OutputTypes/ScmKnownParametersTests.cs @@ -8,16 +8,6 @@ namespace Microsoft.Generator.CSharp.ClientModel.Tests.OutputTypes { internal class ScmKnownParametersTests { - [Test] - public void TestTokenAuth() - { - MockHelpers.LoadMockPlugin(keyCredentialType: () => typeof(int)); - - var result = ClientModelPlugin.Instance.TypeFactory.KeyCredentialType; - Assert.IsNotNull(result); - Assert.AreEqual(new CSharpType(typeof(int)), result); - } - [TestCase] public void TestMatchConditionsParameter() { diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Abstractions/ClientPipelineApiTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Abstractions/ClientPipelineApiTests.cs index f7e5bd92c9..5e968b87b0 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Abstractions/ClientPipelineApiTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/Abstractions/ClientPipelineApiTests.cs @@ -55,6 +55,10 @@ public TestClientPipelineApi(ValueExpression original) : base(typeof(string), or public override CSharpType PipelinePolicyType => typeof(string); + public override CSharpType KeyCredentialType => typeof(object); + + public override CSharpType TokenCredentialType => typeof(object); + public override ValueExpression Create(ValueExpression options, ValueExpression perRetryPolicies) => Original.Invoke("GetFakeCreate", [options, perRetryPolicies]); @@ -64,8 +68,11 @@ public override ValueExpression CreateMessage(HttpRequestOptionsApi requestOptio public override ClientPipelineApi FromExpression(ValueExpression expression) => new TestClientPipelineApi(expression); - public override ValueExpression AuthorizationPolicy(params ValueExpression[] arguments) - => Original.Invoke("GetFakeAuthorizationPolicy", arguments); + public override ValueExpression KeyAuthorizationPolicy(ValueExpression credential, ValueExpression headerName, ValueExpression? keyPrefix = null) + => Original.Invoke("GetFakeAuthorizationPolicy", keyPrefix == null ? [credential, headerName] : [credential, headerName, keyPrefix]); + + public override ValueExpression TokenAuthorizationPolicy(ValueExpression credential, ValueExpression scopes) + => Original.Invoke("GetFakeTokenAuthorizationPolicy", [credential, scopes]); public override ClientPipelineApi ToExpression() => this; diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs index 86c646ea64..b221fcd4ec 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/ClientProviderTests.cs @@ -6,6 +6,7 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Linq; +using System.Runtime.CompilerServices; using Microsoft.Generator.CSharp.ClientModel.Providers; using Microsoft.Generator.CSharp.Expressions; using Microsoft.Generator.CSharp.Input; @@ -22,6 +23,8 @@ namespace Microsoft.Generator.CSharp.ClientModel.Tests.Providers.ClientProviders public class ClientProviderTests { private const string SubClientsCategory = "WithSubClients"; + private const string KeyAuthCategory = "WithKeyAuth"; + private const string OAuth2Category = "WithOAuth2"; private const string TestClientName = "TestClient"; private static readonly InputClient _animalClient = new("animal", "AnimalClient description", [], [], TestClientName); private static readonly InputClient _dogClient = new("dog", "DogClient description", [], [], _animalClient.Name); @@ -34,22 +37,30 @@ public class ClientProviderTests InputFactory.Property("p1", InputPrimitiveType.String, isRequired: true), ]); + private bool _containsSubClients; + private bool _hasKeyAuth; + private bool _hasOAuth2; + private bool _hasAuth; + [SetUp] public void SetUp() { var categories = TestContext.CurrentContext.Test?.Properties["Category"]; - bool containsSubClients = categories?.Contains(SubClientsCategory) ?? false; - - if (containsSubClients) - { - MockHelpers.LoadMockPlugin( - apiKeyAuth: () => new InputApiKeyAuth("mock", null), - clients: () => [_animalClient, _dogClient, _huskyClient]); - } - else - { - MockHelpers.LoadMockPlugin(apiKeyAuth: () => new InputApiKeyAuth("mock", null)); - } + _containsSubClients = categories?.Contains(SubClientsCategory) ?? false; + _hasKeyAuth = categories?.Contains(KeyAuthCategory) ?? false; + _hasOAuth2 = categories?.Contains(OAuth2Category) ?? false; + _hasAuth = _hasKeyAuth || _hasOAuth2; + + Func>? clients = _containsSubClients ? + () => [_animalClient, _dogClient, _huskyClient] : + null; + Func? apiKeyAuth = _hasKeyAuth ? () => new InputApiKeyAuth("mock", null) : null; + Func? oauth2Auth = _hasOAuth2 ? () => new InputOAuth2Auth(["mock"]) : null; + MockHelpers.LoadMockPlugin( + apiKeyAuth: apiKeyAuth, + oauth2Auth: oauth2Auth, + clients: clients, + clientPipelineApi: TestClientPipelineApi.Instance); } [Test] @@ -73,81 +84,133 @@ public void TestBuildProperties() } [TestCaseSource(nameof(BuildFieldsTestCases))] - public void TestBuildFields(List inputParameters, bool containsAdditionalParams) + public void TestBuildFields(List inputParameters, List expectedFields) { var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); var clientProvider = new ClientProvider(client); Assert.IsNotNull(clientProvider); - // validate the fields - var fields = clientProvider.Fields; - if (containsAdditionalParams) - { - Assert.AreEqual(6, fields.Count); + AssertHasFields(clientProvider, expectedFields); + } - } - else + [TestCaseSource(nameof(BuildAuthFieldsTestCases), Category = KeyAuthCategory)] + [TestCaseSource(nameof(BuildAuthFieldsTestCases), Category = OAuth2Category)] + [TestCaseSource(nameof(BuildAuthFieldsTestCases), Category = $"{KeyAuthCategory},{OAuth2Category}")] + public void TestBuildAuthFields_WithAuth(List inputParameters) + { + var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); + var clientProvider = new ClientProvider(client); + + Assert.IsNotNull(clientProvider); + + if (_hasKeyAuth) { - Assert.AreEqual(4, fields.Count); + // key auth should have the following fields: AuthorizationHeader, _keyCredential + AssertHasFields(clientProvider, new List + { + new(FieldModifiers.Private | FieldModifiers.Const, new CSharpType(typeof(string)), "AuthorizationHeader"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(ApiKeyCredential)), "_keyCredential") + }); } - - // validate the endpoint field - if (inputParameters.Any(p => p.IsEndpoint)) + if (_hasOAuth2) { - var endpointField = fields.FirstOrDefault(f => f.Name == "_endpoint"); - Assert.IsNotNull(endpointField); - Assert.AreEqual(new CSharpType(typeof(Uri)), endpointField?.Type); + // oauth2 auth should have the following fields: AuthorizationScopes, _tokenCredential + AssertHasFields(clientProvider, new List + { + new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(string[])), "AuthorizationScopes"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(FakeTokenCredential)), "_tokenCredential"), + }); } + } - // validate other parameters as fields - if (containsAdditionalParams) - { - var optionalParamField = fields.FirstOrDefault(f => f.Name == "_optionalNullableParam"); - Assert.IsNotNull(optionalParamField); - Assert.AreEqual(new CSharpType(typeof(string), isNullable: true), optionalParamField?.Type); + [TestCaseSource(nameof(BuildAuthFieldsTestCases))] + public void TestBuildAuthFields_NoAuth(List inputParameters) + { + var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); + var clientProvider = new ClientProvider(client); - var requiredParam2Field = fields.FirstOrDefault(f => f.Name == "_requiredParam2"); - Assert.IsNotNull(requiredParam2Field); - Assert.AreEqual(new CSharpType(typeof(string), isNullable: false), requiredParam2Field?.Type); + Assert.IsNotNull(clientProvider); - var requiredParam3Field = fields.FirstOrDefault(f => f.Name == "_requiredParam3"); - Assert.IsNotNull(requiredParam3Field); - Assert.AreEqual(new CSharpType(typeof(long), isNullable: false), requiredParam3Field?.Type); + // fields here should not have anything related with auth + bool authFieldFound = false; + foreach (var field in clientProvider.Fields) + { + if (field.Name.EndsWith("Credential") || field.Name.Contains("Authorization")) + { + authFieldFound = true; + } } + + Assert.IsFalse(authFieldFound); } // validates the fields are built correctly when a client has sub-clients - [TestCaseSource(nameof(SubClientTestCases), Category = SubClientsCategory)] - public void TestBuildFields_WithSubClients(InputClient client, bool hasSubClients) + [TestCaseSource(nameof(SubClientFieldsTestCases), Category = SubClientsCategory)] + public void TestBuildFields_WithSubClients(InputClient client, List expectedFields) { var clientProvider = new ClientProvider(client); Assert.IsNotNull(clientProvider); - // validate the fields - var fields = clientProvider.Fields; + AssertHasFields(clientProvider, expectedFields); + } - // validate the endpoint field - var endpointField = fields.FirstOrDefault(f => f.Name == "_endpoint"); - Assert.IsNotNull(endpointField); - Assert.AreEqual(new CSharpType(typeof(Uri)), endpointField?.Type); + // validates the credential fields are built correctly when a client has sub-clients + [TestCaseSource(nameof(SubClientAuthFieldsTestCases), Category = SubClientsCategory)] + public void TestBuildAuthFields_WithSubClients_NoAuth(InputClient client) + { + var clientProvider = new ClientProvider(client); - // there should be n number of caching client fields for every direct sub-client + endpoint field + auth fields - if (hasSubClients) + Assert.IsNotNull(clientProvider); + + // fields here should not have anything related with auth + bool authFieldFound = false; + foreach (var field in clientProvider.Fields) { - Assert.AreEqual(4, fields.Count); - var cachedClientFields = fields.Where(f => f.Name.StartsWith("_cached")); - Assert.AreEqual(1, cachedClientFields.Count()); + if (field.Name.EndsWith("Credential") || field.Name.Contains("Authorization")) + { + authFieldFound = true; + } } - else + + Assert.IsFalse(authFieldFound); + } + + // validates the credential fields are built correctly when a client has sub-clients + [TestCaseSource(nameof(SubClientAuthFieldsTestCases), Category = $"{SubClientsCategory},{KeyAuthCategory}")] + [TestCaseSource(nameof(SubClientAuthFieldsTestCases), Category = $"{SubClientsCategory},{OAuth2Category}")] + [TestCaseSource(nameof(SubClientAuthFieldsTestCases), Category = $"{SubClientsCategory},{KeyAuthCategory},{OAuth2Category}")] + public void TestBuildAuthFields_WithSubClients_WithAuth(InputClient client) + { + var clientProvider = new ClientProvider(client); + + Assert.IsNotNull(clientProvider); + + if (_hasKeyAuth) { - // The 3 fields are _endpoint, AuthorizationHeader, and _keyCredential - Assert.AreEqual(3, fields.Count); + // key auth should have the following fields: AuthorizationHeader, _keyCredential + AssertHasFields(clientProvider, new List + { + new(FieldModifiers.Private | FieldModifiers.Const, new CSharpType(typeof(string)), "AuthorizationHeader"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(ApiKeyCredential)), "_keyCredential") + }); + } + if (_hasOAuth2) + { + // oauth2 auth should have the following fields: AuthorizationScopes, _tokenCredential + AssertHasFields(clientProvider, new List + { + new(FieldModifiers.Private | FieldModifiers.Static | FieldModifiers.ReadOnly, new CSharpType(typeof(string[])), "AuthorizationScopes"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(FakeTokenCredential)), "_tokenCredential"), + }); } } [TestCaseSource(nameof(BuildConstructorsTestCases))] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = KeyAuthCategory)] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = OAuth2Category)] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = $"{KeyAuthCategory},{OAuth2Category}")] public void TestBuildConstructors_PrimaryConstructor(List inputParameters) { var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); @@ -156,14 +219,25 @@ public void TestBuildConstructors_PrimaryConstructor(List inputP Assert.IsNotNull(clientProvider); var constructors = clientProvider.Constructors; - Assert.AreEqual(3, constructors.Count); - var primaryPublicConstructor = constructors.FirstOrDefault( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); - ValidatePrimaryConstructor(primaryPublicConstructor, inputParameters); + var primaryPublicConstructors = constructors.Where( + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + + // for no auth or one auth case, this should be 1 + // for both auth case, this should be 2 + var expectedPrimaryCtorCount = _hasKeyAuth && _hasOAuth2 ? 2 : 1; + Assert.AreEqual(expectedPrimaryCtorCount, primaryPublicConstructors.Length); + + for (int i = 0; i < primaryPublicConstructors.Length; i++) + { + ValidatePrimaryConstructor(primaryPublicConstructors[i], inputParameters, i); + } } [TestCaseSource(nameof(BuildConstructorsTestCases))] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = KeyAuthCategory)] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = OAuth2Category)] + [TestCaseSource(nameof(BuildConstructorsTestCases), Category = $"{KeyAuthCategory},{OAuth2Category}")] public void TestBuildConstructors_SecondaryConstructor(List inputParameters) { var client = InputFactory.Client(TestClientName, parameters: [.. inputParameters]); @@ -173,19 +247,46 @@ public void TestBuildConstructors_SecondaryConstructor(List inpu var constructors = clientProvider.Constructors; - Assert.AreEqual(3, constructors.Count); - var primaryPublicConstructor = constructors.FirstOrDefault( - c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); + var primaryPublicConstructors = constructors.Where( + c => c.Signature?.Initializer == null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + var secondaryPublicConstructors = constructors.Where( + c => c.Signature?.Initializer != null && c.Signature?.Modifiers == MethodSignatureModifiers.Public).ToArray(); + + // for no auth or one auth case, this should be 1 + // for both auth case, this should be 2 + var expectedSecondaryCtorCount = _hasKeyAuth && _hasOAuth2 ? 2 : 1; + Assert.AreEqual(expectedSecondaryCtorCount, secondaryPublicConstructors.Length); + foreach (var secondaryPublicConstructor in secondaryPublicConstructors) + { + ValidateSecondaryConstructor(primaryPublicConstructors, secondaryPublicConstructor, inputParameters); + } + } - Assert.IsNotNull(primaryPublicConstructor); + [TestCase] + public void TestBuildConstructors_ForSubClient_NoAuth() + { + var clientProvider = new ClientProvider(_animalClient); - var secondaryPublicConstructor = constructors.FirstOrDefault( - c => c.Signature?.Initializer != null && c.Signature?.Modifiers == MethodSignatureModifiers.Public); - ValidateSecondaryConstructor(primaryPublicConstructor, secondaryPublicConstructor, inputParameters); + Assert.IsNotNull(clientProvider); + + var constructors = clientProvider.Constructors; + + Assert.AreEqual(2, constructors.Count); + var internalConstructor = constructors.FirstOrDefault( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal); + Assert.IsNotNull(internalConstructor); + // in the no auth case, the ctor no longer has the credentail parameter therefore here we expect 2 parameters. + var ctorParams = internalConstructor?.Signature?.Parameters; + Assert.AreEqual(2, ctorParams?.Count); + + var mockingConstructor = constructors.FirstOrDefault( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Protected); + Assert.IsNotNull(mockingConstructor); } - [Test] - public void TestBuildConstructors_ForSubClient() + [TestCase(Category = KeyAuthCategory)] + [TestCase(Category = OAuth2Category)] + public void TestBuildConstructors_ForSubClient_KeyAuthOrOAuth2Auth() { var clientProvider = new ClientProvider(_animalClient); @@ -197,6 +298,7 @@ public void TestBuildConstructors_ForSubClient() var internalConstructor = constructors.FirstOrDefault( c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal); Assert.IsNotNull(internalConstructor); + // when there is only one approach of auth, we have 3 parameters in the ctor. var ctorParams = internalConstructor?.Signature?.Parameters; Assert.AreEqual(3, ctorParams?.Count); @@ -205,22 +307,46 @@ public void TestBuildConstructors_ForSubClient() Assert.IsNotNull(mockingConstructor); } - private static void ValidatePrimaryConstructor( - ConstructorProvider? primaryPublicConstructor, - List inputParameters) + [TestCase(Category = $"{KeyAuthCategory},{OAuth2Category}")] + public void TestBuildConstructors_ForSubClient_BothAuth() { - Assert.IsNotNull(primaryPublicConstructor); + var clientProvider = new ClientProvider(_animalClient); + + Assert.IsNotNull(clientProvider); + + var constructors = clientProvider.Constructors; + + Assert.AreEqual(2, constructors.Count); + var internalConstructor = constructors.FirstOrDefault( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Internal); + Assert.IsNotNull(internalConstructor); + // when we have both auths, we have 4 parameters in the ctor, because now we should have two credential parameters + var ctorParams = internalConstructor?.Signature?.Parameters; + Assert.AreEqual(4, ctorParams?.Count); + var mockingConstructor = constructors.FirstOrDefault( + c => c.Signature?.Modifiers == MethodSignatureModifiers.Protected); + Assert.IsNotNull(mockingConstructor); + } + + private void ValidatePrimaryConstructor( + ConstructorProvider primaryPublicConstructor, + List inputParameters, + int ctorIndex, + [CallerMemberName] string method = "", + [CallerFilePath] string filePath = "") + { var primaryCtorParams = primaryPublicConstructor?.Signature?.Parameters; - var expectedPrimaryCtorParamCount = 3; + // in no auth case, the ctor only have two parameters: endpoint and options + // in other cases, the ctor should have three parameters: endpoint, credential, options + // specifically, in both auth cases, we should have two ctors corresponding to each credential type as the second parameter + var expectedPrimaryCtorParamCount = !_hasKeyAuth && !_hasOAuth2 ? 2 : 3; Assert.AreEqual(expectedPrimaryCtorParamCount, primaryCtorParams?.Count); - // validate the order of the parameters (endpoint, credential, client options) + // the first should be endpoint var endpointParam = primaryCtorParams?[0]; Assert.AreEqual(KnownParameters.Endpoint.Name, endpointParam?.Name); - Assert.AreEqual("keyCredential", primaryCtorParams?[1].Name); - Assert.AreEqual("options", primaryCtorParams?[2].Name); if (endpointParam?.DefaultValue != null) { @@ -229,41 +355,79 @@ private static void ValidatePrimaryConstructor( Assert.AreEqual(Literal(parsedValue), endpointParam?.InitializationValue); } + // the last parameter should be the options + var optionsParam = primaryCtorParams?[^1]; + Assert.AreEqual("options", optionsParam?.Name); + + if (_hasAuth) + { + // when there is any auth, the second should be auth parameter + var authParam = primaryCtorParams?[1]; + Assert.IsNotNull(authParam); + if (authParam?.Name == "keyCredential") + { + Assert.AreEqual(new CSharpType(typeof(ApiKeyCredential)), authParam?.Type); + } + else if (authParam?.Name == "tokenCredential") + { + Assert.AreEqual(new CSharpType(typeof(FakeTokenCredential)), authParam?.Type); + } + else + { + Assert.Fail("Unexpected auth parameter"); + } + } + // validate the body of the primary ctor + var caseName = TestContext.CurrentContext.Test.Properties.Get("caseName"); + var expected = Helpers.GetExpectedFromFile($"{caseName},{_hasKeyAuth},{_hasOAuth2},{ctorIndex}", method, filePath); var primaryCtorBody = primaryPublicConstructor?.BodyStatements; Assert.IsNotNull(primaryCtorBody); + Assert.AreEqual(expected, primaryCtorBody?.ToDisplayString()); } private void ValidateSecondaryConstructor( - ConstructorProvider? primaryConstructor, - ConstructorProvider? secondaryPublicConstructor, + IReadOnlyList primaryConstructors, + ConstructorProvider secondaryPublicConstructor, List inputParameters) { - Assert.IsNotNull(secondaryPublicConstructor); - var ctorParams = secondaryPublicConstructor?.Signature?.Parameters; + var ctorParams = secondaryPublicConstructor.Signature?.Parameters; - // secondary ctor should consist of all required parameters + auth parameter + // secondary ctor should consist of all required parameters + auth parameter (when present) var requiredParams = inputParameters.Where(p => p.IsRequired).ToList(); - Assert.AreEqual(requiredParams.Count + 1, ctorParams?.Count); + var authParameterCount = _hasAuth ? 1 : 0; + Assert.AreEqual(requiredParams.Count + authParameterCount, ctorParams?.Count); var endpointParam = ctorParams?.FirstOrDefault(p => p.Name == KnownParameters.Endpoint.Name); if (requiredParams.Count == 0) { - // auth should be the only parameter if endpoint is optional - Assert.AreEqual("keyCredential", ctorParams?[0].Name); + // auth should be the only parameter if endpoint is optional when there is auth + if (_hasAuth) + { + Assert.IsTrue(ctorParams?[0].Name.EndsWith("Credential")); + } + else + { + // when there is no auth, the ctor should not have parameters + Assert.AreEqual(0, ctorParams?.Count); + } } else { // otherwise, it should only consist of the auth parameter Assert.AreEqual(KnownParameters.Endpoint.Name, ctorParams?[0].Name); - Assert.AreEqual("keyCredential", ctorParams?[1].Name); + if (_hasAuth) + { + Assert.IsTrue(ctorParams?[1].Name.EndsWith("Credential")); + } } Assert.AreEqual(MethodBodyStatement.Empty, secondaryPublicConstructor?.BodyStatements); // validate the initializer var initializer = secondaryPublicConstructor?.Signature?.Initializer; - Assert.AreEqual(primaryConstructor?.Signature?.Parameters?.Count, initializer?.Arguments?.Count); + Assert.NotNull(initializer); + Assert.IsTrue(primaryConstructors.Any(pc => pc.Signature.Parameters.Count == initializer?.Arguments.Count)); } [TestCaseSource(nameof(EndpointParamInitializationValueTestCases))] @@ -309,7 +473,7 @@ public void TestGetClientOptions(bool isSubClient) } } - [TestCaseSource(nameof(SubClientTestCases), Category = SubClientsCategory)] + [TestCaseSource(nameof(SubClientFactoryMethodTestCases), Category = SubClientsCategory)] public void TestSubClientAccessorFactoryMethods(InputClient client, bool hasSubClients) { var clientProvider = new ClientProvider(client); @@ -341,7 +505,6 @@ public void TestSubClientAccessorFactoryMethods(InputClient client, bool hasSubC { Assert.AreEqual(0, subClientAccessorFactoryMethods.Count); } - } [Test] @@ -426,7 +589,6 @@ public void ValidateClientWithSpread(InputClient inputClient) Assert.AreEqual(new CSharpType(typeof(string)), convenienceMethods[0].Signature.Parameters[0].Type); Assert.AreEqual("p1", convenienceMethods[0].Signature.Parameters[0].Name); - } [TestCaseSource(nameof(RequestOptionsParameterInSignatureTestCases))] @@ -597,6 +759,59 @@ protected override MethodProvider[] BuildMethods() protected override PropertyProvider[] BuildProperties() => []; } + public static IEnumerable BuildAuthFieldsTestCases + { + get + { + yield return new TestCaseData(new List + { + InputFactory.Parameter( + "optionalParam", + InputPrimitiveType.String, + location: RequestLocation.None, + kind: InputOperationParameterKind.Client), + InputFactory.Parameter( + KnownParameters.Endpoint.Name, + InputPrimitiveType.String, + location:RequestLocation.None, + kind: InputOperationParameterKind.Client, + isEndpoint: true) + }); + yield return new TestCaseData(new List + { + // have to explicitly set isRequired because we now call CreateParameter in buildFields + InputFactory.Parameter( + "optionalNullableParam", + InputPrimitiveType.String, + location: RequestLocation.None, + defaultValue: InputFactory.Constant.String("someValue"), + kind: InputOperationParameterKind.Client, + isRequired: false), + InputFactory.Parameter( + "requiredParam2", + InputPrimitiveType.String, + location: RequestLocation.None, + defaultValue: InputFactory.Constant.String("someValue"), + kind: InputOperationParameterKind.Client, + isRequired: true), + InputFactory.Parameter( + "requiredParam3", + InputPrimitiveType.Int64, + location: RequestLocation.None, + defaultValue: InputFactory.Constant.Int64(2), + kind: InputOperationParameterKind.Client, + isRequired: true), + InputFactory.Parameter( + KnownParameters.Endpoint.Name, + InputPrimitiveType.String, + location: RequestLocation.None, + defaultValue: null, + kind: InputOperationParameterKind.Client, + isEndpoint: true) + }); + } + } + public static IEnumerable BuildFieldsTestCases { get @@ -614,7 +829,13 @@ public static IEnumerable BuildFieldsTestCases location:RequestLocation.None, kind: InputOperationParameterKind.Client, isEndpoint: true) - }, false); + }, + new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(string), true), "_optionalParam") + } + ); yield return new TestCaseData(new List { // have to explicitly set isRequired because we now call CreateParameter in buildFields @@ -646,18 +867,51 @@ public static IEnumerable BuildFieldsTestCases defaultValue: null, kind: InputOperationParameterKind.Client, isEndpoint: true) - }, true); + }, + new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(string), true), "_optionalNullableParam"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(string), false), "_requiredParam2"), + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(long), false), "_requiredParam3") + }); } } - public static IEnumerable SubClientTestCases + public static IEnumerable SubClientAuthFieldsTestCases { get { - yield return new TestCaseData(InputFactory.Client(TestClientName), true); - yield return new TestCaseData(_animalClient, true); - yield return new TestCaseData(_dogClient, true); - yield return new TestCaseData(_huskyClient, false); + yield return new TestCaseData(InputFactory.Client(TestClientName)); + yield return new TestCaseData(_animalClient); + yield return new TestCaseData(_dogClient); + yield return new TestCaseData(_huskyClient); + } + } + + public static IEnumerable SubClientFieldsTestCases + { + get + { + yield return new TestCaseData(InputFactory.Client(TestClientName), new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint"), + new(FieldModifiers.Private, new ExpectedCSharpType("Animal", "Sample", false), "_cachedAnimal"), + }); + yield return new TestCaseData(_animalClient, new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint"), + new(FieldModifiers.Private, new ExpectedCSharpType("Dog", "Sample", false), "_cachedDog"), + }); + yield return new TestCaseData(_dogClient, new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint"), + new(FieldModifiers.Private, new ExpectedCSharpType("Husky", "Sample", false), "_cachedHusky"), + }); + yield return new TestCaseData(_huskyClient, new List + { + new(FieldModifiers.Private | FieldModifiers.ReadOnly, new CSharpType(typeof(Uri)), "_endpoint") + }); } } @@ -684,6 +938,17 @@ public static IEnumerable ValidateClientWithSpreadTestCases } } + public static IEnumerable SubClientFactoryMethodTestCases + { + get + { + yield return new TestCaseData(InputFactory.Client(TestClientName), true); + yield return new TestCaseData(_animalClient, true); + yield return new TestCaseData(_dogClient, true); + yield return new TestCaseData(_huskyClient, false); + } + } + public static IEnumerable BuildConstructorsTestCases { get @@ -702,7 +967,7 @@ public static IEnumerable BuildConstructorsTestCases defaultValue: InputFactory.Constant.String("someValue"), kind: InputOperationParameterKind.Client, isEndpoint: true) - }); + }).SetProperty("caseName", "WithDefault"); // scenario where endpoint is required yield return new TestCaseData(new List { @@ -718,7 +983,7 @@ public static IEnumerable BuildConstructorsTestCases InputPrimitiveType.String, location: RequestLocation.None, kind: InputOperationParameterKind.Client) - }); + }).SetProperty("caseName", "WithRequired"); } } @@ -841,83 +1106,199 @@ public static IEnumerable RequestOptionsParameterInSignatureTestCa } } - private static IEnumerable EndpointParamInitializationValueTestCases() + private static IEnumerable EndpointParamInitializationValueTestCases + { + get + { + // string primitive type + yield return new TestCaseData( + InputFactory.Parameter( + "param", + InputPrimitiveType.String, + location: RequestLocation.None, + kind: InputOperationParameterKind.Client, + isEndpoint: true, + defaultValue: InputFactory.Constant.String("mockValue")), + New.Instance(KnownParameters.Endpoint.Type, Literal("mockvalue"))); + } + } + + private static IEnumerable ValidateApiVersionPathParameterTestCases { - // string primitive type - yield return new TestCaseData( - InputFactory.Parameter( - "param", + get + { + InputParameter endpointParameter = InputFactory.Parameter( + "endpoint", InputPrimitiveType.String, - location: RequestLocation.None, + location: RequestLocation.Uri, + isRequired: true, kind: InputOperationParameterKind.Client, isEndpoint: true, - defaultValue: InputFactory.Constant.String("mockValue")), - New.Instance(KnownParameters.Endpoint.Type, Literal("mockvalue"))); - } - - private static IEnumerable ValidateApiVersionPathParameterTestCases() - { - InputParameter endpointParameter = InputFactory.Parameter( - "endpoint", - InputPrimitiveType.String, - location: RequestLocation.Uri, - isRequired: true, - kind: InputOperationParameterKind.Client, - isEndpoint: true, - isApiVersion: false); - - InputParameter stringApiVersionParameter = InputFactory.Parameter( - "apiVersion", - InputPrimitiveType.String, - location: RequestLocation.Uri, - isRequired: true, - kind: InputOperationParameterKind.Client, - isApiVersion: true); - - InputParameter enumApiVersionParameter = InputFactory.Parameter( - "apiVersion", - InputFactory.Enum( - "InputEnum", + isApiVersion: false); + + InputParameter stringApiVersionParameter = InputFactory.Parameter( + "apiVersion", InputPrimitiveType.String, - usage: InputModelTypeUsage.Input, - isExtensible: true, - values: - [ - InputFactory.EnumMember.String("value1", "value1"), + location: RequestLocation.Uri, + isRequired: true, + kind: InputOperationParameterKind.Client, + isApiVersion: true); + + InputParameter enumApiVersionParameter = InputFactory.Parameter( + "apiVersion", + InputFactory.Enum( + "InputEnum", + InputPrimitiveType.String, + usage: InputModelTypeUsage.Input, + isExtensible: true, + values: + [ + InputFactory.EnumMember.String("value1", "value1"), InputFactory.EnumMember.String("value2", "value2") - ]), - location: RequestLocation.Uri, - isRequired: true, - kind: InputOperationParameterKind.Client, - isApiVersion: true); - - yield return new TestCaseData( - InputFactory.Client( - "TestClient", - operations: - [ - InputFactory.Operation( + ]), + location: RequestLocation.Uri, + isRequired: true, + kind: InputOperationParameterKind.Client, + isApiVersion: true); + + yield return new TestCaseData( + InputFactory.Client( + "TestClient", + operations: + [ + InputFactory.Operation( "TestOperation", uri: "{endpoint}/{apiVersion}") - ], - parameters: [ - endpointParameter, + ], + parameters: [ + endpointParameter, stringApiVersionParameter - ])); + ])); - yield return new TestCaseData( - InputFactory.Client( - "TestClient", - operations: - [ - InputFactory.Operation( + yield return new TestCaseData( + InputFactory.Client( + "TestClient", + operations: + [ + InputFactory.Operation( "TestOperation", uri: "{endpoint}/{apiVersion}") - ], - parameters: [ - endpointParameter, + ], + parameters: [ + endpointParameter, enumApiVersionParameter - ])); + ])); + } + } + + // TODO -- this is temporary here before System.ClientModel officially supports OAuth2 auth + private record TestClientPipelineApi : ClientPipelineProvider + { + private static ClientPipelineApi? _instance; + internal new static ClientPipelineApi Instance => _instance ??= new TestClientPipelineApi(Empty); + + public TestClientPipelineApi(ValueExpression original) : base(original) + { + } + + public override CSharpType TokenCredentialType => typeof(FakeTokenCredential); + + public override ClientPipelineApi FromExpression(ValueExpression expression) + => new TestClientPipelineApi(expression); + + public override ValueExpression TokenAuthorizationPolicy(ValueExpression credential, ValueExpression scopes) + => Original.Invoke("GetFakeTokenAuthorizationPolicy", [credential, scopes]); + + public override ClientPipelineApi ToExpression() => this; + } + + internal class FakeTokenCredential { } + + public record ExpectedCSharpType + { + public string Name { get; } + + public string Namespace { get; } + + public bool IsFrameworkType { get; } + + public Type FrameworkType => _frameworkType ?? throw new InvalidOperationException(); + + public bool IsNullable { get; } + + private readonly Type? _frameworkType; + + public ExpectedCSharpType(Type frameworkType, bool isNullable) + { + _frameworkType = frameworkType; + IsFrameworkType = true; + IsNullable = isNullable; + Name = frameworkType.Name; + Namespace = frameworkType.Namespace!; + } + + public ExpectedCSharpType(string name, string ns, bool isNullable) + { + IsFrameworkType = false; + IsNullable = isNullable; + Name = name; + Namespace = ns; + } + + public static implicit operator ExpectedCSharpType(CSharpType type) + { + if (type.IsFrameworkType) + { + return new(type.FrameworkType, type.IsNullable); + } + else + { + return new(type.Name, type.Namespace, type.IsNullable); + } + } + } + + public record ExpectedFieldProvider(FieldModifiers Modifiers, ExpectedCSharpType Type, string Name); + + private static void AssertCSharpTypeAreEqual(ExpectedCSharpType expected, CSharpType type) + { + if (expected.IsFrameworkType) + { + Assert.IsTrue(type.IsFrameworkType); + Assert.AreEqual(expected.FrameworkType, type.FrameworkType); + } + else + { + Assert.IsFalse(type.IsFrameworkType); + Assert.AreEqual(expected.Name, type.Name); + Assert.AreEqual(expected.Namespace, type.Namespace); + } + Assert.AreEqual(expected.IsNullable, type.IsNullable); + } + + private static void AssertFieldAreEqual(ExpectedFieldProvider expected, FieldProvider field) + { + Assert.AreEqual(expected.Name, field.Name); + AssertCSharpTypeAreEqual(expected.Type, field.Type); + Assert.AreEqual(expected.Modifiers, field.Modifiers); + } + + private static void AssertHasFields(TypeProvider provider, IReadOnlyList expectedFields) + { + var fields = provider.Fields; + + // validate the length of the result + Assert.GreaterOrEqual(fields.Count, expectedFields.Count); + + // validate each of them + var fieldDict = fields.ToDictionary(f => f.Name); + for (int i = 0; i < expectedFields.Count; i++) + { + var expected = expectedFields[i]; + + Assert.IsTrue(fieldDict.TryGetValue(expected.Name, out var actual), $"Field {expected.Name} not present"); + AssertFieldAreEqual(expected, actual!); + } } } } diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs new file mode 100644 index 0000000000..3fcf6856cf --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,False,0).cs @@ -0,0 +1,6 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), Array.Empty(), Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs new file mode 100644 index 0000000000..71d1e06f4d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,False,True,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_tokenCredential = tokenCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { this.GetFakeTokenAuthorizationPolicy(_tokenCredential, AuthorizationScopes) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs new file mode 100644 index 0000000000..227fc6726b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,False,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_keyCredential = keyCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs new file mode 100644 index 0000000000..227fc6726b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_keyCredential = keyCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs new file mode 100644 index 0000000000..71d1e06f4d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithDefault,True,True,1).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_tokenCredential = tokenCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { this.GetFakeTokenAuthorizationPolicy(_tokenCredential, AuthorizationScopes) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs new file mode 100644 index 0000000000..3fcf6856cf --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,False,0).cs @@ -0,0 +1,6 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), Array.Empty(), Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs new file mode 100644 index 0000000000..71d1e06f4d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,False,True,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_tokenCredential = tokenCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { this.GetFakeTokenAuthorizationPolicy(_tokenCredential, AuthorizationScopes) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs new file mode 100644 index 0000000000..227fc6726b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,False,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_keyCredential = keyCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs new file mode 100644 index 0000000000..227fc6726b --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,0).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(keyCredential, nameof(keyCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_keyCredential = keyCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { global::System.ClientModel.Primitives.ApiKeyAuthenticationPolicy.CreateHeaderApiKeyPolicy(_keyCredential, AuthorizationHeader) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs new file mode 100644 index 0000000000..71d1e06f4d --- /dev/null +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/Providers/ClientProviders/TestData/ClientProviderTests/TestBuildConstructors_PrimaryConstructor(WithRequired,True,True,1).cs @@ -0,0 +1,8 @@ +global::Sample.Argument.AssertNotNull(endpoint, nameof(endpoint)); +global::Sample.Argument.AssertNotNull(tokenCredential, nameof(tokenCredential)); + +options ??= new global::Sample.TestClientOptions(); + +_endpoint = endpoint; +_tokenCredential = tokenCredential; +Pipeline = global::System.ClientModel.Primitives.ClientPipeline.Create(options, Array.Empty(), new global::System.ClientModel.Primitives.PipelinePolicy[] { this.GetFakeTokenAuthorizationPolicy(_tokenCredential, AuthorizationScopes) }, Array.Empty()); diff --git a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/TestHelpers/MockHelpers.cs b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/TestHelpers/MockHelpers.cs index dc80039dca..d699ff9921 100644 --- a/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/TestHelpers/MockHelpers.cs +++ b/packages/http-client-csharp/generator/Microsoft.Generator.CSharp.ClientModel/test/TestHelpers/MockHelpers.cs @@ -47,9 +47,9 @@ public static Mock LoadMockPlugin( Func>? createSerializationsCore = null, Func? createCSharpTypeCore = null, Func? matchConditionsType = null, - Func? keyCredentialType = null, Func? createParameterCore = null, Func? apiKeyAuth = null, + Func? oauth2Auth = null, Func>? apiVersions = null, Func>? inputEnums = null, Func>? inputModels = null, @@ -65,7 +65,7 @@ public static Mock LoadMockPlugin( IReadOnlyList inputNsEnums = inputEnums?.Invoke() ?? []; IReadOnlyList inputNsClients = clients?.Invoke() ?? []; IReadOnlyList inputNsModels = inputModels?.Invoke() ?? []; - InputAuth inputNsAuth = apiKeyAuth != null ? new InputAuth(apiKeyAuth(), null) : new InputAuth(); + InputAuth inputNsAuth = new InputAuth(apiKeyAuth?.Invoke(), oauth2Auth?.Invoke()); var mockTypeFactory = new Mock() { CallBase = true }; var mockInputNs = new Mock( string.Empty, @@ -82,11 +82,6 @@ public static Mock LoadMockPlugin( mockTypeFactory.Setup(p => p.MatchConditionsType).Returns(matchConditionsType); } - if (keyCredentialType is not null) - { - mockTypeFactory.Setup(p => p.KeyCredentialType).Returns(keyCredentialType); - } - if (createParameterCore is not null) { mockTypeFactory.Protected().Setup("CreateParameterCore", ItExpr.IsAny()).Returns(createParameterCore); diff --git a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs index 278862d6b0..0173263461 100644 --- a/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs +++ b/packages/http-client-csharp/generator/TestProjects/Local/Unbranded-TypeSpec/src/Generated/UnbrandedTypeSpecClient.cs @@ -17,9 +17,9 @@ namespace UnbrandedTypeSpec public partial class UnbrandedTypeSpecClient { private readonly Uri _endpoint; - private const string AuthorizationHeader = "my-api-key"; /// A credential used to authenticate to the service. private readonly ApiKeyCredential _keyCredential; + private const string AuthorizationHeader = "my-api-key"; private readonly string _apiVersion; /// Initializes a new instance of UnbrandedTypeSpecClient for mocking. From 821b7f90daa96e40decb4b422d5ab25b0d7ead4b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 17 Dec 2024 09:54:09 +0800 Subject: [PATCH 67/71] http-client-java, validate JDK and Maven (#5374) fix https://github.com/microsoft/typespec/issues/5365 run on no JDK/Maven ``` error http-client-java: Java Development Kit (JDK) is not found in PATH. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download error http-client-java: Apache Maven is not found in PATH. Apache Maven can be downloaded from https://maven.apache.org/download.cgi Found 2 errors. ``` fix https://github.com/microsoft/typespec/issues/5366 run on JDK version too old ``` error http-client-java: Java Development Kit (JDK) in PATH is version 8. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download Found 1 error. ``` Currently validation only happen on `onEmit`. I didn't add it to postinstall script, as this could be flagged as security warning. --- cspell.yaml | 1 + packages/http-client-java/README.md | 2 +- .../http-client-java/emitter/src/emitter.ts | 171 +++++++----------- .../http-client-java/emitter/src/utils.ts | 60 ++++++ .../http-client-java/emitter/src/validate.ts | 71 ++++++++ packages/http-client-java/generator/README.md | 2 +- .../generator/core/template/PomTemplate.java | 6 +- 7 files changed, 199 insertions(+), 114 deletions(-) create mode 100644 packages/http-client-java/emitter/src/validate.ts diff --git a/cspell.yaml b/cspell.yaml index 8bd06fe5d0..ecc77a9a92 100644 --- a/cspell.yaml +++ b/cspell.yaml @@ -95,6 +95,7 @@ words: - itor - ivar - Jacoco + - javac - jdwp - jobject - Johan diff --git a/packages/http-client-java/README.md b/packages/http-client-java/README.md index b36be08cae..9a68507f65 100644 --- a/packages/http-client-java/README.md +++ b/packages/http-client-java/README.md @@ -8,7 +8,7 @@ Install [Node.js](https://nodejs.org/) 20 or above. (Verify by running `node --v Install [Java](https://docs.microsoft.com/java/openjdk/download) 17 or above. (Verify by running `java --version`) -Install [Maven](https://maven.apache.org/install.html). (Verify by running `mvn --version`) +Install [Maven](https://maven.apache.org/download.cgi). (Verify by running `mvn --version`) ## Getting started diff --git a/packages/http-client-java/emitter/src/emitter.ts b/packages/http-client-java/emitter/src/emitter.ts index 8aef1d72d4..625e87e957 100644 --- a/packages/http-client-java/emitter/src/emitter.ts +++ b/packages/http-client-java/emitter/src/emitter.ts @@ -5,13 +5,13 @@ import { JSONSchemaType, resolvePath, } from "@typespec/compiler"; -import { spawn } from "child_process"; import { promises } from "fs"; import { dump } from "js-yaml"; import { dirname } from "path"; import { fileURLToPath } from "url"; import { CodeModelBuilder } from "./code-model-builder.js"; -import { logError } from "./utils.js"; +import { logError, spawnAsync } from "./utils.js"; +import { JDK_NOT_FOUND_MESSAGE, validateDependencies } from "./validate.js"; export interface EmitterOptions { namespace?: string; @@ -113,127 +113,80 @@ export const $lib = createTypeSpecLibrary({ export async function $onEmit(context: EmitContext) { const program = context.program; - const options = context.options; - if (!options["flavor"]) { - if (options["package-dir"]?.toLocaleLowerCase().startsWith("azure")) { - // Azure package - options["flavor"] = "azure"; + await validateDependencies(program, true); + + if (!program.hasError()) { + const options = context.options; + if (!options["flavor"]) { + if (options["package-dir"]?.toLocaleLowerCase().startsWith("azure")) { + // Azure package + options["flavor"] = "azure"; + } } - } - const builder = new CodeModelBuilder(program, context); - const codeModel = await builder.build(); + const builder = new CodeModelBuilder(program, context); + const codeModel = await builder.build(); - if (!program.compilerOptions.noEmit && !program.hasError()) { - const __dirname = dirname(fileURLToPath(import.meta.url)); - const moduleRoot = resolvePath(__dirname, "..", ".."); + if (!program.hasError() && !program.compilerOptions.noEmit) { + const __dirname = dirname(fileURLToPath(import.meta.url)); + const moduleRoot = resolvePath(__dirname, "..", ".."); - const outputPath = options["output-dir"] ?? context.emitterOutputDir; - options["output-dir"] = getNormalizedAbsolutePath(outputPath, undefined); + const outputPath = options["output-dir"] ?? context.emitterOutputDir; + options["output-dir"] = getNormalizedAbsolutePath(outputPath, undefined); - (options as any)["arm"] = codeModel.arm; + (options as any)["arm"] = codeModel.arm; - const codeModelFileName = resolvePath(outputPath, "./code-model.yaml"); + const codeModelFileName = resolvePath(outputPath, "./code-model.yaml"); - await promises.mkdir(outputPath, { recursive: true }).catch((err) => { - if (err.code !== "EISDIR" && err.code !== "EEXIST") { - logError(program, `Failed to create output directory: ${outputPath}`); - return; - } - }); + await promises.mkdir(outputPath, { recursive: true }).catch((err) => { + if (err.code !== "EISDIR" && err.code !== "EEXIST") { + logError(program, `Failed to create output directory: ${outputPath}`); + return; + } + }); - await program.host.writeFile(codeModelFileName, dump(codeModel)); + await program.host.writeFile(codeModelFileName, dump(codeModel)); - program.trace("http-client-java", `Code model file written to ${codeModelFileName}`); + program.trace("http-client-java", `Code model file written to ${codeModelFileName}`); - const emitterOptions = JSON.stringify(options); - program.trace("http-client-java", `Emitter options ${emitterOptions}`); + const emitterOptions = JSON.stringify(options); + program.trace("http-client-java", `Emitter options ${emitterOptions}`); - const jarFileName = resolvePath( - moduleRoot, - "generator/http-client-generator/target", - "emitter.jar", - ); - program.trace("http-client-java", `Exec JAR ${jarFileName}`); + const jarFileName = resolvePath( + moduleRoot, + "generator/http-client-generator/target", + "emitter.jar", + ); + program.trace("http-client-java", `Exec JAR ${jarFileName}`); - const javaArgs: string[] = []; - javaArgs.push(`-DemitterOptions=${emitterOptions}`); - if (options["dev-options"]?.debug) { - javaArgs.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"); - } - if (options["dev-options"]?.loglevel) { - javaArgs.push("-Dorg.slf4j.simpleLogger.defaultLogLevel=" + options["dev-options"]?.loglevel); - } - if (options["dev-options"]?.["java-temp-dir"]) { - javaArgs.push("-Dcodegen.java.temp.directory=" + options["dev-options"]?.["java-temp-dir"]); - } - javaArgs.push("-jar"); - javaArgs.push(jarFileName); - javaArgs.push(codeModelFileName); - try { - type SpawnReturns = { - stdout: string; - stderr: string; - }; - await new Promise((resolve, reject) => { - const childProcess = spawn("java", javaArgs, { stdio: "inherit" }); - - let error: Error | undefined = undefined; - - // std - const stdout: string[] = []; - const stderr: string[] = []; - if (childProcess.stdout) { - childProcess.stdout.on("data", (data) => { - stdout.push(data.toString()); - }); - } - if (childProcess.stderr) { - childProcess.stderr.on("data", (data) => { - stderr.push(data.toString()); - }); + const javaArgs: string[] = []; + javaArgs.push(`-DemitterOptions=${emitterOptions}`); + if (options["dev-options"]?.debug) { + javaArgs.push("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005"); + } + if (options["dev-options"]?.loglevel) { + javaArgs.push( + "-Dorg.slf4j.simpleLogger.defaultLogLevel=" + options["dev-options"]?.loglevel, + ); + } + if (options["dev-options"]?.["java-temp-dir"]) { + javaArgs.push("-Dcodegen.java.temp.directory=" + options["dev-options"]?.["java-temp-dir"]); + } + javaArgs.push("-jar"); + javaArgs.push(jarFileName); + javaArgs.push(codeModelFileName); + try { + await spawnAsync("java", javaArgs, { stdio: "inherit" }); + } catch (error: any) { + if (error && "code" in error && error["code"] === "ENOENT") { + logError(program, JDK_NOT_FOUND_MESSAGE); + } else { + logError(program, error.message); } - - // failed to spawn the process - childProcess.on("error", (e) => { - error = e; - }); - - // process exits with error - childProcess.on("exit", (code, signal) => { - if (code !== 0) { - if (code) { - error = new Error(`JAR ended with code '${code}'.`); - } else { - error = new Error(`JAR terminated by signal '${signal}'.`); - } - } - }); - - // close and complete Promise - childProcess.on("close", () => { - if (error) { - reject(error); - } else { - resolve({ - stdout: stdout.join(""), - stderr: stderr.join(""), - }); - } - }); - }); - - // as stdio: "inherit", std is not captured by spawn - // program.trace("http-client-java", output.stdout ? output.stdout : output.stderr); - } catch (error: any) { - if (error && "code" in error && error["code"] === "ENOENT") { - logError(program, "'java' is not on PATH. Please install JDK 11 or above."); - } else { - logError(program, error.message); } - } - if (!options["dev-options"]?.["generate-code-model"]) { - await program.host.rm(codeModelFileName); + if (!options["dev-options"]?.["generate-code-model"]) { + await program.host.rm(codeModelFileName); + } } } } diff --git a/packages/http-client-java/emitter/src/utils.ts b/packages/http-client-java/emitter/src/utils.ts index f54da2e7b1..1a13fc70fb 100644 --- a/packages/http-client-java/emitter/src/utils.ts +++ b/packages/http-client-java/emitter/src/utils.ts @@ -1,4 +1,5 @@ import { NoTarget, Program, Type } from "@typespec/compiler"; +import { spawn, SpawnOptions } from "child_process"; export function logError(program: Program, msg: string) { trace(program, msg); @@ -63,3 +64,62 @@ export function removeClientSuffix(clientName: string): string { const clientSuffix = "Client"; return clientName.endsWith(clientSuffix) ? clientName.slice(0, -clientSuffix.length) : clientName; } + +export type SpawnReturns = { + stdout: string; + stderr: string; +}; + +export async function spawnAsync( + command: string, + args: readonly string[], + options: SpawnOptions, +): Promise { + return new Promise((resolve, reject) => { + const childProcess = spawn(command, args, options); + + let error: Error | undefined = undefined; + + // std + const stdout: string[] = []; + const stderr: string[] = []; + if (childProcess.stdout) { + childProcess.stdout.on("data", (data) => { + stdout.push(data.toString()); + }); + } + if (childProcess.stderr) { + childProcess.stderr.on("data", (data) => { + stderr.push(data.toString()); + }); + } + + // failed to spawn the process + childProcess.on("error", (e) => { + error = e; + }); + + // process exits with error + childProcess.on("exit", (code, signal) => { + if (code !== 0) { + if (code) { + error = new Error(`${command} ended with code '${code}'.`); + } else { + error = new Error(`${command} terminated by signal '${signal}'.`); + } + } + }); + + // close and complete Promise + childProcess.on("close", () => { + if (error) { + reject(error); + } else { + resolve({ + stdout: stdout.join(""), + stderr: stderr.join(""), + }); + } + }); + }); +} diff --git a/packages/http-client-java/emitter/src/validate.ts b/packages/http-client-java/emitter/src/validate.ts new file mode 100644 index 0000000000..cc0bb704e8 --- /dev/null +++ b/packages/http-client-java/emitter/src/validate.ts @@ -0,0 +1,71 @@ +import { Program } from "@typespec/compiler"; +import { logError, spawnAsync } from "./utils.js"; + +export const JDK_NOT_FOUND_MESSAGE = + "Java Development Kit (JDK) is not found in PATH. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download"; + +export async function validateDependencies( + program: Program | undefined, + logDiagnostic: boolean = false, +) { + // Check JDK and version + try { + const result = await spawnAsync("javac", ["-version"], { stdio: "pipe" }); + const javaVersion = findJavaVersion(result.stdout) ?? findJavaVersion(result.stderr); + if (javaVersion) { + if (javaVersion < 11) { + // the message is JDK 17, because clientcore depends on JDK 17 + // emitter only require JDK 11 + const message = `Java Development Kit (JDK) in PATH is version ${javaVersion}. Please install JDK 17 or above. Microsoft Build of OpenJDK can be downloaded from https://learn.microsoft.com/java/openjdk/download`; + // // eslint-disable-next-line no-console + // console.log("[ERROR] " + message); + if (program && logDiagnostic) { + logError(program, message); + } + } + } + } catch (error: any) { + let message = error.message; + if (error && "code" in error && error["code"] === "ENOENT") { + message = JDK_NOT_FOUND_MESSAGE; + } + // // eslint-disable-next-line no-console + // console.log("[ERROR] " + message); + if (program && logDiagnostic) { + logError(program, message); + } + } + + // Check Maven + // nodejs does not allow spawn of .cmd on win32 + const shell = process.platform === "win32"; + try { + await spawnAsync("mvn", ["-v"], { stdio: "pipe", shell: shell }); + } catch (error: any) { + let message = error.message; + if (shell || (error && "code" in error && error["code"] === "ENOENT")) { + message = + "Apache Maven is not found in PATH. Apache Maven can be downloaded from https://maven.apache.org/download.cgi"; + } + // // eslint-disable-next-line no-console + // console.log("[ERROR] " + message); + if (program && logDiagnostic) { + logError(program, message); + } + } +} + +function findJavaVersion(output: string): number | undefined { + const regex = /javac (\d+)\.(\d+)\..*/; + const matches = output.match(regex); + if (matches && matches.length > 2) { + if (matches[1] === "1") { + // "javac 1.8.0_422" -> 8 + return +matches[2]; + } else { + // "javac 21.0.3" -> 21 + return +matches[1]; + } + } + return undefined; +} diff --git a/packages/http-client-java/generator/README.md b/packages/http-client-java/generator/README.md index 6efa989f3b..e8f687a3fa 100644 --- a/packages/http-client-java/generator/README.md +++ b/packages/http-client-java/generator/README.md @@ -11,7 +11,7 @@ The **Microsoft Java client generator** tool generates client libraries for acce ## Prerequisites - [Java 17 or above](https://docs.microsoft.com/java/openjdk/download) -- [Maven](https://maven.apache.org/install.html) +- [Maven](https://maven.apache.org/download.cgi) ## Build diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/PomTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/PomTemplate.java index cfed128e1c..6d59263b13 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/PomTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/PomTemplate.java @@ -216,9 +216,9 @@ protected void writeStandAlonePlugins(XmlBlock pluginsBlock) { pluginsBlock.block("plugin", pluginBlock -> { pluginBlock.tag("groupId", "org.apache.maven.plugins"); pluginBlock.tag("artifactId", "maven-compiler-plugin"); - pluginBlock.tag("version", "3.10.1"); + pluginBlock.tag("version", "3.13.0"); pluginBlock.block("configuration", configurationBlock -> { - configurationBlock.tag("release", "11"); + configurationBlock.tag("release", JavaSettings.getInstance().isBranded() ? "11" : "17"); }); }); @@ -226,7 +226,7 @@ protected void writeStandAlonePlugins(XmlBlock pluginsBlock) { pluginsBlock.block("plugin", pluginBlock -> { pluginBlock.tag("groupId", "org.apache.maven.plugins"); pluginBlock.tag("artifactId", "maven-source-plugin"); - pluginBlock.tag("version", "3.3.0"); + pluginBlock.tag("version", "3.3.1"); pluginBlock.block("executions", executionsBlock -> { executionsBlock.block("execution", executionBlock -> { executionBlock.tag("id", "attach-sources"); From c09f2521ceadca3dbc7ccce1ade1f5ecc4c29567 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 17 Dec 2024 13:17:51 +0800 Subject: [PATCH 68/71] http-client-java, skip xml property of required and constant, on de-serialization (#5369) fix https://github.com/microsoft/typespec/issues/5332 The property is required, and can have only 1 value. Therefore it is not settable (as there is only 1 value to set), and de-serialization does not need to set the value as well. e2e test at https://github.com/Azure/autorest.java/pull/2997 --- .../StreamSerializationModelTemplate.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java index 53cc20f72f..57a99b1395 100644 --- a/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java +++ b/packages/http-client-java/generator/http-client-generator-core/src/main/java/com/microsoft/typespec/http/client/generator/core/template/StreamSerializationModelTemplate.java @@ -2312,10 +2312,20 @@ private void writeFromXmlDeserialization(JavaBlock methodBlock) { // Loop over all properties and generate their deserialization handling. AtomicReference ifBlockReference = new AtomicReference<>(ifBlock); - propertiesManager.forEachSuperXmlElement( - element -> handleXmlPropertyDeserialization(element, whileBlock, ifBlockReference, true)); - propertiesManager.forEachXmlElement( - element -> handleXmlPropertyDeserialization(element, whileBlock, ifBlockReference, false)); + propertiesManager.forEachSuperXmlElement(element -> { + if (element.isRequired() && element.isConstant()) { + return; + } + handleXmlPropertyDeserialization(element, whileBlock, ifBlockReference, true); + }); + propertiesManager.forEachXmlElement(element -> { + if (element.isRequired() && element.isConstant()) { + // the element is element of a constant, which can only have one value + // skip de-serialize + return; + } + handleXmlPropertyDeserialization(element, whileBlock, ifBlockReference, false); + }); ifBlock = ifBlockReference.get(); From 0709202f58d8c9cdf1c5802ebcb7f07dfab52a29 Mon Sep 17 00:00:00 2001 From: Rodge Fu Date: Tue, 17 Dec 2024 14:03:46 +0800 Subject: [PATCH 69/71] Fix vulnerabilities in VS extension (#5348) fix #5293 --------- Co-authored-by: Mark Cowlishaw --- .../vs-vulnerabilities-2024-11-12-13-19-40.md | 7 ++++++ .../src/Microsoft.TypeSpec.VS.csproj | 23 +++++++++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 .chronus/changes/vs-vulnerabilities-2024-11-12-13-19-40.md diff --git a/.chronus/changes/vs-vulnerabilities-2024-11-12-13-19-40.md b/.chronus/changes/vs-vulnerabilities-2024-11-12-13-19-40.md new file mode 100644 index 0000000000..57a864d692 --- /dev/null +++ b/.chronus/changes/vs-vulnerabilities-2024-11-12-13-19-40.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - typespec-vs +--- + +Upgrade nuget packages to avoid transitive vulnerabilities \ No newline at end of file diff --git a/packages/typespec-vs/src/Microsoft.TypeSpec.VS.csproj b/packages/typespec-vs/src/Microsoft.TypeSpec.VS.csproj index 5d2bb081a1..b81c359959 100644 --- a/packages/typespec-vs/src/Microsoft.TypeSpec.VS.csproj +++ b/packages/typespec-vs/src/Microsoft.TypeSpec.VS.csproj @@ -7,6 +7,9 @@ false Latest Enable + + + all true 42.42.42 @@ -28,6 +31,10 @@ Link="TextMate/typespec.tmLanguage" /> + + + + Always @@ -40,12 +47,18 @@ + + + + - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive From 92749b7353028f66b18f16d60720e5504e758372 Mon Sep 17 00:00:00 2001 From: Rodge Fu Date: Tue, 17 Dec 2024 14:04:53 +0800 Subject: [PATCH 70/71] Support scaffolding scenario in vscode (#5294) Support scaffolding scenario in vscode whose user experience is like "tsp init". Vscode would collect information from end user and work with compiler to create new TypeSpec project underneath. fixes: #4859 --- .../vscode-scaffolding-2024-11-7-12-44-28.md | 20 + .../vscode-scaffolding-2024-11-7-12-46-5.md | 7 + .../compiler/src/core/node-host.browser.ts | 1 + packages/compiler/src/init/core-templates.ts | 24 +- .../src/init/init-template-validate.ts | 20 + packages/compiler/src/init/init.ts | 28 +- packages/compiler/src/server/server.ts | 9 +- packages/compiler/src/server/serverlib.ts | 91 ++- packages/compiler/src/server/types.ts | 37 + .../compiler/test/e2e/init-templates.e2e.ts | 7 +- packages/typespec-vscode/package.json | 46 +- .../src/code-action-provider.ts | 4 +- packages/typespec-vscode/src/const.ts | 3 - packages/typespec-vscode/src/extension.ts | 83 +- packages/typespec-vscode/src/path-utils.ts | 766 ++++++++++++++++++ packages/typespec-vscode/src/task-provider.ts | 6 +- .../src/tsp-executable-resolver.ts | 2 +- .../src/tsp-language-client.ts | 109 ++- packages/typespec-vscode/src/types.ts | 30 + packages/typespec-vscode/src/utils.ts | 225 ++++- .../src/vscode-cmd/create-tsp-project.ts | 664 +++++++++++++++ .../src/vscode-cmd/install-tsp-compiler.ts | 77 ++ .../typespec-vscode/src/vscode-command.ts | 15 - .../test/unit/extension.test.ts | 10 +- pnpm-lock.yaml | 68 +- 25 files changed, 2229 insertions(+), 123 deletions(-) create mode 100644 .chronus/changes/vscode-scaffolding-2024-11-7-12-44-28.md create mode 100644 .chronus/changes/vscode-scaffolding-2024-11-7-12-46-5.md create mode 100644 packages/compiler/src/init/init-template-validate.ts delete mode 100644 packages/typespec-vscode/src/const.ts create mode 100644 packages/typespec-vscode/src/path-utils.ts create mode 100644 packages/typespec-vscode/src/types.ts create mode 100644 packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts create mode 100644 packages/typespec-vscode/src/vscode-cmd/install-tsp-compiler.ts delete mode 100644 packages/typespec-vscode/src/vscode-command.ts diff --git a/.chronus/changes/vscode-scaffolding-2024-11-7-12-44-28.md b/.chronus/changes/vscode-scaffolding-2024-11-7-12-44-28.md new file mode 100644 index 0000000000..30710b6ee2 --- /dev/null +++ b/.chronus/changes/vscode-scaffolding-2024-11-7-12-44-28.md @@ -0,0 +1,20 @@ +--- +changeKind: feature +packages: + - typespec-vscode +--- + +Support "Create TypeSpec Project" in vscode command and EXPLORER when no folder opened +Add Setting "typespec.initTemplatesUrls" where user can configure additional template to use to create TypeSpec project +example: +``` +{ + "typespec.initTemplatesUrls": [ + { + "name": "displayName", + "url": "https://urlToTheFileContainsTemplates" + }], +} +``` +Support "Install TypeSpec Compiler/CLI globally" in vscode command to install TypeSpec compiler globally easily + diff --git a/.chronus/changes/vscode-scaffolding-2024-11-7-12-46-5.md b/.chronus/changes/vscode-scaffolding-2024-11-7-12-46-5.md new file mode 100644 index 0000000000..3c00d60b5a --- /dev/null +++ b/.chronus/changes/vscode-scaffolding-2024-11-7-12-46-5.md @@ -0,0 +1,7 @@ +--- +changeKind: feature +packages: + - "@typespec/compiler" +--- + +Add capacities in TypeSpec Language Server to support "Scaffolding new TypeSpec project" in IDE \ No newline at end of file diff --git a/packages/compiler/src/core/node-host.browser.ts b/packages/compiler/src/core/node-host.browser.ts index 2d4abccbaf..2f3b630531 100644 --- a/packages/compiler/src/core/node-host.browser.ts +++ b/packages/compiler/src/core/node-host.browser.ts @@ -1 +1,2 @@ export const NodeHost = undefined; +export const CompilerPackageRoot = undefined; diff --git a/packages/compiler/src/init/core-templates.ts b/packages/compiler/src/init/core-templates.ts index 4f1285c223..ad284f8a70 100644 --- a/packages/compiler/src/init/core-templates.ts +++ b/packages/compiler/src/init/core-templates.ts @@ -1,12 +1,22 @@ -import { readFile } from "fs/promises"; import { CompilerPackageRoot } from "../core/node-host.js"; import { resolvePath } from "../core/path-utils.js"; +import { CompilerHost } from "../index.js"; export const templatesDir = resolvePath(CompilerPackageRoot, "templates"); +export interface LoadedCoreTemplates { + readonly baseUri: string; + readonly templates: Record; +} -const content = JSON.parse(await readFile(resolvePath(templatesDir, "scaffolding.json"), "utf-8")); - -export const TypeSpecCoreTemplates = { - baseUri: templatesDir, - templates: content, -}; +let typeSpecCoreTemplates: LoadedCoreTemplates | undefined; +export async function getTypeSpecCoreTemplates(host: CompilerHost): Promise { + if (typeSpecCoreTemplates === undefined) { + const file = await host.readFile(resolvePath(templatesDir, "scaffolding.json")); + const content = JSON.parse(file.text); + typeSpecCoreTemplates = { + baseUri: templatesDir, + templates: content, + }; + } + return typeSpecCoreTemplates; +} diff --git a/packages/compiler/src/init/init-template-validate.ts b/packages/compiler/src/init/init-template-validate.ts new file mode 100644 index 0000000000..cecb28c4bd --- /dev/null +++ b/packages/compiler/src/init/init-template-validate.ts @@ -0,0 +1,20 @@ +import { createJSONSchemaValidator } from "../core/schema-validator.js"; +import { Diagnostic, NoTarget, SourceFile } from "../index.js"; +import { InitTemplateSchema } from "./init-template.js"; + +export type ValidationResult = { + valid: boolean; + diagnostics: readonly Diagnostic[]; +}; + +export function validateTemplateDefinitions( + template: unknown, + templateName: SourceFile | typeof NoTarget, + strictValidation: boolean, +): ValidationResult { + const validator = createJSONSchemaValidator(InitTemplateSchema, { + strict: strictValidation, + }); + const diagnostics = validator.validate(template, templateName); + return { valid: diagnostics.length === 0, diagnostics }; +} diff --git a/packages/compiler/src/init/init.ts b/packages/compiler/src/init/init.ts index 2b66938446..efa4b843ef 100644 --- a/packages/compiler/src/init/init.ts +++ b/packages/compiler/src/init/init.ts @@ -4,12 +4,12 @@ import prompts from "prompts"; import * as semver from "semver"; import { createDiagnostic } from "../core/messages.js"; import { getBaseFileName, getDirectoryPath } from "../core/path-utils.js"; -import { createJSONSchemaValidator } from "../core/schema-validator.js"; import { CompilerHost, Diagnostic, NoTarget, SourceFile } from "../core/types.js"; import { MANIFEST } from "../manifest.js"; import { readUrlOrPath } from "../utils/misc.js"; -import { TypeSpecCoreTemplates } from "./core-templates.js"; -import { InitTemplate, InitTemplateLibrarySpec, InitTemplateSchema } from "./init-template.js"; +import { getTypeSpecCoreTemplates } from "./core-templates.js"; +import { validateTemplateDefinitions, ValidationResult } from "./init-template-validate.js"; +import { InitTemplate, InitTemplateLibrarySpec } from "./init-template.js"; import { makeScaffoldingConfig, normalizeLibrary, scaffoldNewProject } from "./scaffold.js"; export interface InitTypeSpecProjectOptions { @@ -30,15 +30,16 @@ export async function initTypeSpecProject( // Download template configuration and prompt user to select a template // No validation is done until one has been selected + const typeSpecCoreTemplates = await getTypeSpecCoreTemplates(host); const result = options.templatesUrl === undefined - ? (TypeSpecCoreTemplates as LoadedTemplate) + ? (typeSpecCoreTemplates as LoadedTemplate) : await downloadTemplates(host, options.templatesUrl); const templateName = options.template ?? (await promptTemplateSelection(result.templates)); // Validate minimum compiler version for non built-in templates if ( - result !== TypeSpecCoreTemplates && + result !== typeSpecCoreTemplates && !(await validateTemplate(result.templates[templateName], result)) ) { return; @@ -193,11 +194,6 @@ async function promptTemplateSelection(templates: Record): Promise< return templateName; } -type ValidationResult = { - valid: boolean; - diagnostics: readonly Diagnostic[]; -}; - async function validateTemplate(template: any, loaded: LoadedTemplate): Promise { // After selection, validate the template definition const currentCompilerVersion = MANIFEST.version; @@ -278,18 +274,6 @@ export class InitTemplateError extends Error { } } -function validateTemplateDefinitions( - template: unknown, - templateName: SourceFile, - strictValidation: boolean, -): ValidationResult { - const validator = createJSONSchemaValidator(InitTemplateSchema, { - strict: strictValidation, - }); - const diagnostics = validator.validate(template, templateName); - return { valid: diagnostics.length === 0, diagnostics }; -} - function logDiagnostics(diagnostics: readonly Diagnostic[]): void { diagnostics.forEach((diagnostic) => { // eslint-disable-next-line no-console diff --git a/packages/compiler/src/server/server.ts b/packages/compiler/src/server/server.ts index e74683d0a7..0d1b61238e 100644 --- a/packages/compiler/src/server/server.ts +++ b/packages/compiler/src/server/server.ts @@ -15,7 +15,7 @@ import { import { NodeHost } from "../core/node-host.js"; import { typespecVersion } from "../utils/misc.js"; import { createServer } from "./serverlib.js"; -import { Server, ServerHost, ServerLog } from "./types.js"; +import { CustomRequestName, Server, ServerHost, ServerLog } from "./types.js"; let server: Server | undefined = undefined; @@ -129,6 +129,13 @@ function main() { connection.onExecuteCommand(profile(s.executeCommand)); connection.languages.semanticTokens.on(profile(s.buildSemanticTokens)); + const validateInitProjectTemplate: CustomRequestName = "typespec/validateInitProjectTemplate"; + connection.onRequest(validateInitProjectTemplate, profile(s.validateInitProjectTemplate)); + const getInitProjectContextRequestName: CustomRequestName = "typespec/getInitProjectContext"; + connection.onRequest(getInitProjectContextRequestName, profile(s.getInitProjectContext)); + const initProjectRequestName: CustomRequestName = "typespec/initProject"; + connection.onRequest(initProjectRequestName, profile(s.initProject)); + documents.onDidChangeContent(profile(s.checkChange)); documents.onDidClose(profile(s.documentClosed)); diff --git a/packages/compiler/src/server/serverlib.ts b/packages/compiler/src/server/serverlib.ts index eb47f25d09..eb484b0da8 100644 --- a/packages/compiler/src/server/serverlib.ts +++ b/packages/compiler/src/server/serverlib.ts @@ -50,11 +50,22 @@ import { resolveCodeFix } from "../core/code-fixes.js"; import { compilerAssert, getSourceLocation } from "../core/diagnostics.js"; import { formatTypeSpec } from "../core/formatter.js"; import { getEntityName, getTypeName } from "../core/helpers/type-name-utils.js"; -import { ProcessedLog, resolveModule, ResolveModuleHost } from "../core/index.js"; +import { + NoTarget, + ProcessedLog, + resolveModule, + ResolveModuleHost, + typespecVersion, +} from "../core/index.js"; import { formatLog } from "../core/logger/index.js"; import { getPositionBeforeTrivia } from "../core/parser-utils.js"; import { getNodeAtPosition, getNodeAtPositionDetail, visitChildren } from "../core/parser.js"; -import { ensureTrailingDirectorySeparator, getDirectoryPath } from "../core/path-utils.js"; +import { + ensureTrailingDirectorySeparator, + getDirectoryPath, + joinPaths, + normalizePath, +} from "../core/path-utils.js"; import type { Program } from "../core/program.js"; import { skipTrivia, skipWhiteSpace } from "../core/scanner.js"; import { createSourceFile, getSourceFileKindFromExt } from "../core/source-file.js"; @@ -75,6 +86,10 @@ import { TypeReferenceNode, TypeSpecScriptNode, } from "../core/types.js"; +import { getTypeSpecCoreTemplates } from "../init/core-templates.js"; +import { validateTemplateDefinitions } from "../init/init-template-validate.js"; +import { InitTemplate } from "../init/init-template.js"; +import { scaffoldNewProject } from "../init/scaffold.js"; import { getNormalizedRealPath, resolveTspMain } from "../utils/misc.js"; import { getSemanticTokens } from "./classify.js"; import { createCompileService } from "./compile-service.js"; @@ -94,9 +109,13 @@ import { } from "./type-details.js"; import { CompileResult, + InitProjectConfig, + InitProjectContext, SemanticTokenKind, Server, + ServerCustomCapacities, ServerHost, + ServerInitializeResult, ServerLog, ServerSourceFile, ServerWorkspaceFolder, @@ -162,6 +181,10 @@ export function createServer(host: ServerHost): Server { getCodeActions, executeCommand, log, + + getInitProjectContext, + validateInitProjectTemplate, + initProject, }; async function initialize(params: InitializeParams): Promise { @@ -246,7 +269,33 @@ export function createServer(host: ServerHost): Server { } log({ level: "info", message: `Workspace Folders`, detail: workspaceFolders }); - return { capabilities }; + const customCapacities: ServerCustomCapacities = { + getInitProjectContext: true, + initProject: true, + validateInitProjectTemplate: true, + }; + // the file path is expected to be .../@typespec/compiler/dist/src/server/serverlib.js + const curFile = normalizePath(compilerHost.fileURLToPath(import.meta.url)); + const SERVERLIB_PATH_ENDWITH = "/dist/src/server/serverlib.js"; + let compilerRootFolder = undefined; + if (!curFile.endsWith(SERVERLIB_PATH_ENDWITH)) { + log({ level: "warning", message: `Unexpected path for serverlib found: ${curFile}` }); + } else { + compilerRootFolder = curFile.slice(0, curFile.length - SERVERLIB_PATH_ENDWITH.length); + } + const result: ServerInitializeResult = { + serverInfo: { + name: "TypeSpec Language Server", + version: typespecVersion, + }, + capabilities, + customCapacities, + compilerRootFolder, + compilerCliJsPath: compilerRootFolder + ? joinPaths(compilerRootFolder, "cmd", "tsp.js") + : undefined, + }; + return result; } function initialized(params: InitializedParams): void { @@ -254,6 +303,42 @@ export function createServer(host: ServerHost): Server { log({ level: "info", message: "Initialization complete." }); } + async function getInitProjectContext(): Promise { + return { + coreInitTemplates: await getTypeSpecCoreTemplates(host.compilerHost), + }; + } + + async function validateInitProjectTemplate(param: { template: InitTemplate }): Promise { + const { template } = param; + // even when the strict validation fails, we still try to proceed with relaxed validation + // so just do relaxed validation directly here + const validationResult = validateTemplateDefinitions(template, NoTarget, false); + if (!validationResult.valid) { + for (const diag of validationResult.diagnostics) { + log({ + level: diag.severity, + message: diag.message, + detail: { + code: diag.code, + url: diag.url, + }, + }); + } + } + return validationResult.valid; + } + + async function initProject(param: { config: InitProjectConfig }): Promise { + try { + await scaffoldNewProject(compilerHost, param.config); + return true; + } catch (e) { + log({ level: "error", message: "Unexpected error when initializing project", detail: e }); + return false; + } + } + async function workspaceFoldersChanged(e: WorkspaceFoldersChangeEvent) { log({ level: "info", message: "Workspace Folders Changed", detail: e }); const map = new Map(workspaceFolders.map((f) => [f.uri, f])); diff --git a/packages/compiler/src/server/types.ts b/packages/compiler/src/server/types.ts index 49381f4c33..1cbf9b6905 100644 --- a/packages/compiler/src/server/types.ts +++ b/packages/compiler/src/server/types.ts @@ -38,6 +38,9 @@ import { } from "vscode-languageserver"; import { TextDocument, TextEdit } from "vscode-languageserver-textdocument"; import type { CompilerHost, Program, SourceFile, TypeSpecScriptNode } from "../core/index.js"; +import { LoadedCoreTemplates } from "../init/core-templates.js"; +import { InitTemplate, InitTemplateLibrarySpec } from "../init/init-template.js"; +import { ScaffoldingConfig } from "../init/scaffold.js"; export type ServerLogLevel = "trace" | "debug" | "info" | "warning" | "error"; export interface ServerLog { @@ -89,6 +92,15 @@ export interface Server { getCodeActions(params: CodeActionParams): Promise; executeCommand(params: ExecuteCommandParams): Promise; log(log: ServerLog): void; + + // Following custom capacities are added for supporting tsp init project from IDE (vscode for now) so that IDE can trigger compiler + // to do the real job while collecting the necessary information accordingly from the user. + // We can't do the tsp init experience by simple cli interface because the experience needs to talk + // with the compiler for multiple times in different steps (i.e. get core templates, validate the selected template, scaffold the project) + // and it's not a good idea to expose these capacity in cli interface and call cli again and again. + getInitProjectContext(): Promise; + validateInitProjectTemplate(param: { template: InitTemplate }): Promise; + initProject(param: { config: InitProjectConfig }): Promise; } export interface ServerSourceFile extends SourceFile { @@ -135,3 +147,28 @@ export interface SemanticToken { pos: number; end: number; } + +export type CustomRequestName = + | "typespec/getInitProjectContext" + | "typespec/initProject" + | "typespec/validateInitProjectTemplate"; +export interface ServerCustomCapacities { + getInitProjectContext?: boolean; + validateInitProjectTemplate?: boolean; + initProject?: boolean; +} + +export interface ServerInitializeResult extends InitializeResult { + customCapacities?: ServerCustomCapacities; + compilerRootFolder?: string; + compilerCliJsPath?: string; +} + +export interface InitProjectContext { + /** provide the default templates current compiler/cli supports */ + coreInitTemplates: LoadedCoreTemplates; +} + +export type InitProjectConfig = ScaffoldingConfig; +export type InitProjectTemplate = InitTemplate; +export type InitProjectTemplateLibrarySpec = InitTemplateLibrarySpec; diff --git a/packages/compiler/test/e2e/init-templates.e2e.ts b/packages/compiler/test/e2e/init-templates.e2e.ts index 146f2c6c9a..6ed90c3261 100644 --- a/packages/compiler/test/e2e/init-templates.e2e.ts +++ b/packages/compiler/test/e2e/init-templates.e2e.ts @@ -6,7 +6,7 @@ import { resolve } from "path/posix"; import { fileURLToPath } from "url"; import { beforeAll, describe, it } from "vitest"; import { NodeHost } from "../../src/index.js"; -import { TypeSpecCoreTemplates } from "../../src/init/core-templates.js"; +import { getTypeSpecCoreTemplates } from "../../src/init/core-templates.js"; import { makeScaffoldingConfig, scaffoldNewProject } from "../../src/init/scaffold.js"; const __dirname = dirname(fileURLToPath(import.meta.url)); @@ -64,7 +64,8 @@ describe("Init templates e2e tests", () => { }); async function scaffoldTemplateTo(name: string, targetFolder: string) { - const template = TypeSpecCoreTemplates.templates[name]; + const typeSpecCoreTemplates = await getTypeSpecCoreTemplates(NodeHost); + const template = typeSpecCoreTemplates.templates[name]; ok(template, `Template '${name}' not found`); await scaffoldNewProject( NodeHost, @@ -72,7 +73,7 @@ describe("Init templates e2e tests", () => { name, folderName: name, directory: targetFolder, - baseUri: TypeSpecCoreTemplates.baseUri, + baseUri: typeSpecCoreTemplates.baseUri, }), ); } diff --git a/packages/typespec-vscode/package.json b/packages/typespec-vscode/package.json index 722b29702e..52fc4e906b 100644 --- a/packages/typespec-vscode/package.json +++ b/packages/typespec-vscode/package.json @@ -32,10 +32,18 @@ "activationEvents": [ "onLanguage:typespec", "onCommand:typespec.restartServer", + "onCommand:typespec.createProject", "workspaceContains:**/tspconfig.yaml" ], "icon": "./icons/logo.png", "contributes": { + "viewsWelcome": [ + { + "view": "explorer", + "contents": "You may [open a folder](command:vscode.openFolder) of an existing TypeSpec project; or create a new TypeSpec project in VS Code.\n[Create TypeSpec Project](command:typespec.createProject)\nTo manually create a TypeSpec project, follow [this guide](https://typespec.io/docs/).", + "when": "!workspaceFolderCount" + } + ], "languages": [ { "id": "typespec", @@ -66,6 +74,30 @@ "description": "Path to `tsp-server` command that runs the TypeSpec language server.\n\nIf not specified, then `tsp-server` found on PATH is used.\n\nExample (User): /usr/local/bin/tsp-server\nExample (Workspace): ${workspaceFolder}/node_modules/@typespec/compiler", "scope": "machine-overridable" }, + "typespec.initTemplatesUrls": { + "type": "array", + "default": [], + "description": "List of URLs to fetch templates from when creating a new project.", + "scope": "machine-overridable", + "items": { + "type": "object", + "required": [ + "name", + "url" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the template." + }, + "url": { + "type": "string", + "description": "URL to fetch the template from." + } + }, + "additionalProperties": false + } + }, "typespec.trace.server": { "scope": "window", "type": "string", @@ -108,6 +140,16 @@ "command": "typespec.showOutputChannel", "title": "Show Output Channel", "category": "TypeSpec" + }, + { + "command": "typespec.createProject", + "title": "Create TypeSpec Project", + "category": "TypeSpec" + }, + { + "command": "typespec.installGlobalCompilerCli", + "title": "Install TypeSpec Compiler/CLI globally", + "category": "TypeSpec" } ], "semanticTokenScopes": [ @@ -173,6 +215,7 @@ "@types/mocha": "^10.0.9", "@types/node": "~22.7.9", "@types/vscode": "~1.94.0", + "@types/semver": "^7.5.8", "@typespec/compiler": "workspace:~", "@typespec/internal-build-utils": "workspace:~", "@vitest/coverage-v8": "^2.1.5", @@ -185,6 +228,7 @@ "rollup": "~4.24.0", "typescript": "~5.6.3", "vitest": "^2.1.5", - "vscode-languageclient": "~9.0.1" + "vscode-languageclient": "~9.0.1", + "semver": "^7.6.3" } } diff --git a/packages/typespec-vscode/src/code-action-provider.ts b/packages/typespec-vscode/src/code-action-provider.ts index 803242b392..218c765f5d 100644 --- a/packages/typespec-vscode/src/code-action-provider.ts +++ b/packages/typespec-vscode/src/code-action-provider.ts @@ -1,5 +1,5 @@ import vscode from "vscode"; -import { OPEN_URL_COMMAND } from "./vscode-command.js"; +import { CommandName } from "./types.js"; export function createCodeActionProvider() { return vscode.languages.registerCodeActionsProvider( @@ -61,7 +61,7 @@ export class TypeSpecCodeActionProvider implements vscode.CodeActionProvider { vscode.CodeActionKind.QuickFix, ); action.command = { - command: OPEN_URL_COMMAND, + command: CommandName.OpenUrl, title: diagnostic.message, arguments: [url], }; diff --git a/packages/typespec-vscode/src/const.ts b/packages/typespec-vscode/src/const.ts deleted file mode 100644 index c2d3e7cec6..0000000000 --- a/packages/typespec-vscode/src/const.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const enum SettingName { - TspServerPath = "typespec.tsp-server.path", -} diff --git a/packages/typespec-vscode/src/extension.ts b/packages/typespec-vscode/src/extension.ts index 7fe2a5f468..6495b6bbd0 100644 --- a/packages/typespec-vscode/src/extension.ts +++ b/packages/typespec-vscode/src/extension.ts @@ -1,12 +1,19 @@ import vscode, { commands, ExtensionContext } from "vscode"; +import { State } from "vscode-languageclient"; import { createCodeActionProvider } from "./code-action-provider.js"; -import { SettingName } from "./const.js"; import { ExtensionLogListener } from "./log/extension-log-listener.js"; import logger from "./log/logger.js"; import { TypeSpecLogOutputChannel } from "./log/typespec-log-output-channel.js"; import { createTaskProvider } from "./task-provider.js"; import { TspLanguageClient } from "./tsp-language-client.js"; -import { createCommandOpenUrl } from "./vscode-command.js"; +import { + CommandName, + InstallGlobalCliCommandArgs, + RestartServerCommandArgs, + SettingName, +} from "./types.js"; +import { createTypeSpecProject } from "./vscode-cmd/create-tsp-project.js"; +import { installCompilerGlobally } from "./vscode-cmd/install-tsp-compiler.js"; let client: TspLanguageClient | undefined; /** @@ -20,30 +27,72 @@ export async function activate(context: ExtensionContext) { context.subscriptions.push(createTaskProvider()); context.subscriptions.push(createCodeActionProvider()); - context.subscriptions.push(createCommandOpenUrl()); context.subscriptions.push( - commands.registerCommand("typespec.showOutputChannel", () => { + commands.registerCommand(CommandName.ShowOutputChannel, () => { outputChannel.show(true /*preserveFocus*/); }), ); context.subscriptions.push( - commands.registerCommand("typespec.restartServer", async () => { - if (client) { - await client.restart(); + commands.registerCommand(CommandName.OpenUrl, (url: string) => { + try { + vscode.env.openExternal(vscode.Uri.parse(url)); + } catch (error) { + logger.error(`Failed to open URL: ${url}`, [error as any]); } }), ); + context.subscriptions.push( + commands.registerCommand( + CommandName.RestartServer, + async (args: RestartServerCommandArgs | undefined): Promise => { + return vscode.window.withProgress( + { + title: "Restarting TypeSpec language service...", + location: vscode.ProgressLocation.Notification, + }, + async () => { + if (args?.forceRecreate === true) { + logger.info("Forcing to recreate TypeSpec LSP server..."); + return await recreateLSPClient(context, args?.popupRecreateLspError); + } + if (client && client.state === State.Running) { + await client.restart(); + return client; + } else { + logger.info( + "TypeSpec LSP server is not running which is not expected, try to recreate and start...", + ); + return recreateLSPClient(context, args?.popupRecreateLspError); + } + }, + ); + }, + ), + ); + + context.subscriptions.push( + commands.registerCommand( + CommandName.InstallGlobalCompilerCli, + async (args: InstallGlobalCliCommandArgs | undefined) => { + return await installCompilerGlobally(args); + }, + ), + ); + + context.subscriptions.push( + commands.registerCommand(CommandName.CreateProject, async () => { + await createTypeSpecProject(client); + }), + ); + context.subscriptions.push( vscode.workspace.onDidChangeConfiguration(async (e: vscode.ConfigurationChangeEvent) => { if (e.affectsConfiguration(SettingName.TspServerPath)) { logger.info("TypeSpec server path changed, restarting server..."); - const oldClient = client; - client = await TspLanguageClient.create(context, outputChannel); - await oldClient?.stop(); - await client.start(); + await recreateLSPClient(context); } }), ); @@ -54,8 +103,7 @@ export async function activate(context: ExtensionContext) { location: vscode.ProgressLocation.Notification, }, async () => { - client = await TspLanguageClient.create(context, outputChannel); - await client.start(); + await recreateLSPClient(context); }, ); } @@ -63,3 +111,12 @@ export async function activate(context: ExtensionContext) { export async function deactivate() { await client?.stop(); } + +async function recreateLSPClient(context: ExtensionContext, showPopupWhenError?: boolean) { + logger.info("Recreating TypeSpec LSP server..."); + const oldClient = client; + client = await TspLanguageClient.create(context, outputChannel); + await oldClient?.stop(); + await client.start(showPopupWhenError ?? (vscode.workspace.workspaceFolders?.length ?? 0) > 0); + return client; +} diff --git a/packages/typespec-vscode/src/path-utils.ts b/packages/typespec-vscode/src/path-utils.ts new file mode 100644 index 0000000000..4235b83303 --- /dev/null +++ b/packages/typespec-vscode/src/path-utils.ts @@ -0,0 +1,766 @@ +// Use the same path-utils as compiler (packages\compiler\src\core\path-utils.ts) to make sure we are using the same path resolution logic. +// Forked from https://github.com/microsoft/TypeScript/blob/663b19fe4a7c4d4ddaa61aedadd28da06acd27b6/src/compiler/path.ts + +/** + * Internally, we represent paths as strings with '/' as the directory separator. + * When we make system calls (eg: LanguageServiceHost.getDirectory()), + * we expect the host to correctly handle paths in our specified format. + */ +export const directorySeparator = "/"; +export const altDirectorySeparator = "\\"; +const urlSchemeSeparator = "://"; +const backslashRegExp = /\\/g; +const relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/; + +//#region Path Tests +/** + * Determines whether a charCode corresponds to `/` or `\`. + */ +export function isAnyDirectorySeparator(charCode: number): boolean { + return charCode === CharacterCodes.slash || charCode === CharacterCodes.backslash; +} + +/** + * Determines whether a path starts with a URL scheme (e.g. starts with `http://`, `ftp://`, `file://`, etc.). + */ +export function isUrl(path: string) { + return getEncodedRootLength(path) < 0; +} + +/* + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * isPathAbsolute("/path/to/file.ext") === true + * // DOS + * isPathAbsolute("c:/path/to/file.ext") === true + * // URL + * isPathAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * isPathAbsolute("path/to/file.ext") === false + * isPathAbsolute("./path/to/file.ext") === false + * ``` + */ +export function isPathAbsolute(path: string): boolean { + return getEncodedRootLength(path) !== 0; +} +//#endregion + +//#region Path Parsing + +function isVolumeCharacter(charCode: number) { + return ( + (charCode >= CharacterCodes.a && charCode <= CharacterCodes.z) || + (charCode >= CharacterCodes.A && charCode <= CharacterCodes.Z) + ); +} + +function getFileUrlVolumeSeparatorEnd(url: string, start: number) { + const ch0 = url.charCodeAt(start); + if (ch0 === CharacterCodes.colon) return start + 1; + if (ch0 === CharacterCodes.percent && url.charCodeAt(start + 1) === CharacterCodes._3) { + const ch2 = url.charCodeAt(start + 2); + if (ch2 === CharacterCodes.a || ch2 === CharacterCodes.A) return start + 3; + } + return -1; +} + +/** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * + * For example: + * ```ts + * getRootLength("a") === 0 // "" + * getRootLength("/") === 1 // "/" + * getRootLength("c:") === 2 // "c:" + * getRootLength("c:d") === 0 // "" + * getRootLength("c:/") === 3 // "c:/" + * getRootLength("c:\\") === 3 // "c:\\" + * getRootLength("//server") === 7 // "//server" + * getRootLength("//server/share") === 8 // "//server/" + * getRootLength("\\\\server") === 7 // "\\\\server" + * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" + * getRootLength("file:///path") === 8 // "file:///" + * getRootLength("file:///c:") === 10 // "file:///c:" + * getRootLength("file:///c:d") === 8 // "file:///" + * getRootLength("file:///c:/path") === 11 // "file:///c:/" + * getRootLength("file://server") === 13 // "file://server" + * getRootLength("file://server/path") === 14 // "file://server/" + * getRootLength("http://server") === 13 // "http://server" + * getRootLength("http://server/path") === 14 // "http://server/" + * ``` + */ +export function getRootLength(path: string) { + const rootLength = getEncodedRootLength(path); + return rootLength < 0 ? ~rootLength : rootLength; +} +/** + * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). + * If the root is part of a URL, the twos-complement of the root length is returned. + */ +function getEncodedRootLength(path: string): number { + if (!path) return 0; + const ch0 = path.charCodeAt(0); + + // POSIX or UNC + if (ch0 === CharacterCodes.slash || ch0 === CharacterCodes.backslash) { + if (path.charCodeAt(1) !== ch0) return 1; // POSIX: "/" (or non-normalized "\") + + const p1 = path.indexOf( + ch0 === CharacterCodes.slash ? directorySeparator : altDirectorySeparator, + 2, + ); + if (p1 < 0) return path.length; // UNC: "//server" or "\\server" + + return p1 + 1; // UNC: "//server/" or "\\server\" + } + + // DOS + if (isVolumeCharacter(ch0) && path.charCodeAt(1) === CharacterCodes.colon) { + const ch2 = path.charCodeAt(2); + if (ch2 === CharacterCodes.slash || ch2 === CharacterCodes.backslash) return 3; // DOS: "c:/" or "c:\" + if (path.length === 2) return 2; // DOS: "c:" (but not "c:d") + } + + // URL + const schemeEnd = path.indexOf(urlSchemeSeparator); + if (schemeEnd !== -1) { + const authorityStart = schemeEnd + urlSchemeSeparator.length; + const authorityEnd = path.indexOf(directorySeparator, authorityStart); + if (authorityEnd !== -1) { + // URL: "file:///", "file://server/", "file://server/path" + // For local "file" URLs, include the leading DOS volume (if present). + // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a + // special case interpreted as "the machine from which the URL is being interpreted". + const scheme = path.slice(0, schemeEnd); + const authority = path.slice(authorityStart, authorityEnd); + if ( + scheme === "file" && + (authority === "" || authority === "localhost") && + isVolumeCharacter(path.charCodeAt(authorityEnd + 1)) + ) { + const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2); + if (volumeSeparatorEnd !== -1) { + if (path.charCodeAt(volumeSeparatorEnd) === CharacterCodes.slash) { + // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/" + return ~(volumeSeparatorEnd + 1); + } + if (volumeSeparatorEnd === path.length) { + // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a" + // but not "file:///c:d" or "file:///c%3ad" + return ~volumeSeparatorEnd; + } + } + } + return ~(authorityEnd + 1); // URL: "file://server/", "http://server/" + } + return ~path.length; // URL: "file://server", "http://server" + } + + // relative + return 0; +} + +export function getDirectoryPath(path: string): string { + path = normalizeSlashes(path); + + // If the path provided is itself the root, then return it. + const rootLength = getRootLength(path); + if (rootLength === path.length) return path; + + // return the leading portion of the path up to the last (non-terminal) directory separator + // but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(0, Math.max(rootLength, path.lastIndexOf(directorySeparator))); +} + +/** + * Returns the path except for its containing directory name. + * Semantics align with NodeJS's `path.basename` except that we support URL's as well. + * + * ```ts + * // POSIX + * getBaseFileName("/path/to/file.ext") === "file.ext" + * getBaseFileName("/path/to/") === "to" + * getBaseFileName("/") === "" + * // DOS + * getBaseFileName("c:/path/to/file.ext") === "file.ext" + * getBaseFileName("c:/path/to/") === "to" + * getBaseFileName("c:/") === "" + * getBaseFileName("c:") === "" + * // URL + * getBaseFileName("http://typescriptlang.org/path/to/file.ext") === "file.ext" + * getBaseFileName("http://typescriptlang.org/path/to/") === "to" + * getBaseFileName("http://typescriptlang.org/") === "" + * getBaseFileName("http://typescriptlang.org") === "" + * getBaseFileName("file://server/path/to/file.ext") === "file.ext" + * getBaseFileName("file://server/path/to/") === "to" + * getBaseFileName("file://server/") === "" + * getBaseFileName("file://server") === "" + * getBaseFileName("file:///path/to/file.ext") === "file.ext" + * getBaseFileName("file:///path/to/") === "to" + * getBaseFileName("file:///") === "" + * getBaseFileName("file://") === "" + * ``` + */ +export function getBaseFileName(path: string): string { + path = normalizeSlashes(path); + + // if the path provided is itself the root, then it has not file name. + const rootLength = getRootLength(path); + if (rootLength === path.length) return ""; + + // return the trailing portion of the path starting after the last (non-terminal) directory + // separator but not including any trailing directory separator. + path = removeTrailingDirectorySeparator(path); + return path.slice(Math.max(getRootLength(path), path.lastIndexOf(directorySeparator) + 1)); +} + +/** + * Gets the file extension for a path. + * Normalizes it to lower case. + * + * ```ts + * getAnyExtensionFromPath("/path/to/file.ext") === ".ext" + * getAnyExtensionFromPath("/path/to/file.ext/") === ".ext" + * getAnyExtensionFromPath("/path/to/file") === "" + * getAnyExtensionFromPath("/path/to.ext/file") === "" + * ``` + */ +export function getAnyExtensionFromPath(path: string): string { + // Retrieves any string from the final "." onwards from a base file name. + // Unlike extensionFromPath, which throws an exception on unrecognized extensions. + const baseFileName = getBaseFileName(path); + const extensionIndex = baseFileName.lastIndexOf("."); + if (extensionIndex >= 0) { + return baseFileName.substring(extensionIndex).toLowerCase(); + } + return ""; +} + +function pathComponents(path: string, rootLength: number) { + const root = path.substring(0, rootLength); + const rest = path.substring(rootLength).split(directorySeparator); + if (rest.length && !rest[rest.length - 1]) rest.pop(); + return [root, ...rest]; +} + +/** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is not normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * // POSIX + * getPathComponents("/path/to/file.ext") === ["/", "path", "to", "file.ext"] + * getPathComponents("/path/to/") === ["/", "path", "to"] + * getPathComponents("/") === ["/"] + * // DOS + * getPathComponents("c:/path/to/file.ext") === ["c:/", "path", "to", "file.ext"] + * getPathComponents("c:/path/to/") === ["c:/", "path", "to"] + * getPathComponents("c:/") === ["c:/"] + * getPathComponents("c:") === ["c:"] + * // URL + * getPathComponents("http://typescriptlang.org/path/to/file.ext") === ["http://typescriptlang.org/", "path", "to", "file.ext"] + * getPathComponents("http://typescriptlang.org/path/to/") === ["http://typescriptlang.org/", "path", "to"] + * getPathComponents("http://typescriptlang.org/") === ["http://typescriptlang.org/"] + * getPathComponents("http://typescriptlang.org") === ["http://typescriptlang.org"] + * getPathComponents("file://server/path/to/file.ext") === ["file://server/", "path", "to", "file.ext"] + * getPathComponents("file://server/path/to/") === ["file://server/", "path", "to"] + * getPathComponents("file://server/") === ["file://server/"] + * getPathComponents("file://server") === ["file://server"] + * getPathComponents("file:///path/to/file.ext") === ["file:///", "path", "to", "file.ext"] + * getPathComponents("file:///path/to/") === ["file:///", "path", "to"] + * getPathComponents("file:///") === ["file:///"] + * getPathComponents("file://") === ["file://"] + * ``` + */ +export function getPathComponents(path: string, currentDirectory = "") { + path = joinPaths(currentDirectory, path); + return pathComponents(path, getRootLength(path)); +} + +//#endregion + +//#region Path Formatting +/** + * Reduce an array of path components to a more simplified path by navigating any + * `"."` or `".."` entries in the path. + */ +export function reducePathComponents(components: readonly string[]) { + if (!components.some((x) => x !== undefined)) return []; + const reduced = [components[0]]; + for (let i = 1; i < components.length; i++) { + const component = components[i]; + if (!component) continue; + if (component === ".") continue; + if (component === "..") { + if (reduced.length > 1) { + if (reduced[reduced.length - 1] !== "..") { + reduced.pop(); + continue; + } + } else if (reduced[0]) continue; + } + reduced.push(component); + } + return reduced; +} + +/** + * Combines paths. If a path is absolute, it replaces any previous path. Relative paths are not simplified. + * + * ```ts + * // Non-rooted + * joinPaths("path", "to", "file.ext") === "path/to/file.ext" + * joinPaths("path", "dir", "..", "to", "file.ext") === "path/dir/../to/file.ext" + * // POSIX + * joinPaths("/path", "to", "file.ext") === "/path/to/file.ext" + * joinPaths("/path", "/to", "file.ext") === "/to/file.ext" + * // DOS + * joinPaths("c:/path", "to", "file.ext") === "c:/path/to/file.ext" + * joinPaths("c:/path", "c:/to", "file.ext") === "c:/to/file.ext" + * // URL + * joinPaths("file:///path", "to", "file.ext") === "file:///path/to/file.ext" + * joinPaths("file:///path", "file:///to", "file.ext") === "file:///to/file.ext" + * ``` + */ +export function joinPaths(path: string, ...paths: (string | undefined)[]): string { + if (path) path = normalizeSlashes(path); + for (let relativePath of paths) { + if (!relativePath) continue; + relativePath = normalizeSlashes(relativePath); + if (!path || getRootLength(relativePath) !== 0) { + path = relativePath; + } else { + path = ensureTrailingDirectorySeparator(path) + relativePath; + } + } + return path; +} + +/** + * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any + * `.` and `..` path components are resolved. Trailing directory separators are preserved. + * + * ```ts + * resolvePath("/path", "to", "file.ext") === "path/to/file.ext" + * resolvePath("/path", "to", "file.ext/") === "path/to/file.ext/" + * resolvePath("/path", "dir", "..", "to", "file.ext") === "path/to/file.ext" + * ``` + */ +export function resolvePath(path: string, ...paths: (string | undefined)[]): string { + return normalizePath( + paths.some((x) => x !== undefined) ? joinPaths(path, ...paths) : normalizeSlashes(path), + ); +} + +/** + * Parse a path into an array containing a root component (at index 0) and zero or more path + * components (at indices > 0). The result is normalized. + * If the path is relative, the root component is `""`. + * If the path is absolute, the root component includes the first path separator (`/`). + * + * ```ts + * getNormalizedPathComponents("to/dir/../file.ext", "/path/") === ["/", "path", "to", "file.ext"] + * ``` + */ +export function getNormalizedPathComponents(path: string, currentDirectory: string | undefined) { + return reducePathComponents(getPathComponents(path, currentDirectory)); +} + +export function getNormalizedAbsolutePath(fileName: string, currentDirectory: string | undefined) { + return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory)); +} + +export function normalizePath(path: string): string { + path = normalizeSlashes(path); + // Most paths don't require normalization + if (!relativePathSegmentRegExp.test(path)) { + return path; + } + // Some paths only require cleanup of `/./` or leading `./` + const simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, ""); + if (simplified !== path) { + path = simplified; + if (!relativePathSegmentRegExp.test(path)) { + return path; + } + } + // Other paths require full normalization + const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path))); + return normalized && hasTrailingDirectorySeparator(path) + ? ensureTrailingDirectorySeparator(normalized) + : normalized; +} + +//#endregion + +function getPathWithoutRoot(pathComponents: readonly string[]) { + if (pathComponents.length === 0) return ""; + return pathComponents.slice(1).join(directorySeparator); +} + +export function getNormalizedAbsolutePathWithoutRoot( + fileName: string, + currentDirectory: string | undefined, +) { + return getPathWithoutRoot(getNormalizedPathComponents(fileName, currentDirectory)); +} + +/** + * Formats a parsed path consisting of a root component (at index 0) and zero or more path + * segments (at indices > 0). + * + * ```ts + * getPathFromPathComponents(["/", "path", "to", "file.ext"]) === "/path/to/file.ext" + * ``` + */ +export function getPathFromPathComponents(pathComponents: readonly string[]) { + if (pathComponents.length === 0) return ""; + + const root = pathComponents[0] && ensureTrailingDirectorySeparator(pathComponents[0]); + return root + pathComponents.slice(1).join(directorySeparator); +} + +//#region Path mutation +/** + * Removes a trailing directory separator from a path, if it does not already have one. + * + * ```ts + * removeTrailingDirectorySeparator("/path/to/file.ext") === "/path/to/file.ext" + * removeTrailingDirectorySeparator("/path/to/file.ext/") === "/path/to/file.ext" + * ``` + */ +export function removeTrailingDirectorySeparator(path: string): string; +export function removeTrailingDirectorySeparator(path: string) { + if (hasTrailingDirectorySeparator(path)) { + return path.substring(0, path.length - 1); + } + + return path; +} + +export function ensureTrailingDirectorySeparator(path: string): string { + if (!hasTrailingDirectorySeparator(path)) { + return path + directorySeparator; + } + + return path; +} + +/** + * Determines whether a path has a trailing separator (`/` or `\\`). + */ +export function hasTrailingDirectorySeparator(path: string) { + return path.length > 0 && isAnyDirectorySeparator(path.charCodeAt(path.length - 1)); +} + +/** + * Normalize path separators, converting `\` into `/`. + */ +export function normalizeSlashes(path: string): string { + const index = path.indexOf("\\"); + if (index === -1) { + return path; + } + backslashRegExp.lastIndex = index; // prime regex with known position + return path.replace(backslashRegExp, directorySeparator); +} + +//#endregion +// #region relative paths +type GetCanonicalFileName = (fileName: string) => string; + +/** @internal */ +function equateValues(a: T, b: T) { + return a === b; +} + +/** + * Compare the equality of two strings using a case-sensitive ordinal comparison. + * + * Case-sensitive comparisons compare both strings one code-point at a time using the integer + * value of each code-point after applying `toUpperCase` to each string. We always map both + * strings to their upper-case form as some unicode characters do not properly round-trip to + * lowercase (such as `ẞ` (German sharp capital s)). + * + * @internal + */ +function equateStringsCaseInsensitive(a: string, b: string) { + return a === b || (a !== undefined && b !== undefined && a.toUpperCase() === b.toUpperCase()); +} + +/** + * Compare the equality of two strings using a case-sensitive ordinal comparison. + * + * Case-sensitive comparisons compare both strings one code-point at a time using the + * integer value of each code-point. + * + * @internal + */ +function equateStringsCaseSensitive(a: string, b: string) { + return equateValues(a, b); +} + +/** + * Returns its argument. + * + * @internal + */ +function identity(x: T) { + return x; +} + +/** + * Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). + * + * ```ts + * // POSIX + * pathIsAbsolute("/path/to/file.ext") === true + * // DOS + * pathIsAbsolute("c:/path/to/file.ext") === true + * // URL + * pathIsAbsolute("file:///path/to/file.ext") === true + * // Non-absolute + * pathIsAbsolute("path/to/file.ext") === false + * pathIsAbsolute("./path/to/file.ext") === false + * ``` + * + * @internal + */ +function pathIsAbsolute(path: string): boolean { + return getEncodedRootLength(path) !== 0; +} + +/** + * Determines whether a path starts with a relative path component (i.e. `.` or `..`). + * + * @internal + */ +function pathIsRelative(path: string): boolean { + return /^\.\.?($|[\\/])/.test(path); +} + +/** + * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed + * with `./` or `../`) so as not to be confused with an unprefixed module name. + * + * ```ts + * ensurePathIsNonModuleName("/path/to/file.ext") === "/path/to/file.ext" + * ensurePathIsNonModuleName("./path/to/file.ext") === "./path/to/file.ext" + * ensurePathIsNonModuleName("../path/to/file.ext") === "../path/to/file.ext" + * ensurePathIsNonModuleName("path/to/file.ext") === "./path/to/file.ext" + * ``` + * + * @internal + */ +export function ensurePathIsNonModuleName(path: string): string { + return !pathIsAbsolute(path) && !pathIsRelative(path) ? "./" + path : path; +} + +/** @internal */ +function getPathComponentsRelativeTo( + from: string, + to: string, + stringEqualityComparer: (a: string, b: string) => boolean, + getCanonicalFileName: GetCanonicalFileName, +) { + const fromComponents = reducePathComponents(getPathComponents(from)); + const toComponents = reducePathComponents(getPathComponents(to)); + + let start: number; + for (start = 0; start < fromComponents.length && start < toComponents.length; start++) { + const fromComponent = getCanonicalFileName(fromComponents[start]); + const toComponent = getCanonicalFileName(toComponents[start]); + const comparer = start === 0 ? equateStringsCaseInsensitive : stringEqualityComparer; + if (!comparer(fromComponent, toComponent)) break; + } + + if (start === 0) { + return toComponents; + } + + const components = toComponents.slice(start); + const relative: string[] = []; + for (; start < fromComponents.length; start++) { + relative.push(".."); + } + return ["", ...relative, ...components]; +} + +/** + * Gets a relative path that can be used to traverse between `from` and `to`. + */ +export function getRelativePathFromDirectory(from: string, to: string, ignoreCase: boolean): string; +/** + * Gets a relative path that can be used to traverse between `from` and `to`. + */ +export function getRelativePathFromDirectory( + fromDirectory: string, + to: string, + getCanonicalFileName: GetCanonicalFileName, +): string; +export function getRelativePathFromDirectory( + fromDirectory: string, + to: string, + getCanonicalFileNameOrIgnoreCase: GetCanonicalFileName | boolean, +) { + if (getRootLength(fromDirectory) > 0 !== getRootLength(to) > 0) { + throw new Error("Paths must either both be absolute or both be relative"); + } + const getCanonicalFileName = + typeof getCanonicalFileNameOrIgnoreCase === "function" + ? getCanonicalFileNameOrIgnoreCase + : identity; + const ignoreCase = + typeof getCanonicalFileNameOrIgnoreCase === "boolean" + ? getCanonicalFileNameOrIgnoreCase + : false; + const pathComponents = getPathComponentsRelativeTo( + fromDirectory, + to, + ignoreCase ? equateStringsCaseInsensitive : equateStringsCaseSensitive, + getCanonicalFileName, + ); + return getPathFromPathComponents(pathComponents); +} + +// #endregion +const enum CharacterCodes { + nullCharacter = 0, + maxAsciiCharacter = 0x7f, + + lineFeed = 0x0a, // \n + carriageReturn = 0x0d, // \r + lineSeparator = 0x2028, + paragraphSeparator = 0x2029, + nextLine = 0x0085, + + // Unicode 3.0 space characters + space = 0x0020, // " " + nonBreakingSpace = 0x00a0, // + enQuad = 0x2000, + emQuad = 0x2001, + enSpace = 0x2002, + emSpace = 0x2003, + threePerEmSpace = 0x2004, + fourPerEmSpace = 0x2005, + sixPerEmSpace = 0x2006, + figureSpace = 0x2007, + punctuationSpace = 0x2008, + thinSpace = 0x2009, + hairSpace = 0x200a, + zeroWidthSpace = 0x200b, + narrowNoBreakSpace = 0x202f, + ideographicSpace = 0x3000, + mathematicalSpace = 0x205f, + ogham = 0x1680, + + _ = 0x5f, + $ = 0x24, + + _0 = 0x30, + _1 = 0x31, + _2 = 0x32, + _3 = 0x33, + _4 = 0x34, + _5 = 0x35, + _6 = 0x36, + _7 = 0x37, + _8 = 0x38, + _9 = 0x39, + + a = 0x61, + b = 0x62, + c = 0x63, + d = 0x64, + e = 0x65, + f = 0x66, + g = 0x67, + h = 0x68, + i = 0x69, + j = 0x6a, + k = 0x6b, + l = 0x6c, + m = 0x6d, + n = 0x6e, + o = 0x6f, + p = 0x70, + q = 0x71, + r = 0x72, + s = 0x73, + t = 0x74, + u = 0x75, + v = 0x76, + w = 0x77, + x = 0x78, + y = 0x79, + z = 0x7a, + + A = 0x41, + B = 0x42, + C = 0x43, + D = 0x44, + E = 0x45, + F = 0x46, + G = 0x47, + H = 0x48, + I = 0x49, + J = 0x4a, + K = 0x4b, + L = 0x4c, + M = 0x4d, + N = 0x4e, + O = 0x4f, + P = 0x50, + Q = 0x51, + R = 0x52, + S = 0x53, + T = 0x54, + U = 0x55, + V = 0x56, + W = 0x57, + X = 0x58, + Y = 0x59, + Z = 0x5a, + + ampersand = 0x26, // & + asterisk = 0x2a, // * + at = 0x40, // @ + backslash = 0x5c, // \ + backtick = 0x60, // ` + bar = 0x7c, // | + caret = 0x5e, // ^ + closeBrace = 0x7d, // } + closeBracket = 0x5d, // ] + closeParen = 0x29, // ) + colon = 0x3a, // : + comma = 0x2c, // , + dot = 0x2e, // . + doubleQuote = 0x22, // " + equals = 0x3d, // = + exclamation = 0x21, // ! + greaterThan = 0x3e, // > + hash = 0x23, // # + lessThan = 0x3c, // < + minus = 0x2d, // - + openBrace = 0x7b, // { + openBracket = 0x5b, // [ + openParen = 0x28, // ( + percent = 0x25, // % + plus = 0x2b, // + + question = 0x3f, // ? + semicolon = 0x3b, // ; + singleQuote = 0x27, // ' + slash = 0x2f, // / + tilde = 0x7e, // ~ + + backspace = 0x08, // \b + formFeed = 0x0c, // \f + byteOrderMark = 0xfeff, + tab = 0x09, // \t + verticalTab = 0x0b, // \v +} diff --git a/packages/typespec-vscode/src/task-provider.ts b/packages/typespec-vscode/src/task-provider.ts index 08cd0a8355..39d8da558e 100644 --- a/packages/typespec-vscode/src/task-provider.ts +++ b/packages/typespec-vscode/src/task-provider.ts @@ -2,8 +2,8 @@ import { resolve } from "path"; import vscode, { workspace } from "vscode"; import { Executable } from "vscode-languageclient/node.js"; import logger from "./log/logger.js"; +import { normalizeSlashes } from "./path-utils.js"; import { resolveTypeSpecCli } from "./tsp-executable-resolver.js"; -import { normalizeSlash } from "./utils.js"; import { VSCodeVariableResolver } from "./vscode-variable-resolver.js"; export function createTaskProvider() { @@ -15,7 +15,7 @@ export function createTaskProvider() { .then((uris) => uris .filter((uri) => uri.scheme === "file" && !uri.fsPath.includes("node_modules")) - .map((uri) => normalizeSlash(uri.fsPath)), + .map((uri) => normalizeSlashes(uri.fsPath)), ); logger.info(`Found ${targetPathes.length} main.tsp files`); const tasks: vscode.Task[] = []; @@ -56,7 +56,7 @@ function getTaskPath(targetPath: string): { absoluteTargetPath: string; workspac }); targetPath = variableResolver.resolve(targetPath); targetPath = resolve(workspaceFolder, targetPath); - targetPath = normalizeSlash(variableResolver.resolve(targetPath)); + targetPath = normalizeSlashes(variableResolver.resolve(targetPath)); return { absoluteTargetPath: targetPath, workspaceFolder }; } diff --git a/packages/typespec-vscode/src/tsp-executable-resolver.ts b/packages/typespec-vscode/src/tsp-executable-resolver.ts index ca61f89e30..934f3b8007 100644 --- a/packages/typespec-vscode/src/tsp-executable-resolver.ts +++ b/packages/typespec-vscode/src/tsp-executable-resolver.ts @@ -1,8 +1,8 @@ import { dirname, isAbsolute, join } from "path"; import { ExtensionContext, workspace } from "vscode"; import { Executable, ExecutableOptions } from "vscode-languageclient/node.js"; -import { SettingName } from "./const.js"; import logger from "./log/logger.js"; +import { SettingName } from "./types.js"; import { isFile, loadModule, useShellInExec } from "./utils.js"; import { VSCodeVariableResolver } from "./vscode-variable-resolver.js"; diff --git a/packages/typespec-vscode/src/tsp-language-client.ts b/packages/typespec-vscode/src/tsp-language-client.ts index c3b9ec840c..f0d6c6f571 100644 --- a/packages/typespec-vscode/src/tsp-language-client.ts +++ b/packages/typespec-vscode/src/tsp-language-client.ts @@ -1,8 +1,20 @@ +import type { + CustomRequestName, + InitProjectConfig, + InitProjectContext, + InitProjectTemplate, + ServerInitializeResult, +} from "@typespec/compiler"; import { ExtensionContext, LogOutputChannel, RelativePattern, workspace } from "vscode"; import { Executable, LanguageClient, LanguageClientOptions } from "vscode-languageclient/node.js"; import logger from "./log/logger.js"; import { resolveTypeSpecServer } from "./tsp-executable-resolver.js"; -import { listParentFolder } from "./utils.js"; +import { + ExecOutput, + isWhitespaceStringOrUndefined, + listParentFolder, + spawnExecutionAndLogToOutput, +} from "./utils.js"; export class TspLanguageClient { constructor( @@ -10,6 +22,95 @@ export class TspLanguageClient { private exe: Executable, ) {} + private initProjectContext?: InitProjectContext; + + get state() { + return this.client.state; + } + + get initializeResult(): ServerInitializeResult | undefined { + return this.client.initializeResult as ServerInitializeResult; + } + + async getInitProjectContext(): Promise { + if (this.initProjectContext) { + return this.initProjectContext; + } + + if (this.initializeResult?.customCapacities?.getInitProjectContext !== true) { + logger.warning( + "Get init project context is not supported by the current TypeSpec Compiler's LSP.", + ); + return undefined; + } + const getInitProjectContextRequestName: CustomRequestName = "typespec/getInitProjectContext"; + try { + this.initProjectContext = await this.client.sendRequest(getInitProjectContextRequestName); + return this.initProjectContext; + } catch (e) { + logger.error("Unexpected error when getting init project context", [e]); + return undefined; + } + } + + async validateInitProjectTemplate(template: InitProjectTemplate): Promise { + if (this.initializeResult?.customCapacities?.validateInitProjectTemplate !== true) { + logger.warning( + "Validate init project template is not supported by the current TypeSpec Compiler's LSP.", + ); + return false; + } + const validateInitProjectTemplateRequestName: CustomRequestName = + "typespec/validateInitProjectTemplate"; + try { + return await this.client.sendRequest(validateInitProjectTemplateRequestName, { template }); + } catch (e) { + logger.error("Unexpected error when validating init project template", [e]); + return false; + } + } + + async initProject(config: InitProjectConfig): Promise { + if (this.initializeResult?.customCapacities?.initProject !== true) { + logger.warning("Init project is not supported by the current TypeSpec Compiler's LSP."); + return false; + } + const initProjectRequestName: CustomRequestName = "typespec/initProject"; + try { + const result = await this.client.sendRequest(initProjectRequestName, { config }); + return result === true; + } catch (e) { + logger.error("Unexpected error when initializing project", [e]); + return false; + } + } + + async runCliCommand(args: string[], cwd: string): Promise { + if (isWhitespaceStringOrUndefined(this.initializeResult?.compilerCliJsPath)) { + logger.warning( + `Failed to run cli command with args [${args.join(", ")}] because no compilerCliJsPath is provided by the server. Please consider upgrade TypeSpec Compiler.`, + ); + return undefined; + } + try { + const result = await spawnExecutionAndLogToOutput( + "node", + [this.initializeResult!.compilerCliJsPath!, ...args], + cwd, + ); + if (result.exitCode !== 0) { + logger.error( + `Cli command with args [${args.join(", ")}] finishes with non-zero exit code ${result.exitCode}. Please check previous log for details`, + result.error ? [result.error] : [], + ); + } + return result; + } catch (e) { + logger.error(`Unexpected error when running Cli command with args [${args.join(", ")}]`, [e]); + return undefined; + } + } + async restart(): Promise { try { if (this.client.needsStop()) { @@ -41,7 +142,7 @@ export class TspLanguageClient { } } - async start(): Promise { + async start(showPopupWhenError: boolean): Promise { try { if (this.client.needsStart()) { await this.client.start(); @@ -61,13 +162,13 @@ export class TspLanguageClient { " - TypeSpec server path is configured with https://github.com/microsoft/typespec#installing-vs-code-extension.", ].join("\n"), [], - { showOutput: false, showPopup: true }, + { showOutput: false, showPopup: showPopupWhenError }, ); logger.error("Error detail", [e]); } else { logger.error("Unexpected error when starting TypeSpec server", [e], { showOutput: false, - showPopup: true, + showPopup: showPopupWhenError, }); } } diff --git a/packages/typespec-vscode/src/types.ts b/packages/typespec-vscode/src/types.ts new file mode 100644 index 0000000000..c21dba7e6b --- /dev/null +++ b/packages/typespec-vscode/src/types.ts @@ -0,0 +1,30 @@ +export const enum SettingName { + TspServerPath = "typespec.tsp-server.path", + InitTemplatesUrls = "typespec.initTemplatesUrls", +} + +export const enum CommandName { + ShowOutputChannel = "typespec.showOutputChannel", + RestartServer = "typespec.restartServer", + InstallGlobalCompilerCli = "typespec.installGlobalCompilerCli", + CreateProject = "typespec.createProject", + OpenUrl = "typespec.openUrl", +} + +export interface InstallGlobalCliCommandArgs { + /** + * whether to confirm with end user before action + * default: false + */ + confirm: boolean; + confirmTitle?: string; + confirmPlaceholder?: string; +} + +export interface RestartServerCommandArgs { + /** + * whether to recreate TspLanguageClient instead of just restarting it + */ + forceRecreate: boolean; + popupRecreateLspError: boolean; +} diff --git a/packages/typespec-vscode/src/utils.ts b/packages/typespec-vscode/src/utils.ts index 1bbed0a3ff..f5b72bae7d 100644 --- a/packages/typespec-vscode/src/utils.ts +++ b/packages/typespec-vscode/src/utils.ts @@ -1,20 +1,11 @@ import type { ModuleResolutionResult, ResolveModuleHost } from "@typespec/compiler"; +import { spawn, SpawnOptions } from "child_process"; import { readFile, realpath, stat } from "fs/promises"; -import { dirname, normalize, resolve } from "path"; +import { dirname } from "path"; +import { CancellationToken } from "vscode"; import { Executable } from "vscode-languageclient/node.js"; import logger from "./log/logger.js"; - -/** normalize / and \\ to / */ -export function normalizeSlash(str: string): string { - return str.replaceAll(/\\/g, "/"); -} - -export function normalizePath(path: string): string { - const normalized = normalize(path); - const resolved = resolve(normalized); - const result = normalizeSlash(resolved); - return result; -} +import { isUrl } from "./path-utils.js"; export async function isFile(path: string) { try { @@ -102,3 +93,211 @@ export async function loadModule( return undefined; } } + +export function tryParseJson(str: string): any | undefined { + try { + return JSON.parse(str); + } catch { + return undefined; + } +} + +export async function tryReadFileOrUrl( + pathOrUrl: string, +): Promise<{ content: string; url: string } | undefined> { + if (isUrl(pathOrUrl)) { + const result = await tryReadUrl(pathOrUrl); + return result; + } else { + const result = await tryReadFile(pathOrUrl); + return result ? { content: result, url: pathOrUrl } : undefined; + } +} + +export async function tryReadFile(path: string): Promise { + try { + const content = await readFile(path, "utf-8"); + return content; + } catch (e) { + logger.debug(`Failed to read file: ${path}`, [e]); + return undefined; + } +} + +export async function tryReadUrl( + url: string, +): Promise<{ content: string; url: string } | undefined> { + try { + const response = await fetch(url, { redirect: "follow" }); + const content = await response.text(); + return { content, url: response.url }; + } catch (e) { + logger.debug(`Failed to fetch from url: ${url}`, [e]); + return undefined; + } +} + +export interface ExecOutput { + stdout: string; + stderr: string; + exitCode: number; + error: any; + spawnOptions: SpawnOptions; +} +export interface spawnExecutionEvents { + onStdioOut?: (data: string) => void; + onStdioError?: (error: string) => void; + onError?: (error: any, stdout: string, stderr: string) => void; + onExit?: (code: number | null, stdout: string, stderror: string) => void; +} + +/** + * The promise will be rejected if the process exits with non-zero code or error occurs. Please make sure the rejection is handled property with try-catch + * + * @param exe + * @param args + * @param cwd + * @returns + */ +export function spawnExecutionAndLogToOutput( + exe: string, + args: string[], + cwd: string, +): Promise { + return spawnExecution(exe, args, cwd, { + onStdioOut: (data) => { + logger.info(data.trim()); + }, + onStdioError: (error) => { + logger.error(error.trim()); + }, + onError: (error) => { + if (error?.code === "ENOENT") { + logger.error(`Cannot find ${exe} executable. Make sure it can be found in your path.`); + } + }, + }); +} + +/** + * The promise will be rejected if the process exits with non-zero code or error occurs. Please make sure the rejection is handled property with try-catch + * + * @param exe + * @param args + * @param cwd + * @param on + * @returns + */ +export function spawnExecution( + exe: string, + args: string[], + cwd: string, + on?: spawnExecutionEvents, +): Promise { + const shell = process.platform === "win32"; + const cmd = shell && exe.includes(" ") ? `"${exe}"` : exe; + let stdout = ""; + let stderr = ""; + + const options: SpawnOptions = { + shell, + stdio: "pipe", + windowsHide: true, + cwd, + }; + const child = spawn(cmd, args, options); + + child.stdout!.on("data", (data) => { + stdout += data.toString(); + if (on && on.onStdioOut) { + try { + on.onStdioOut!(data.toString()); + } catch (e) { + logger.error("Unexpected error in onStdioOut", [e]); + } + } + }); + child.stderr!.on("data", (data) => { + stderr += data.toString(); + if (on && on.onStdioError) { + try { + on.onStdioError!(data.toString()); + } catch (e) { + logger.error("Unexpected error in onStdioError", [e]); + } + } + }); + if (on && on.onError) { + child.on("error", (error: any) => { + try { + on.onError!(error, stdout, stderr); + } catch (e) { + logger.error("Unexpected error in onError", [e]); + } + }); + } + if (on && on.onExit) { + child.on("exit", (code) => { + try { + on.onExit!(code, stdout, stderr); + } catch (e) { + logger.error("Unexpected error in onExit", [e]); + } + }); + } + return new Promise((res, rej) => { + child.on("error", (error: any) => { + rej({ + stdout, + stderr, + exitCode: -1, + error: error, + spawnOptions: options, + }); + }); + child.on("exit", (exitCode) => { + if (exitCode === 0 || exitCode === null) { + res({ + stdout, + stderr, + exitCode: exitCode ?? 0, + error: "", + spawnOptions: options, + }); + } else { + rej({ + stdout, + stderr, + exitCode: exitCode, + error: `${exe} ${args.join(" ")} failed with exit code ${exitCode}`, + spawnOptions: options, + }); + } + }); + }); +} + +/** + * if the operation is cancelled, the promise will be rejected with reason==="cancelled" + * if the operation is timeout, the promise will be rejected with reason==="timeout" + * + * @param action + * @param token + * @param timeoutInMs + * @returns + */ +export function createPromiseWithCancelAndTimeout( + action: Promise, + token: CancellationToken, + timeoutInMs: number, +) { + return new Promise((resolve, reject) => { + token.onCancellationRequested(() => { + reject("cancelled"); + }); + setTimeout(() => { + reject("timeout"); + }, timeoutInMs); + action.then(resolve, reject); + }); +} diff --git a/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts b/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts new file mode 100644 index 0000000000..30ecdce49c --- /dev/null +++ b/packages/typespec-vscode/src/vscode-cmd/create-tsp-project.ts @@ -0,0 +1,664 @@ +import type { + InitProjectConfig, + InitProjectTemplate, + InitProjectTemplateLibrarySpec, +} from "@typespec/compiler"; +import { TIMEOUT } from "dns"; +import { readdir } from "fs/promises"; +import * as semver from "semver"; +import vscode, { OpenDialogOptions, QuickPickItem } from "vscode"; +import { State } from "vscode-languageclient"; +import logger from "../log/logger.js"; +import { getBaseFileName, getDirectoryPath, joinPaths } from "../path-utils.js"; +import { TspLanguageClient } from "../tsp-language-client.js"; +import { + CommandName, + InstallGlobalCliCommandArgs, + RestartServerCommandArgs, + SettingName, +} from "../types.js"; +import { + createPromiseWithCancelAndTimeout, + ExecOutput, + isFile, + isWhitespaceStringOrUndefined, + tryParseJson, + tryReadFileOrUrl, +} from "../utils.js"; + +type InitTemplatesUrlSetting = { + name: string; + url: string; +}; + +type InitTemplateInfo = { + source: string; + sourceType: "compiler" | "config"; + baseUrl: string; + name: string; + template: InitProjectTemplate; +}; + +interface TemplateQuickPickItem extends QuickPickItem { + info?: InitTemplateInfo; +} + +interface LibraryQuickPickItem extends QuickPickItem { + name: string; + version?: string; +} + +const COMPILER_CORE_TEMPLATES = "compiler-core-templates"; +export async function createTypeSpecProject(client: TspLanguageClient | undefined) { + await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Window, + cancellable: false, + title: "Creating TypeSpec Project...", + }, + async () => { + const selectedRootFolder = await selectProjectRootFolder(); + if (!selectedRootFolder) { + logger.info("Creating TypeSpec Project cancelled when selecting project root folder."); + return; + } + if (!(await checkProjectRootFolderEmpty(selectedRootFolder))) { + logger.info( + "Creating TypeSpec Project cancelled when checking whether the project root folder is empty.", + ); + return; + } + const folderName = getBaseFileName(selectedRootFolder); + + if (!client || client.state !== State.Running) { + const r = await InstallCompilerAndRestartLSPClient(); + if (r === undefined) { + logger.info("Creating TypeSpec Project cancelled when installing Compiler/CLI"); + return; + } else { + client = r; + } + } + + const isSupport = await isCompilerSupport(client); + if (!isSupport) { + logger.info("Creating TypeSpec Project cancelled due to unsupported by compiler."); + return; + } + + const templateInfoMap = await loadInitTemplates(client); + if (templateInfoMap.size === 0) { + logger.error( + "Unexpected Error: No templates loaded. Please check the configuration of InitTemplatesUrls or upgrade @typespec/compiler and try again.", + [], + { + showOutput: true, + showPopup: true, + }, + ); + return; + } + const info = await selectTemplate(templateInfoMap); + if (info === undefined) { + logger.info("Creating TypeSpec Project cancelled when selecting template."); + return; + } else { + logger.info(`Selected template: ${info.source}.${info.name}`); + } + + const validateResult = await validateTemplate(info, client); + if (!validateResult) { + logger.info("Creating TypeSpec Project cancelled when validating template."); + return; + } + + const projectName = await vscode.window.showInputBox({ + prompt: "Please input the project name", + value: folderName, + ignoreFocusOut: true, + validateInput: (value) => { + if (isWhitespaceStringOrUndefined(value)) { + return "Project name cannot be empty."; + } + // we don't have a full rule for project name. Just have a simple check to avoid some strange name. + const regex = /^(?![./])(?!.*[./]{2})[a-zA-Z0-9-~_@./]*[a-zA-Z0-9-~_@]$/; + if (!regex.test(value)) { + return "Invalid project name. Only [a-zA-Z0-9-~_@./] are allowed and cannot start/end with [./] or consecutive [./]"; + } + return undefined; + }, + }); + if (isWhitespaceStringOrUndefined(projectName)) { + logger.info("Creating TypeSpec Project cancelled when input project name.", [], { + showOutput: false, + showPopup: false, + }); + return; + } + + const includeGitignoreResult = await vscode.window.showQuickPick(["Yes", "No"], { + title: "Do you want to generate a .gitignore file", + canPickMany: false, + placeHolder: "Do you want to generate a .gitignore file", + ignoreFocusOut: true, + }); + if (includeGitignoreResult === undefined) { + logger.info( + "Creating TypeSpec Project cancelled when selecting whether to include .gitignore.", + ); + return; + } + const includeGitignore = includeGitignoreResult === "Yes"; + + const librariesToInclude = await selectLibraries(info); + if (librariesToInclude === undefined) { + logger.info("Creating TypeSpec Project cancelled when selecting libraries to include."); + return; + } + + const inputs = await setInputs(info); + if (inputs === undefined) { + logger.info("Creating TypeSpec Project cancelled when setting inputs."); + return; + } + + const initTemplateConfig: InitProjectConfig = { + template: info.template!, + directory: selectedRootFolder, + folderName: folderName, + baseUri: info.baseUrl, + name: projectName!, + parameters: inputs ?? {}, + includeGitignore: includeGitignore, + libraries: librariesToInclude, + }; + const initResult = await initProject(client, initTemplateConfig); + if (!initResult) { + logger.info("Creating TypeSpec Project cancelled when initializing project.", [], { + showOutput: false, + showPopup: false, + }); + return; + } + + const packageJsonPath = joinPaths(selectedRootFolder, "package.json"); + if (!(await isFile(packageJsonPath))) { + logger.warning("Skip tsp install since no package.json is found in the project folder."); + } else { + // just ignore the result from tsp install. We will open the project folder anyway. + await tspInstall(client, selectedRootFolder); + } + vscode.commands.executeCommand("vscode.openFolder", vscode.Uri.file(selectedRootFolder), { + forceNewWindow: false, + forceReuseWindow: true, + noRecentEntry: false, + }); + return; + }, + ); +} + +async function tspInstall( + client: TspLanguageClient, + directory: string, +): Promise { + logger.info("Installing TypeSpec project dependencies by 'tsp install'..."); + return await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Installing TypeSpec project dependencies by 'tsp install'...", + cancellable: true, + }, + async (_progress, token) => { + const TIMEOUT = 600000; // set timeout to 10 minutes which should be enough for tsp install for a new project + try { + const result = await createPromiseWithCancelAndTimeout( + client.runCliCommand(["install"], directory), + token, + TIMEOUT, + ); + return result; + } catch (e) { + if (e === "cancelled") { + logger.info( + "Installation of TypeSpec project dependencies by 'tsp install' is cancelled by user", + ); + return undefined; + } else if (e === "timeout") { + logger.error( + `Installation of TypeSpec project dependencies by 'tsp install' is timeout after ${TIMEOUT}ms`, + ); + return undefined; + } else { + logger.error( + "Unexpected error when installing TypeSpec project dependencies by 'tsp install'", + [e], + ); + return undefined; + } + } + }, + ); +} + +async function initProject( + client: TspLanguageClient, + initTemplateConfig: InitProjectConfig, +): Promise { + return await vscode.window.withProgress( + { + location: vscode.ProgressLocation.Notification, + title: "Creating TypeSpec project...", + cancellable: true, + }, + async (_progress, token) => { + try { + const TIMEOUT = 300000; // set timeout to 5 minutes which should be enough for init project + const result = await createPromiseWithCancelAndTimeout( + client.initProject(initTemplateConfig), + token, + TIMEOUT, + ); + if (!result) { + logger.error( + "Failed to create TypeSpec project. Please check the previous log for details.", + [], + { + showOutput: true, + showPopup: true, + }, + ); + return false; + } + logger.info("Creating TypeSpec project completed. "); + return true; + } catch (e) { + if (e === "cancelled") { + logger.info("Creating TypeSpec project cancelled by user."); + } else if (e === "timeout") { + logger.error(`Creating TypeSpec project timed out (${TIMEOUT}ms).`); + } else { + logger.error("Error when creating TypeSpec project", [e], { + showOutput: true, + showPopup: true, + }); + } + return false; + } + }, + ); +} + +async function validateTemplate( + info: InitTemplateInfo, + client: TspLanguageClient, +): Promise { + if (info.sourceType === "compiler") { + // no need to validate template from compiler + return true; + } + + const compilerVersion = client.initializeResult?.serverInfo?.version; + const templateRequiredVersion = info.template.compilerVersion; + if ( + compilerVersion && + templateRequiredVersion && + semver.lt(compilerVersion, templateRequiredVersion) + ) { + logger.warning( + `The selected template is designed for tsp version ${templateRequiredVersion}, but currently using tsp version is ${compilerVersion}.`, + ); + const cont = await vscode.window.showQuickPick(["Yes", "No"], { + canPickMany: false, + placeHolder: + `Current tsp version (${compilerVersion}) < template designed tsp version(${templateRequiredVersion}). ` + + `The project created may not be correct. Do you want to continue?`, + ignoreFocusOut: true, + title: "Template version mismatches with tsp. Do you want to continue?", + }); + if (cont !== "Yes") { + logger.info( + "User confirmed/cancelled creating TypeSpec Project due to template version mismatch.", + ); + return false; + } + } + + const validateResult = await client.validateInitProjectTemplate(info.template); + if (!validateResult) { + logger.warning("Template validation failed. Please check the previous log for details.", [], { + showOutput: true, + showPopup: true, + }); + const cont = await vscode.window.showQuickPick(["Yes", "No"], { + canPickMany: false, + placeHolder: + "Template validation failed. Do you want to continue? Detail log can be found in the Output window.", + ignoreFocusOut: true, + title: "Template validation failed. Do you want to continue?", + }); + if (cont !== "Yes") { + logger.info("Creating TypeSpec Project cancelled due to template validation failure."); + return false; + } + } + return true; +} + +async function setInputs(info: InitTemplateInfo): Promise | undefined> { + const inputs: Record = {}; + for (const [key, input] of Object.entries(info.template?.inputs ?? {})) { + switch (input.type) { + case "text": + const textInput = await vscode.window.showInputBox({ + prompt: input.description, + value: input.initialValue, + ignoreFocusOut: true, + }); + if (textInput === undefined) { + logger.info(`No input provided for ${key}.`); + return undefined; + } + inputs[key] = textInput; + break; + default: + logger.error( + `Input type ${input.type} in the template is not supported. Please upgrade the extension and try again.`, + [], + { + showOutput: true, + showPopup: true, + }, + ); + return undefined; + } + } + return inputs; +} + +async function selectLibraries( + info: InitTemplateInfo, +): Promise { + const libs: LibraryQuickPickItem[] = + info.template.libraries?.map((x): LibraryQuickPickItem => { + if (typeof x === "string") { + return { + label: x, + kind: vscode.QuickPickItemKind.Default, + description: undefined, + name: x, + version: undefined, + picked: true, + }; + } + return { + label: x.name, + kind: vscode.QuickPickItemKind.Default, + description: x.version ? `(ver: ${x.version})` : undefined, + name: x.name, + version: x.version, + picked: true, + }; + }) ?? []; + if (libs.length === 0) return []; + const librariesToUpgrade = await vscode.window.showQuickPick(libs, { + title: "Please select libraries to include", + canPickMany: true, + placeHolder: "Please select libraries to include", + ignoreFocusOut: true, + }); + return librariesToUpgrade?.map((x) => ({ name: x.name, version: x.version })); +} + +async function selectTemplate( + templateInfoMap: Map, +): Promise { + const templatePickupItems: TemplateQuickPickItem[] = []; + const toPickupItems = (x: InitTemplateInfo): TemplateQuickPickItem => { + const label = + (x.template.title ?? x.name) + + ` (min compiler ver: ${x.template.compilerVersion ? x.template.compilerVersion : "-not specified-"})`; + return { + label, + detail: x.template.description, + kind: vscode.QuickPickItemKind.Default, + info: x, + }; + }; + // Templates from compiler should always be on the top + templateInfoMap.get(COMPILER_CORE_TEMPLATES)?.forEach((x) => { + templatePickupItems.push(toPickupItems(x)); + }); + for (const key of templateInfoMap.keys()) { + if (key === COMPILER_CORE_TEMPLATES) { + continue; + } + const temps = []; + for (const info of templateInfoMap.get(key) ?? []) { + if (!info || !info.template) { + logger.warning(`Template ${info.name} in ${key} is empty. Skip it.`); + continue; + } + temps.push(toPickupItems(info)); + } + if (temps.length > 0) { + templatePickupItems.push({ + label: key, + kind: vscode.QuickPickItemKind.Separator, + }); + templatePickupItems.push(...temps); + } + } + templatePickupItems.push({ + label: "Settings", + kind: vscode.QuickPickItemKind.Separator, + info: undefined, + }); + const configureSettingsItem: TemplateQuickPickItem = { + label: "Configure TypeSpec Project Templates", + kind: vscode.QuickPickItemKind.Default, + info: undefined, + buttons: [ + { + iconPath: new vscode.ThemeIcon("settings-gear"), + tooltip: "Configure TypeSpec Project Templates", + }, + ], + }; + templatePickupItems.push(configureSettingsItem); + const quickPickup = vscode.window.createQuickPick(); + quickPickup.items = templatePickupItems; + quickPickup.canSelectMany = false; + quickPickup.ignoreFocusOut = true; + quickPickup.title = "Please select a template"; + quickPickup.placeholder = "Please select a template"; + const gotoConfigSettings = () => { + logger.info("User select to open settings to configure TypeSpec Project Templates"); + quickPickup.hide(); + vscode.commands.executeCommand("workbench.action.openSettings", SettingName.InitTemplatesUrls); + }; + quickPickup.onDidTriggerItemButton((event) => { + if (event.item === configureSettingsItem) { + gotoConfigSettings(); + } + }); + const selectionPromise = new Promise((resolve) => { + quickPickup.onDidAccept(() => { + const selectedItem = quickPickup.selectedItems[0]; + resolve(selectedItem); + quickPickup.hide(); + }); + quickPickup.onDidHide(() => { + resolve(undefined); + quickPickup.dispose(); + }); + }); + quickPickup.show(); + + const selected = await selectionPromise; + if (configureSettingsItem === selected) { + gotoConfigSettings(); + return undefined; + } + return selected?.info; +} + +async function isCompilerSupport(client: TspLanguageClient): Promise { + if ( + client.initializeResult?.serverInfo?.version === undefined || + client.initializeResult?.customCapacities?.getInitProjectContext !== true || + client.initializeResult?.customCapacities?.validateInitProjectTemplate !== true || + client.initializeResult?.customCapacities?.initProject !== true + ) { + logger.error( + `Create project feature is not supported by the current TypeSpec Compiler (ver ${client.initializeResult?.serverInfo?.version ?? "<= 0.63.0"}). Please upgrade TypeSpec Compiler and try again.`, + [], + { + showOutput: true, + showPopup: true, + }, + ); + return false; + } + return true; +} + +async function loadInitTemplates( + client: TspLanguageClient, +): Promise> { + logger.info("Loading init templates from compiler..."); + const templateInfoMap: Map = new Map(); + const ipContext = await client.getInitProjectContext(); + if ( + ipContext?.coreInitTemplates && + ipContext?.coreInitTemplates.templates && + Object.entries(ipContext?.coreInitTemplates.templates).length > 0 + ) { + templateInfoMap.set( + COMPILER_CORE_TEMPLATES, + Object.entries(ipContext.coreInitTemplates.templates) + .filter(([_key, value]) => value !== undefined) + .map(([key, value]) => ({ + source: COMPILER_CORE_TEMPLATES, + sourceType: "compiler", + baseUrl: ipContext.coreInitTemplates.baseUri, + name: key, + template: value, + })), + ); + } + logger.info("Loading init templates from config..."); + const settings = vscode.workspace + .getConfiguration() + .get(SettingName.InitTemplatesUrls); + if (settings) { + for (const item of settings) { + const { content, url } = (await tryReadFileOrUrl(item.url)) ?? { + content: undefined, + url: item.url, + }; + if (!content) { + logger.error(`Failed to read template from ${item.url}. The url will be skipped`, [], { + showOutput: true, + showPopup: false, + }); + continue; + } else { + const json = tryParseJson(content); + if (!json) { + logger.error( + `Failed to parse templates content from ${item.url}. The url will be skipped`, + [], + { showOutput: true, showPopup: false }, + ); + continue; + } else { + for (const [key, value] of Object.entries(json)) { + if (value !== undefined) { + const info: InitTemplateInfo = { + source: item.name, + sourceType: "config", + baseUrl: getDirectoryPath(url), + name: key, + template: value as InitProjectTemplate, + }; + templateInfoMap.get(item.name)?.push(info) ?? templateInfoMap.set(item.name, [info]); + } + } + } + } + } + } + logger.info(`${templateInfoMap.size} templates loaded.`); + return templateInfoMap; +} + +async function selectProjectRootFolder(): Promise { + logger.info("Selecting project root folder..."); + const folderOptions: OpenDialogOptions = { + canSelectMany: false, + openLabel: "Select Folder", + canSelectFolders: true, + canSelectFiles: false, + title: "Select project root folder", + }; + + const folderUri = await vscode.window.showOpenDialog(folderOptions); + if (!folderUri || folderUri.length === 0) { + return undefined; + } + const selectedFolder = folderUri[0].fsPath; + logger.info(`Selected root folder: ${selectedFolder}`); + return selectedFolder; +} + +async function checkProjectRootFolderEmpty(selectedFolder: string): Promise { + try { + const files = await readdir(selectedFolder); + if (files.length > 0) { + const cont = await vscode.window.showQuickPick(["Yes", "No"], { + canPickMany: false, + placeHolder: "The folder to create project is not empty. Do you want to continue?", + ignoreFocusOut: true, + title: "The folder to create project is not empty. Do you want to continue?", + }); + if (cont !== "Yes") { + logger.info("Selected folder is not empty and user confirmed not to continue."); + return false; + } + } + return true; + } catch (e) { + logger.error("Error when checking whether selected folder is empty", [e], { + showOutput: true, + showPopup: true, + }); + return false; + } +} + +async function InstallCompilerAndRestartLSPClient(): Promise { + const igcArgs: InstallGlobalCliCommandArgs = { + confirm: true, + confirmTitle: "No TypeSpec Compiler/CLI found which is needed to create TypeSpec project.", + confirmPlaceholder: + "No TypeSpec Compiler/CLI found which is needed to create TypeSpec project.", + }; + const result = await vscode.commands.executeCommand( + CommandName.InstallGlobalCompilerCli, + igcArgs, + ); + if (!result) { + return undefined; + } + logger.info("Try to restart lsp client after installing compiler."); + const rsArgs: RestartServerCommandArgs = { + forceRecreate: false, + popupRecreateLspError: true, + }; + const newClient = await vscode.commands.executeCommand( + CommandName.RestartServer, + rsArgs, + ); + return newClient; +} diff --git a/packages/typespec-vscode/src/vscode-cmd/install-tsp-compiler.ts b/packages/typespec-vscode/src/vscode-cmd/install-tsp-compiler.ts new file mode 100644 index 0000000000..d22b3a1182 --- /dev/null +++ b/packages/typespec-vscode/src/vscode-cmd/install-tsp-compiler.ts @@ -0,0 +1,77 @@ +import vscode, { QuickPickItem } from "vscode"; +import logger from "../log/logger.js"; +import { InstallGlobalCliCommandArgs } from "../types.js"; +import { createPromiseWithCancelAndTimeout, spawnExecutionAndLogToOutput } from "../utils.js"; + +const COMPILER_REQUIREMENT = + "Minimum Requirements: 'Node.js 20 LTS' && 'npm avaliable in command prompt'"; + +export async function installCompilerGlobally( + args: InstallGlobalCliCommandArgs | undefined, +): Promise { + // confirm with end user by default + if (args?.confirm !== false) { + const yes: QuickPickItem = { + label: "Install TypeSpec Compiler/CLI globally", + detail: COMPILER_REQUIREMENT, + description: " by 'npm install -g @typespec/compiler'", + }; + const no: QuickPickItem = { label: "Cancel" }; + const title = args?.confirmTitle ?? "Please check the requirements and confirm..."; + const confirm = await vscode.window.showQuickPick([yes, no], { + title, + placeHolder: args?.confirmPlaceholder ?? title, + }); + if (confirm !== yes) { + logger.info("User cancelled the installation of TypeSpec Compiler/CLI"); + return false; + } else { + logger.info("User confirmed the installation of TypeSpec Compiler/CLI"); + } + } else { + logger.info("Installing TypeSpec Compiler/CLI with confirmation disabled explicitly..."); + } + return await vscode.window.withProgress( + { + title: "Installing TypeSpec Compiler/CLI...", + location: vscode.ProgressLocation.Notification, + cancellable: true, + }, + async (_progress, token) => { + const TIMEOUT = 300000; // set timeout to 5 minutes which should be enough for installing compiler + try { + const output = await createPromiseWithCancelAndTimeout( + spawnExecutionAndLogToOutput( + "npm", + ["install", "-g", "@typespec/compiler"], + process.cwd(), + ), + token, + TIMEOUT, + ); + if (output.exitCode !== 0) { + logger.error( + "Failed to install TypeSpec CLI. Please check the previous log for details", + [output], + { showOutput: true, showPopup: true }, + ); + return false; + } else { + logger.info("TypeSpec CLI installed successfully"); + return true; + } + } catch (e) { + if (e === "cancelled") { + logger.info("Installation of TypeSpec Compiler/CLI is cancelled by user"); + return false; + } else if (e === "timeout") { + logger.error(`Installation of TypeSpec Compiler/CLI is timeout after ${TIMEOUT}ms`); + return false; + } else { + logger.error("Unexpected error when installing TypeSpec Compiler/CLI", [e]); + return false; + } + } + }, + ); +} diff --git a/packages/typespec-vscode/src/vscode-command.ts b/packages/typespec-vscode/src/vscode-command.ts deleted file mode 100644 index c9a16a0138..0000000000 --- a/packages/typespec-vscode/src/vscode-command.ts +++ /dev/null @@ -1,15 +0,0 @@ -import vscode from "vscode"; -import logger from "./log/logger.js"; - -export const OPEN_URL_COMMAND = "typespec.openUrl"; - -export function createCommandOpenUrl() { - return vscode.commands.registerCommand(OPEN_URL_COMMAND, (url: string) => { - // Although vscode has already dealt with the problem of wrong URL, try catch is still added here. - try { - vscode.env.openExternal(vscode.Uri.parse(url)); - } catch (error) { - logger.error(`Failed to open URL: ${url}`, [error as any]); - } - }); -} diff --git a/packages/typespec-vscode/test/unit/extension.test.ts b/packages/typespec-vscode/test/unit/extension.test.ts index b82a72d41d..039c9507ba 100644 --- a/packages/typespec-vscode/test/unit/extension.test.ts +++ b/packages/typespec-vscode/test/unit/extension.test.ts @@ -1,4 +1,6 @@ +import { strictEqual } from "assert"; import { assert, beforeAll, describe, it } from "vitest"; +import { InitTemplateSchema } from "../../../compiler/dist/src/init/init-template.js"; import { ConsoleLogLogger } from "../../src/log/console-log-listener.js"; import logger from "../../src/log/logger.js"; @@ -12,5 +14,11 @@ describe("Hello world test", () => { assert(true, "test sample"); }); - // Add more unit test when needed + it("Check inputs type supported in InitTemplate", () => { + // Add this test to ensure we won't forget to add the support in VS/VSCode extension of typespec + // when we add more input types support in InitTemplate.inputs + const schema = InitTemplateSchema; + strictEqual(schema.properties.inputs.additionalProperties.properties.type.enum.length, 1); + strictEqual(schema.properties.inputs.additionalProperties.properties.type.enum[0], "text"); + }); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07ece0d799..1ec21bf0d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,7 +43,7 @@ importers: version: 22.7.9 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) c8: specifier: ^10.1.2 version: 10.1.2 @@ -67,7 +67,7 @@ importers: version: 56.0.1(eslint@9.15.0(jiti@1.21.6)) eslint-plugin-vitest: specifier: ^0.5.4 - version: 0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5) + version: 0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) micromatch: specifier: ^4.0.8 version: 4.0.8 @@ -151,7 +151,7 @@ importers: version: link:../compiler '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -200,7 +200,7 @@ importers: version: 7.5.8 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -258,7 +258,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -346,7 +346,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -398,7 +398,7 @@ importers: version: 8.15.0 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -434,7 +434,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -504,7 +504,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -549,7 +549,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -598,7 +598,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -712,7 +712,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -755,7 +755,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -788,7 +788,7 @@ importers: version: link:../compiler '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -816,7 +816,7 @@ importers: version: 22.7.9 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -858,7 +858,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -919,7 +919,7 @@ importers: version: link:../xml '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1161,7 +1161,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1237,7 +1237,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1298,7 +1298,7 @@ importers: version: 4.3.3(vite@5.4.11(@types/node@22.7.9)) '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1343,7 +1343,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1413,7 +1413,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1507,7 +1507,7 @@ importers: version: 17.0.33 '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1729,7 +1729,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1762,7 +1762,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1830,7 +1830,7 @@ importers: version: link:../prettier-plugin-typespec '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1882,6 +1882,9 @@ importers: '@types/node': specifier: ~22.7.9 version: 22.7.9 + '@types/semver': + specifier: ^7.5.8 + version: 7.5.8 '@types/vscode': specifier: ~1.94.0 version: 1.94.0 @@ -1893,7 +1896,7 @@ importers: version: link:../internal-build-utils '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1915,6 +1918,9 @@ importers: rollup: specifier: ~4.24.0 version: 4.24.4 + semver: + specifier: ^7.6.3 + version: 7.6.3 typescript: specifier: ~5.6.3 version: 5.6.3 @@ -1941,7 +1947,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -1974,7 +1980,7 @@ importers: version: link:../tspd '@vitest/coverage-v8': specifier: ^2.1.5 - version: 2.1.5(vitest@2.1.5) + version: 2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)) '@vitest/ui': specifier: ^2.1.2 version: 2.1.5(vitest@2.1.5) @@ -16371,7 +16377,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/coverage-v8@2.1.5(vitest@2.1.5)': + '@vitest/coverage-v8@2.1.5(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -18550,7 +18556,7 @@ snapshots: semver: 7.6.3 strip-indent: 3.0.0 - eslint-plugin-vitest@0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5): + eslint-plugin-vitest@0.5.4(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3)(vitest@2.1.5(@types/node@22.7.9)(@vitest/ui@2.1.5)(happy-dom@15.11.6)(jsdom@19.0.0)): dependencies: '@typescript-eslint/utils': 7.18.0(eslint@9.15.0(jiti@1.21.6))(typescript@5.6.3) eslint: 9.15.0(jiti@1.21.6) From ff550fabc526f507a76a276d8cc7bad6861ff7bd Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 17 Dec 2024 14:14:17 +0800 Subject: [PATCH 71/71] http-client-java, default flavor=azure, if package is typespec-java (#5384) link https://github.com/microsoft/typespec/issues/5380 - default flavor depends on package - remove a (deprecated) emitter options - enable `reportDiagnostics` from TCGC diagnostics (we may get one error on https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-inference, I guess we can ignore that package for now) - allow emitter runs on tsp without service -- this likely won't produce anything expected though (I've run it on tsp with only models, TCGC did not give me any model, even when I set access=public on them) --- .../emitter/src/code-model-builder.ts | 15 +++++++++------ .../http-client-java/emitter/src/emitter.ts | 19 ++++++++++++------- .../http-client-generator-test/package.json | 2 +- packages/http-client-java/package-lock.json | 4 ++-- packages/http-client-java/package.json | 2 +- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/packages/http-client-java/emitter/src/code-model-builder.ts b/packages/http-client-java/emitter/src/code-model-builder.ts index b1d967337a..691af914bd 100644 --- a/packages/http-client-java/emitter/src/code-model-builder.ts +++ b/packages/http-client-java/emitter/src/code-model-builder.ts @@ -202,11 +202,11 @@ export class CodeModelBuilder { const service = listServices(this.program)[0]; if (!service) { - this.logError("TypeSpec for HTTP must define a service."); + this.logWarning("TypeSpec for HTTP client should define a service."); } - this.serviceNamespace = service.type; + this.serviceNamespace = service?.type ?? this.program.getGlobalNamespaceType(); - this.namespace = getNamespaceFullName(this.serviceNamespace) || "Azure.Client"; + this.namespace = getNamespaceFullName(this.serviceNamespace) || "Client"; const namespace1 = this.namespace; this.typeNameOptions = { @@ -238,6 +238,10 @@ export class CodeModelBuilder { } public async build(): Promise { + if (this.program.hasError()) { + return this.codeModel; + } + this.sdkContext = await createSdkContext(this.emitterContext, "@typespec/http-client-java", { versioning: { previewStringRegex: /$/ }, }); // include all versions and do the filter by ourselves @@ -257,9 +261,8 @@ export class CodeModelBuilder { this.codeModel.language.java!.namespace = this.baseJavaNamespace; - // TODO: reportDiagnostics from TCGC temporary disabled - // issue https://github.com/Azure/typespec-azure/issues/1675 - // this.program.reportDiagnostics(this.sdkContext.diagnostics); + // potential problem https://github.com/Azure/typespec-azure/issues/1675 + this.program.reportDiagnostics(this.sdkContext.diagnostics); // auth // TODO: it is not very likely, but different client could have different auth diff --git a/packages/http-client-java/emitter/src/emitter.ts b/packages/http-client-java/emitter/src/emitter.ts index 625e87e957..ca4246c473 100644 --- a/packages/http-client-java/emitter/src/emitter.ts +++ b/packages/http-client-java/emitter/src/emitter.ts @@ -15,7 +15,6 @@ import { JDK_NOT_FOUND_MESSAGE, validateDependencies } from "./validate.js"; export interface EmitterOptions { namespace?: string; - "output-dir"?: string; "package-dir"?: string; flavor?: string; @@ -57,12 +56,16 @@ export interface DevOptions { "java-temp-dir"?: string; // working directory for java codegen, e.g. transformed code-model file } +type CodeModelEmitterOptions = EmitterOptions & { + "output-dir": string; + arm?: boolean; +}; + const EmitterOptionsSchema: JSONSchemaType = { type: "object", additionalProperties: true, properties: { namespace: { type: "string", nullable: true }, - "output-dir": { type: "string", nullable: true }, "package-dir": { type: "string", nullable: true }, flavor: { type: "string", nullable: true }, @@ -118,8 +121,7 @@ export async function $onEmit(context: EmitContext) { if (!program.hasError()) { const options = context.options; if (!options["flavor"]) { - if (options["package-dir"]?.toLocaleLowerCase().startsWith("azure")) { - // Azure package + if ($lib.name === "@azure-tools/typespec-java") { options["flavor"] = "azure"; } } @@ -130,10 +132,13 @@ export async function $onEmit(context: EmitContext) { const __dirname = dirname(fileURLToPath(import.meta.url)); const moduleRoot = resolvePath(__dirname, "..", ".."); - const outputPath = options["output-dir"] ?? context.emitterOutputDir; - options["output-dir"] = getNormalizedAbsolutePath(outputPath, undefined); + const outputPath = context.emitterOutputDir; + (options as CodeModelEmitterOptions)["output-dir"] = getNormalizedAbsolutePath( + outputPath, + undefined, + ); - (options as any)["arm"] = codeModel.arm; + (options as CodeModelEmitterOptions).arm = codeModel.arm; const codeModelFileName = resolvePath(outputPath, "./code-model.yaml"); diff --git a/packages/http-client-java/generator/http-client-generator-test/package.json b/packages/http-client-java/generator/http-client-generator-test/package.json index 65332739e6..a8ca8b4145 100644 --- a/packages/http-client-java/generator/http-client-generator-test/package.json +++ b/packages/http-client-java/generator/http-client-generator-test/package.json @@ -14,7 +14,7 @@ "dependencies": { "@typespec/http-specs": "0.1.0-alpha.5", "@azure-tools/azure-http-specs": "0.1.0-alpha.4", - "@typespec/http-client-java": "file:/../../typespec-http-client-java-0.1.4.tgz", + "@typespec/http-client-java": "file:../../typespec-http-client-java-0.1.5.tgz", "@typespec/http-client-java-tests": "file:" }, "overrides": { diff --git a/packages/http-client-java/package-lock.json b/packages/http-client-java/package-lock.json index 5bbcfa2a3d..33bb25f262 100644 --- a/packages/http-client-java/package-lock.json +++ b/packages/http-client-java/package-lock.json @@ -1,12 +1,12 @@ { "name": "@typespec/http-client-java", - "version": "0.1.4", + "version": "0.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@typespec/http-client-java", - "version": "0.1.4", + "version": "0.1.5", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.0", diff --git a/packages/http-client-java/package.json b/packages/http-client-java/package.json index b75e74490d..5367482a48 100644 --- a/packages/http-client-java/package.json +++ b/packages/http-client-java/package.json @@ -1,6 +1,6 @@ { "name": "@typespec/http-client-java", - "version": "0.1.4", + "version": "0.1.5", "description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding", "keywords": [ "TypeSpec"